diff --git a/src/main/java/de/bps/onyx/plugin/course/nodes/iq/IQEditForm.java b/src/main/java/de/bps/onyx/plugin/course/nodes/iq/IQEditForm.java index ed3aac5a5df2309e842ac454820a407def02d19c..2ce873bb40705998135b5627780b8bf6842e5880 100644 --- a/src/main/java/de/bps/onyx/plugin/course/nodes/iq/IQEditForm.java +++ b/src/main/java/de/bps/onyx/plugin/course/nodes/iq/IQEditForm.java @@ -220,7 +220,7 @@ public class IQEditForm extends FormBasicController { } //<OLATCE-982> - Boolean confAllowShowSolution = (Boolean) modConfig.get(IQEditController.CONFIG_KEY_ALLOW_SHOW_SOLUTION); + Boolean confAllowShowSolution = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_ALLOW_SHOW_SOLUTION); String[] allowShowSolution=new String[]{ALLOW}; String[] valuesShowSolution = new String[]{""}; //Surveys do not have a solution @@ -235,7 +235,7 @@ public class IQEditForm extends FormBasicController { } //</OLATCE-982> //<OLATCE-2009> - Boolean confAllowSuspension = (Boolean) modConfig.get(IQEditController.CONFIG_KEY_ALLOW_SUSPENSION_ALLOWED); + Boolean confAllowSuspension = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_ALLOW_SUSPENSION_ALLOWED); String[] allowSuspension = new String[] { ALLOW }; String[] valuesSuspesion = new String[] { "" }; allowSuspensionBox = uifactory.addCheckboxesHorizontal("allowSuspension", "qti.form.allowSuspension", formLayout, allowSuspension, @@ -299,7 +299,7 @@ public class IQEditForm extends FormBasicController { String configuredSummary = (String) modConfig.get(IQEditController.CONFIG_KEY_SUMMARY); boolean noSummary = configuredSummary != null && configuredSummary.equals(AssessmentInstance.QMD_ENTRY_SUMMARY_NONE) ? true : false; - Boolean showResultOnHomePage = (Boolean) modConfig.get(IQEditController.CONFIG_KEY_RESULT_ON_HOME_PAGE); + Boolean showResultOnHomePage = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_RESULT_ON_HOME_PAGE); boolean confEnableShowResultOnHomePage = (showResultOnHomePage != null) ? showResultOnHomePage.booleanValue() : false; confEnableShowResultOnHomePage = !noSummary && confEnableShowResultOnHomePage; showResultsOnHomePage = uifactory.addCheckboxesVertical("qti_enableResultsOnHomePage", "qti.form.results.onhomepage", formLayout, new String[] { "xx" }, @@ -308,7 +308,7 @@ public class IQEditForm extends FormBasicController { showResultsOnHomePage.addActionListener(FormEvent.ONCLICK); showResultsOnHomePage.setVisible(!isSurvey); - Boolean showResultsActive = (Boolean) modConfig.get(IQEditController.CONFIG_KEY_DATE_DEPENDENT_RESULTS); + Boolean showResultsActive = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_DATE_DEPENDENT_RESULTS); boolean showResultsDateDependent = false; // default false if (showResultsActive != null) { showResultsDateDependent = showResultsActive.booleanValue(); diff --git a/src/main/java/de/bps/onyx/plugin/run/OnyxRunController.java b/src/main/java/de/bps/onyx/plugin/run/OnyxRunController.java index 97f5095de75954eec8c2be015bea78daf40e7ab0..9809d23b438bf54c05bcc57dc3bd580426b94108 100644 --- a/src/main/java/de/bps/onyx/plugin/run/OnyxRunController.java +++ b/src/main/java/de/bps/onyx/plugin/run/OnyxRunController.java @@ -293,7 +293,7 @@ public class OnyxRunController extends BasicController { } } - Boolean confAllowSuspension = (Boolean) modConfig.get(CONFIG_KEY_ALLOW_SUSPENSION_ALLOWED); + Boolean confAllowSuspension = modConfig.getBooleanEntry(CONFIG_KEY_ALLOW_SUSPENSION_ALLOWED); confAllowSuspension = confAllowSuspension != null ? confAllowSuspension : false; boolean resumeSuspended = false; @@ -411,7 +411,7 @@ public class OnyxRunController extends BasicController { node = courseNodeSurvey; } - Boolean confAllowSuspension = (Boolean) modConfig.get(CONFIG_KEY_ALLOW_SUSPENSION_ALLOWED); + Boolean confAllowSuspension = modConfig.getBooleanEntry(CONFIG_KEY_ALLOW_SUSPENSION_ALLOWED); confAllowSuspension = confAllowSuspension != null ? confAllowSuspension : false; boolean resumeSuspended = false; @@ -528,7 +528,7 @@ public class OnyxRunController extends BasicController { QTIResultSet resultSet = null; TestState currentState = null; - Boolean exammode = (Boolean) modConfig.get(ExamPoolManager.CONFIG_KEY_EXAM_CONTROL); + Boolean exammode = modConfig.getBooleanEntry(ExamPoolManager.CONFIG_KEY_EXAM_CONTROL); exammode = exammode != null ? exammode : false; if (exammode) { @@ -539,7 +539,7 @@ public class OnyxRunController extends BasicController { if (resultSet == null || currentState == TestState.FINISHED || currentState == TestState.CANCELED || currentState == TestState.SUSPENDED) { // did not find a active attempt // try to check for a suspended one - Boolean confAllowSuspension = (Boolean) modConfig.get(CONFIG_KEY_ALLOW_SUSPENSION_ALLOWED); + Boolean confAllowSuspension = modConfig.getBooleanEntry(CONFIG_KEY_ALLOW_SUSPENSION_ALLOWED); confAllowSuspension = confAllowSuspension != null ? confAllowSuspension : false; Boolean formerlySuspended = (currentState == TestState.SUSPENDED); diff --git a/src/main/java/de/bps/onyx/util/ExamPool.java b/src/main/java/de/bps/onyx/util/ExamPool.java index 90a2e0383fe2850d4c67c7cd16768bcdaf32248b..fa98e9335f7c6c2557045fe86e4d1228fc7ed978 100644 --- a/src/main/java/de/bps/onyx/util/ExamPool.java +++ b/src/main/java/de/bps/onyx/util/ExamPool.java @@ -123,21 +123,21 @@ public class ExamPool implements Serializable { byte[] contentPackage = getContentPackage(entry); HashMap<String, String> parameterMap = new HashMap<String, String>(); // set allowShowSolution either to the configured value (!= null) or to defaultvalue false if test or survey, if selftest then the default is true - Boolean allowShowSolution = (Boolean) courseNode.getModuleConfiguration().get(IQEditController.CONFIG_KEY_ALLOW_SHOW_SOLUTION); + Boolean allowShowSolution = courseNode.getModuleConfiguration().getBooleanEntry(IQEditController.CONFIG_KEY_ALLOW_SHOW_SOLUTION); allowShowSolution = allowShowSolution != null ? allowShowSolution : false; parameterMap.put(SHOW_SOLUTION, String.valueOf(allowShowSolution)); // Boolean showFeedback = (Boolean) courseNode.getModuleConfiguration().get(IQEditController.CONFIG_KEY_ALLOW_SHOW_FEEDBACK); // showFeedback = showFeedback != null ? showFeedback : false; // parameterMap.put(SHOW_FEEDBACK, String.valueOf(showFeedback)); parameterMap.put(IS_SURVEY, String.valueOf(referencedCourseNode instanceof IQSURVCourseNode)); - Boolean examControl = (Boolean) courseNode.getModuleConfiguration().get(ExamPoolManager.CONFIG_KEY_EXAM_CONTROL); + Boolean examControl = courseNode.getModuleConfiguration().getBooleanEntry(ExamPoolManager.CONFIG_KEY_EXAM_CONTROL); examControl = examControl != null ? examControl : Boolean.FALSE; //couple the synchronizedStart again to the examMode Boolean synchronizedStart = (Boolean) courseNode.getModuleConfiguration().get(ExamPoolManager.CONFIG_KEY_EXAM_CONTROL_SYNCHRONIZED_START); synchronizedStart = synchronizedStart != null ? synchronizedStart && examControl : false; parameterMap.put(IS_SYNCHRONIZED, String.valueOf(synchronizedStart)); parameterMap.put(CONTINUATION_ALLOWED, Boolean.toString(!examControl.booleanValue())); - Boolean allowSuspension = (Boolean) courseNode.getModuleConfiguration().get(IQEditController.CONFIG_KEY_ALLOW_SUSPENSION_ALLOWED); + Boolean allowSuspension = courseNode.getModuleConfiguration().getBooleanEntry(IQEditController.CONFIG_KEY_ALLOW_SUSPENSION_ALLOWED); allowSuspension = allowSuspension != null ? allowSuspension : false; parameterMap.put(SUSPENSION_ALLOWED, String.valueOf(allowSuspension)); diff --git a/src/main/java/org/olat/course/assessment/AssessmentHelper.java b/src/main/java/org/olat/course/assessment/AssessmentHelper.java index ac92bf32ce107b72b7b85d29d3b35c284a52a4fc..4209e3b4e2b6088366213dc6f76ea7e6062e041d 100644 --- a/src/main/java/org/olat/course/assessment/AssessmentHelper.java +++ b/src/main/java/org/olat/course/assessment/AssessmentHelper.java @@ -582,7 +582,7 @@ public class AssessmentHelper { */ public static boolean isResultVisible(ModuleConfiguration modConfig) { boolean isVisible = false; - Boolean showResultsActive = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_DATE_DEPENDENT_RESULTS); + Boolean showResultsActive = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_DATE_DEPENDENT_RESULTS); if(showResultsActive != null && showResultsActive.booleanValue()) { Date startDate = (Date)modConfig.get(IQEditController.CONFIG_KEY_RESULTS_START_DATE); Date endDate = (Date)modConfig.get(IQEditController.CONFIG_KEY_RESULTS_END_DATE); diff --git a/src/main/java/org/olat/course/nodes/iq/IQ12EditForm.java b/src/main/java/org/olat/course/nodes/iq/IQ12EditForm.java index 86539078f03d3c2f4f3f4f8755bad544e604d971..8c1322a38212c2fe923d08501217ae3824381e80 100644 --- a/src/main/java/org/olat/course/nodes/iq/IQ12EditForm.java +++ b/src/main/java/org/olat/course/nodes/iq/IQ12EditForm.java @@ -218,7 +218,7 @@ public class IQ12EditForm extends FormBasicController { //add it blockAfterSuccess = uifactory.addCheckboxesHorizontal("blockAfterSuccess", "qti.form.block.afterSuccess", formLayout, new String[]{"xx"}, new String[]{null}); - Boolean block = (Boolean) modConfig.get(IQEditController.CONFIG_KEY_BLOCK_AFTER_SUCCESS); + Boolean block = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_BLOCK_AFTER_SUCCESS); blockAfterSuccess.select("xx", block == null ? false : block.booleanValue() ); // Only assessments have a limitation on number of attempts @@ -253,16 +253,16 @@ public class IQ12EditForm extends FormBasicController { } } - Boolean fullWindow = (Boolean) modConfig.get(IQEditController.CONFIG_FULLWINDOW); + Boolean fullWindow = modConfig.getBooleanEntry(IQEditController.CONFIG_FULLWINDOW); fullWindowEl = uifactory.addCheckboxesHorizontal("fullwindow", "qti.form.fullwindow", formLayout, new String[]{"fullwindow"}, new String[]{null}); fullWindowEl.select("fullwindow", fullWindow == null ? true : fullWindow.booleanValue()); - Boolean CdisplayMenu = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_DISPLAYMENU); + Boolean CdisplayMenu = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_DISPLAYMENU); displayMenu = uifactory.addCheckboxesHorizontal("qti_displayMenu", "qti.form.menudisplay", formLayout, new String[]{"xx"}, new String[]{null}); displayMenu.select("xx", CdisplayMenu == null ? true : CdisplayMenu ); displayMenu.addActionListener(FormEvent.ONCLICK); - Boolean CenableMenu = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_ENABLEMENU); + Boolean CenableMenu = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_ENABLEMENU); enableMenu = uifactory.addCheckboxesHorizontal("qti_enableMenu", "qti.form.menuenable", formLayout, new String[]{"xx"}, new String[]{null}); enableMenu.select("xx", CenableMenu == null ? true : CenableMenu); @@ -274,7 +274,7 @@ public class IQ12EditForm extends FormBasicController { modConfig.set(IQEditController.CONFIG_KEY_RENDERMENUOPTION, Boolean.FALSE); renderSectionsOnly = Boolean.FALSE; } else { - renderSectionsOnly = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_RENDERMENUOPTION); + renderSectionsOnly = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_RENDERMENUOPTION); } menuRenderOptions.select(renderSectionsOnly.toString(), true); menuRenderOptions.addActionListener(FormEvent.ONCLICK); @@ -290,33 +290,33 @@ public class IQ12EditForm extends FormBasicController { sequence.setEnabled(!renderSectionsOnly); - Boolean bDisplayQuestionTitle = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_QUESTIONTITLE); + Boolean bDisplayQuestionTitle = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_QUESTIONTITLE); boolean confDisplayQuestionTitle = (bDisplayQuestionTitle != null) ? bDisplayQuestionTitle.booleanValue() : true; displayQuestionTitle = uifactory.addCheckboxesHorizontal("qti_displayQuestionTitle", "qti.form.questiontitle", formLayout, new String[]{"xx"}, new String[]{null}); displayQuestionTitle.select("xx", confDisplayQuestionTitle); //display automatic enumetation of choice options - Boolean bAutoEnum = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_AUTOENUM_CHOICES); + Boolean bAutoEnum = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_AUTOENUM_CHOICES); boolean confAutoEnum = (bAutoEnum != null) ? bAutoEnum.booleanValue() : false; autoEnumerateChoices = uifactory.addCheckboxesHorizontal("qti_AutoEnumChoices", "qti.form.auto.enumerate.choices", formLayout, new String[]{"xx"}, new String[]{null}); autoEnumerateChoices.select("xx", confAutoEnum); //provide memo field - Boolean bMemo = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_MEMO); + Boolean bMemo = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_MEMO); boolean confMemo = (bMemo != null) ? bMemo.booleanValue() : false; provideMemoField = uifactory.addCheckboxesHorizontal("qti_provideMemoField", "qti.form.auto.memofield", formLayout, new String[]{"xx"}, new String[]{null}); provideMemoField.select("xx", confMemo); // question progress - Boolean bEnableQuestionProgress = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_QUESTIONPROGRESS); + Boolean bEnableQuestionProgress = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_QUESTIONPROGRESS); boolean confEnableQuestionProgress = (bEnableQuestionProgress != null) ? bEnableQuestionProgress.booleanValue() : true; displayQuestionProgress = uifactory.addCheckboxesHorizontal("qti_enableQuestionProgress", "qti.form.questionprogress", formLayout, new String[]{"xx"}, new String[]{null}); displayQuestionProgress.select("xx", confEnableQuestionProgress); displayQuestionProgress.setVisible(!isSurvey); // score progress - Boolean bEnableScoreProgress = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_SCOREPROGRESS); + Boolean bEnableScoreProgress = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_SCOREPROGRESS); boolean confEnableScoreProgress = (bEnableScoreProgress != null) ? bEnableScoreProgress.booleanValue() : true; displayScoreProgress = uifactory.addCheckboxesHorizontal("resultTitle", "qti.form.scoreprogress", formLayout, new String[]{"xx"}, new String[]{null}); @@ -330,7 +330,7 @@ public class IQ12EditForm extends FormBasicController { // enable cancel - Boolean bEnableCancel = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_ENABLECANCEL); + Boolean bEnableCancel = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_ENABLECANCEL); boolean confEnableCancel = true; if (bEnableCancel != null) { // if defined use config value @@ -350,7 +350,7 @@ public class IQ12EditForm extends FormBasicController { } // enable suspend - Boolean bEnableSuspend = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_ENABLESUSPEND); + Boolean bEnableSuspend = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_ENABLESUSPEND); boolean confEnableSuspend = (bEnableSuspend != null) ? bEnableSuspend.booleanValue() : false; enableSuspend = uifactory.addCheckboxesHorizontal("qti_enableSuspend", "qti.form.enablesuspend", formLayout, new String[]{"xx"}, new String[]{null}); enableSuspend.select("xx", confEnableSuspend); @@ -358,7 +358,7 @@ public class IQ12EditForm extends FormBasicController { uifactory.addSpacerElement("s2", formLayout, true); //Show score infos on start page - Boolean bEnableScoreInfos = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_ENABLESCOREINFO); + Boolean bEnableScoreInfos = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_ENABLESCOREINFO); boolean enableScoreInfos = (bEnableScoreInfos != null) ? bEnableScoreInfos.booleanValue() : true; scoreInfo = uifactory.addCheckboxesHorizontal("qti_scoreInfo", "qti.form.scoreinfo", formLayout, new String[]{"xx"}, new String[]{null}); scoreInfo.select("xx", enableScoreInfos); @@ -376,7 +376,7 @@ public class IQ12EditForm extends FormBasicController { boolean noSummary = configuredSummary!=null && configuredSummary.equals(AssessmentInstance.QMD_ENTRY_SUMMARY_NONE) ? true : false; - Boolean showResultOnHomePage = (Boolean) modConfig.get(IQEditController.CONFIG_KEY_RESULT_ON_HOME_PAGE); + Boolean showResultOnHomePage = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_RESULT_ON_HOME_PAGE); boolean confEnableShowResultOnHomePage = (showResultOnHomePage != null) ? showResultOnHomePage.booleanValue() : false; confEnableShowResultOnHomePage = !noSummary && confEnableShowResultOnHomePage; showResultsOnHomePage = uifactory.addCheckboxesHorizontal("qti_enableResultsOnHomePage", "qti.form.results.onhomepage", formLayout, new String[]{"xx"}, new String[]{null}); @@ -384,7 +384,7 @@ public class IQ12EditForm extends FormBasicController { showResultsOnHomePage.addActionListener(FormEvent.ONCLICK); showResultsOnHomePage.setVisible(!isSurvey); - Boolean showResultsActive = (Boolean) modConfig.get(IQEditController.CONFIG_KEY_DATE_DEPENDENT_RESULTS); + Boolean showResultsActive = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_DATE_DEPENDENT_RESULTS); boolean showResultsDateDependent = false; // default false if (showResultsActive != null) { showResultsDateDependent = showResultsActive.booleanValue(); @@ -409,7 +409,7 @@ public class IQ12EditForm extends FormBasicController { endDateElement.setDateChooserTimeEnabled(true); endDateElement.setDate(endDate); - Boolean showResultOnFinish = (Boolean) modConfig.get(IQEditController.CONFIG_KEY_RESULT_ON_FINISH); + Boolean showResultOnFinish = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_RESULT_ON_FINISH); boolean confEnableShowResultOnFinish = (showResultOnFinish != null) ? showResultOnFinish.booleanValue() : true; confEnableShowResultOnFinish = !noSummary && confEnableShowResultOnFinish; showResultsAfterFinishTest = uifactory.addCheckboxesHorizontal("qti_enableResultsOnFinish", "qti.form.results.onfinish", formLayout, new String[]{"xx"}, new String[]{null}); diff --git a/src/main/java/org/olat/course/nodes/iq/IQRunController.java b/src/main/java/org/olat/course/nodes/iq/IQRunController.java index 1aab9d47a4f3c14439aa72349df7317a21eb3223..9b8a442ed70f5b3ffb817cac84f6ce9cfa8aac55 100644 --- a/src/main/java/org/olat/course/nodes/iq/IQRunController.java +++ b/src/main/java/org/olat/course/nodes/iq/IQRunController.java @@ -183,7 +183,7 @@ public class IQRunController extends BasicController implements GenericEventList } //if show results on test home page configured - show log - Boolean showResultOnHomePage = (Boolean) testCourseNode.getModuleConfiguration().get(IQEditController.CONFIG_KEY_RESULT_ON_HOME_PAGE); + Boolean showResultOnHomePage = testCourseNode.getModuleConfiguration().getBooleanEntry(IQEditController.CONFIG_KEY_RESULT_ON_HOME_PAGE); myContent.contextPut("showChangelog", showResultOnHomePage); } @@ -594,7 +594,7 @@ public class IQRunController extends BasicController implements GenericEventList myContent.contextPut("attempts", 0); } else { //block if test passed (and config set to check it) - Boolean blockAfterSuccess = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_BLOCK_AFTER_SUCCESS); + Boolean blockAfterSuccess = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_BLOCK_AFTER_SUCCESS); Boolean blocked = Boolean.FALSE; if(blockAfterSuccess != null && blockAfterSuccess.booleanValue()) { Boolean passed = assessmentEntry.getPassed(); @@ -655,7 +655,7 @@ public class IQRunController extends BasicController implements GenericEventList String configuredSummary = (String) modConfig.get(IQEditController.CONFIG_KEY_SUMMARY); boolean noSummary = configuredSummary==null || (configuredSummary!=null && configuredSummary.equals(AssessmentInstance.QMD_ENTRY_SUMMARY_NONE)); if(!noSummary) { - Boolean showResultsObj = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_RESULT_ON_HOME_PAGE); + Boolean showResultsObj = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_RESULT_ON_HOME_PAGE); boolean showResultsOnHomePage = (showResultsObj!=null && showResultsObj.booleanValue()); myContent.contextPut("showResultsOnHomePage",new Boolean(showResultsOnHomePage)); boolean dateRelatedVisibility = AssessmentHelper.isResultVisible(modConfig); diff --git a/src/main/java/org/olat/ims/qti/process/AssessmentInstance.java b/src/main/java/org/olat/ims/qti/process/AssessmentInstance.java index 7a3328bb85eac16aa909d1b84e2570263bb1744f..d877cc60b0e787e7e4ab00dc217006ca6e132fc4 100644 --- a/src/main/java/org/olat/ims/qti/process/AssessmentInstance.java +++ b/src/main/java/org/olat/ims/qti/process/AssessmentInstance.java @@ -157,28 +157,28 @@ public class AssessmentInstance implements Serializable { // fetch display titles option displayTitles = DISPLAYTITLES_DEFAULT; - Boolean confDisplayTitles = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_QUESTIONTITLE); + Boolean confDisplayTitles = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_QUESTIONTITLE); if (confDisplayTitles != null) { displayTitles = confDisplayTitles.booleanValue(); } // fetch auto enum choice options switch autoEnum = AUTOENUM_DEFAULT; - Boolean confAutoEnum = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_AUTOENUM_CHOICES); + Boolean confAutoEnum = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_AUTOENUM_CHOICES); if (confAutoEnum != null) { autoEnum = confAutoEnum.booleanValue(); } // fetch auto enum choice options switch memo = MEMO_DEFAULT; - Boolean confMemo = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_MEMO); + Boolean confMemo = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_MEMO); if (confMemo != null) { memo = confMemo.booleanValue(); } // fetch type of menu menu = MENU_DEFAULT; - Boolean confEnableMenu = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_ENABLEMENU); + Boolean confEnableMenu = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_ENABLEMENU); if (confEnableMenu != null) { menu = confEnableMenu.booleanValue(); } diff --git a/src/main/java/org/olat/modules/iq/IQDisplayController.java b/src/main/java/org/olat/modules/iq/IQDisplayController.java index 16195e01be903b83cc73b652570c540a40f42fbd..0169189851e83ff6f47e7bd2b04f8ce659bdc93d 100644 --- a/src/main/java/org/olat/modules/iq/IQDisplayController.java +++ b/src/main/java/org/olat/modules/iq/IQDisplayController.java @@ -223,7 +223,7 @@ public class IQDisplayController extends DefaultController implements GenericEve qtiscoreprogress = new ProgressBar("qtiscoreprogress", 150, 0, 0, ""); myContent.put("qtiscoreprogress", qtiscoreprogress); - Boolean displayScoreProgress = (Boolean) modConfig.get(IQEditController.CONFIG_KEY_SCOREPROGRESS); + Boolean displayScoreProgress = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_SCOREPROGRESS); if (displayScoreProgress == null) displayScoreProgress = Boolean.TRUE; // migration, // display // menu @@ -232,7 +232,7 @@ public class IQDisplayController extends DefaultController implements GenericEve qtiquestionprogress = new ProgressBar("qtiquestionprogress", 150, 0, 0, ""); myContent.put("qtiquestionprogress", qtiquestionprogress); - Boolean displayQuestionProgress = (Boolean) modConfig.get(IQEditController.CONFIG_KEY_QUESTIONPROGRESS); + Boolean displayQuestionProgress = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_QUESTIONPROGRESS); if (displayQuestionProgress == null) displayQuestionProgress = Boolean.FALSE; // migration, // don't // display @@ -241,11 +241,11 @@ public class IQDisplayController extends DefaultController implements GenericEve if (!displayQuestionProgress.booleanValue()) qtiquestionprogress.setVisible(false); myContent.contextPut("displayQuestionProgress", displayQuestionProgress); - Boolean displayMenu = (Boolean) modConfig.get(IQEditController.CONFIG_KEY_DISPLAYMENU); + Boolean displayMenu = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_DISPLAYMENU); if (displayMenu == null) displayMenu = Boolean.TRUE; // migration myContent.contextPut("displayMenu", displayMenu); - Boolean enableCancel = (Boolean) modConfig.get(IQEditController.CONFIG_KEY_ENABLECANCEL); + Boolean enableCancel = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_ENABLECANCEL); if (enableCancel == null) { if (modConfig.get(IQEditController.CONFIG_KEY_TYPE).equals(AssessmentInstance.QMD_ENTRY_TYPE_ASSESS)) enableCancel = Boolean.FALSE; // migration: // disable @@ -256,7 +256,7 @@ public class IQDisplayController extends DefaultController implements GenericEve } myContent.contextPut("enableCancel", enableCancel); - Boolean enableSuspend = (Boolean) modConfig.get(IQEditController.CONFIG_KEY_ENABLESUSPEND); + Boolean enableSuspend = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_ENABLESUSPEND); if (enableSuspend == null) enableSuspend = Boolean.FALSE; // migration myContent.contextPut("enableSuspend", enableSuspend); @@ -312,7 +312,7 @@ public class IQDisplayController extends DefaultController implements GenericEve }else { renderSectionsOnly = (Boolean)tmp; } - boolean enabledMenu = ((Boolean)modConfig.get(IQEditController.CONFIG_KEY_ENABLEMENU)).booleanValue(); + boolean enabledMenu = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_ENABLEMENU).booleanValue(); boolean itemPageSequence = ((String)modConfig.get(IQEditController.CONFIG_KEY_SEQUENCE)).equals(AssessmentInstance.QMD_ENTRY_SEQUENCE_ITEM); IQMenuDisplayConf mdc = new IQMenuDisplayConf(renderSectionsOnly.booleanValue(), enabledMenu, itemPageSequence); @@ -596,7 +596,7 @@ public class IQDisplayController extends DefaultController implements GenericEve fireEvent(ureq, new IQSubmittedEvent()); } - Boolean showResultsOnFinishObj = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_RESULT_ON_FINISH); + Boolean showResultsOnFinishObj = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_RESULT_ON_FINISH); boolean showResultsOnFinish = showResultsOnFinishObj==null || showResultsOnFinishObj!=null && showResultsOnFinishObj.booleanValue(); if (ai.getSummaryType() == AssessmentInstance.SUMMARY_NONE || !showResultsOnFinish) { // do not display results reporting