Skip to content
Snippets Groups Projects
Commit 55fd74eb authored by srosse's avatar srosse
Browse files

OO-2757: check keys and type in test course element to prevent error due to...

OO-2757: check keys and type in test course element to prevent error due to switch from test with QTI 2.1 and 1.2
parent 327f3d64
No related branches found
No related tags found
No related merge requests found
......@@ -228,13 +228,19 @@ public class IQ12EditForm extends FormBasicController {
showResultsDateDependentButton.setEnabled(false);
}
Date startDate = (Date) modConfig.get(IQEditController.CONFIG_KEY_RESULTS_START_DATE);
Date startDate = null;
if(modConfig.get(IQEditController.CONFIG_KEY_RESULTS_START_DATE) instanceof Date) {
startDate = (Date)modConfig.get(IQEditController.CONFIG_KEY_RESULTS_START_DATE);
}
startDateElement = uifactory.addDateChooser("qti_form_start_date", "qti.form.date.start", null, formLayout);
startDateElement.setDateChooserTimeEnabled(true);
startDateElement.setDate(startDate);
startDateElement.setMandatory(true);
Date endDate = (Date) modConfig.get(IQEditController.CONFIG_KEY_RESULTS_END_DATE);
Date endDate = null;
if(modConfig.get(IQEditController.CONFIG_KEY_RESULTS_END_DATE) instanceof Date) {
endDate = (Date) modConfig.get(IQEditController.CONFIG_KEY_RESULTS_END_DATE);
}
endDateElement = uifactory.addDateChooser("qti_form_end_date", "qti.form.date.end", null, formLayout);
endDateElement.setDateChooserTimeEnabled(true);
endDateElement.setDate(endDate);
......@@ -265,7 +271,11 @@ public class IQ12EditForm extends FormBasicController {
confSummary = AssessmentInstance.QMD_ENTRY_SUMMARY_COMPACT;
}
if (isAssessment || isSelfTest) {
summary.select(confSummary, true);
for(String summaryKey:summaryKeys) {
if(summaryKey.equals(confSummary)) {
summary.select(summaryKey, true);
}
}
} else {
summary.setEnabled(false);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment