use of org.olat.ims.qti21.QTI21DeliveryOptions in project OpenOLAT by OpenOLAT.
the class IQConfigurationController method doPreview.
private void doPreview(UserRequest ureq) {
removeAsListenerAndDispose(previewLayoutCtr);
RepositoryEntry re = getIQReference();
if (re != null) {
Controller previewController;
if (OnyxModule.isOnyxTest(re.getOlatResource())) {
showError("error.onyx");
} else if (ImsQTI21Resource.TYPE_NAME.equals(re.getOlatResource().getResourceableTypeName())) {
// clean up last session
cleanUpQti21PreviewSession();
// need to clean up the assessment test session
QTI21DeliveryOptions deliveryOptions = qti21service.getDeliveryOptions(re);
QTI21OverrideOptions overrideOptions = QTI21OverrideOptions.nothingOverriden();
RepositoryEntry courseEntry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
previewQTI21Ctrl = new AssessmentTestDisplayController(ureq, getWindowControl(), new InMemoryOutcomeListener(), re, courseEntry, courseNode.getIdent(), deliveryOptions, overrideOptions, true, true, true);
listenTo(previewQTI21Ctrl);
stackPanel.pushController(translate("preview"), previewQTI21Ctrl);
} else {
long courseResId = course.getResourceableId().longValue();
previewController = iqManager.createIQDisplayController(moduleConfiguration, new IQPreviewSecurityCallback(), ureq, getWindowControl(), courseResId, courseNode.getIdent(), null);
previewLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), previewController);
stackPanel.pushController(translate("preview"), previewLayoutCtr);
}
}
}
use of org.olat.ims.qti21.QTI21DeliveryOptions in project OpenOLAT by OpenOLAT.
the class QTI21RetrieveTestsController method getSignatureOptions.
private DigitalSignatureOptions getSignatureOptions(AssessmentTestSession session) {
if (courseNode == null)
return null;
RepositoryEntry testEntry = session.getTestEntry();
RepositoryEntry courseEntry = session.getRepositoryEntry();
QTI21DeliveryOptions deliveryOptions = qtiService.getDeliveryOptions(testEntry);
boolean digitalSignature = deliveryOptions.isDigitalSignature();
boolean sendMail = deliveryOptions.isDigitalSignatureMail();
ModuleConfiguration config = courseNode.getModuleConfiguration();
digitalSignature = config.getBooleanSafe(IQEditController.CONFIG_DIGITAL_SIGNATURE, deliveryOptions.isDigitalSignature());
sendMail = config.getBooleanSafe(IQEditController.CONFIG_DIGITAL_SIGNATURE_SEND_MAIL, deliveryOptions.isDigitalSignatureMail());
DigitalSignatureOptions options = new DigitalSignatureOptions(digitalSignature, sendMail, courseEntry, testEntry);
if (digitalSignature) {
CourseEnvironment courseEnv = CourseFactory.loadCourse(courseEntry).getCourseEnvironment();
QTI21AssessmentRunController.decorateCourseConfirmation(session, options, courseEnv, courseNode, testEntry, null, getLocale());
}
return options;
}
use of org.olat.ims.qti21.QTI21DeliveryOptions in project OpenOLAT by OpenOLAT.
the class IQSURVCourseNode method createStatisticNodeResult.
@Override
public StatisticResourceResult createStatisticNodeResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, StatisticResourceOption options, QTIType... types) {
if (!isQTITypeAllowed(types))
return null;
Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
OLATResourceable courseOres = OresHelper.createOLATResourceableInstance("CourseModule", courseId);
RepositoryEntry qtiSurveyEntry = getReferencedRepositoryEntry();
if (ImsQTI21Resource.TYPE_NAME.equals(qtiSurveyEntry.getOlatResource().getResourceableTypeName())) {
RepositoryEntry courseEntry = userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
QTI21StatisticSearchParams searchParams = new QTI21StatisticSearchParams(qtiSurveyEntry, courseEntry, getIdent());
searchParams.setLimitToGroups(options.getParticipantsGroups());
QTI21DeliveryOptions deliveryOptions = CoreSpringFactory.getImpl(QTI21Service.class).getDeliveryOptions(qtiSurveyEntry);
boolean admin = userCourseEnv.isAdmin();
QTI21StatisticsSecurityCallback secCallback = new QTI21StatisticsSecurityCallback(admin, admin && deliveryOptions.isAllowAnonym());
return new QTI21StatisticResourceResult(qtiSurveyEntry, courseEntry, this, searchParams, secCallback);
}
QTIStatisticSearchParams searchParams = new QTIStatisticSearchParams(courseOres.getResourceableId(), getIdent());
searchParams.setLimitToGroups(options.getParticipantsGroups());
return new QTIStatisticResourceResult(courseOres, this, qtiSurveyEntry, searchParams);
}
use of org.olat.ims.qti21.QTI21DeliveryOptions in project OpenOLAT by OpenOLAT.
the class QTI12To21Converter method convert.
public AssessmentTest convert(VFSContainer originalContainer, QTIDocument doc, QTI21DeliveryOptions qti21Options) throws URISyntaxException {
Assessment assessment = doc.getAssessment();
AssessmentTest assessmentTest = new AssessmentTest();
String assessmentTestIdentifier = IdentifierGenerator.newAssessmentTestFilename();
File testFile = new File(unzippedDirRoot, assessmentTestIdentifier + ".xml");
manifest.appendAssessmentTest(testFile.getName());
assessmentTest.setIdentifier(assessmentTestIdentifier);
assessmentTest.setTitle(assessment.getTitle());
assessmentTest.setToolName(QTI21Constants.TOOLNAME);
assessmentTest.setToolVersion(Settings.getVersion());
convertDuration((Duration) assessment.getDuration(), assessmentTest);
TestPart testPart = AssessmentTestFactory.createTestPart(assessmentTest);
ItemSessionControl itemSessionControl = testPart.getItemSessionControl();
Control tmpControl = QTIEditHelper.getControl(assessment);
if (tmpControl.getSolution() == Control.CTRL_YES) {
itemSessionControl.setShowSolution(Boolean.TRUE);
}
if (qti21Options != null) {
qti21Options.setHideFeedbacks(false);
if (assessment.isInheritControls() && tmpControl.getFeedback() != Control.CTRL_YES) {
qti21Options.setHideFeedbacks(true);
}
}
AssessmentTestBuilder assessmentTestBuilder = new AssessmentTestBuilder(assessmentTest);
// root
List<Section> sections = assessment.getSections();
for (Section section : sections) {
convert(section, testPart);
}
// this are lost in QTI 2.1
// assessment.getSelection_ordering().getOrderType();
// assessment.getSelection_ordering().getSelectionNumber();
OutcomesProcessing outcomesProcessing = assessment.getOutcomes_processing();
if (outcomesProcessing != null) {
String cutValue = outcomesProcessing.getField(OutcomesProcessing.CUTVALUE);
if (StringHelper.containsNonWhitespace(cutValue)) {
try {
assessmentTestBuilder.setCutValue(Double.valueOf(cutValue));
} catch (NumberFormatException e) {
log.error("Cannot parse cut value: " + cutValue, e);
}
}
}
assessmentTestBuilder.setMaxScore(atomicMaxScore.doubleValue());
assessmentTest = assessmentTestBuilder.build();
persistAssessmentObject(testFile, assessmentTest);
manifest.write(new File(unzippedDirRoot, "imsmanifest.xml"));
copyMaterial(originalContainer);
return assessmentTest;
}
use of org.olat.ims.qti21.QTI21DeliveryOptions in project openolat by klemens.
the class IQIdentityListCourseNodeController method isSuspendEnable.
private boolean isSuspendEnable() {
ModuleConfiguration config = courseNode.getModuleConfiguration();
QTI21DeliveryOptions testOptions = qtiService.getDeliveryOptions(getReferencedRepositoryEntry());
boolean configRef = config.getBooleanSafe(IQEditController.CONFIG_KEY_CONFIG_REF, false);
boolean suspendEnabled = false;
if (!configRef) {
suspendEnabled = config.getBooleanSafe(IQEditController.CONFIG_KEY_ENABLESUSPEND, testOptions.isEnableSuspend());
} else {
suspendEnabled = testOptions.isEnableSuspend();
}
return suspendEnabled;
}
Aggregations