Skip to content
Snippets Groups Projects
Commit ff3e6c10 authored by Florian Gnaegi - frentix GmbH's avatar Florian Gnaegi - frentix GmbH
Browse files

OO-1012 implement dependencies of menu configuration and item / section display

parent 6122c71b
No related branches found
No related tags found
No related merge requests found
...@@ -211,12 +211,17 @@ public class IQ12EditForm extends FormBasicController { ...@@ -211,12 +211,17 @@ public class IQ12EditForm extends FormBasicController {
renderSectionsOnly = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_RENDERMENUOPTION); renderSectionsOnly = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_RENDERMENUOPTION);
} }
menuRenderOptions.select(renderSectionsOnly.toString(), true); menuRenderOptions.select(renderSectionsOnly.toString(), true);
menuRenderOptions.addActionListener(this, FormEvent.ONCLICK);
// sequence type // sequence type
sequence = uifactory.addRadiosVertical("qti_form_sequence", "qti.form.sequence", formLayout, sequenceKeys, sequenceValues); sequence = uifactory.addRadiosVertical("qti_form_sequence", "qti.form.sequence", formLayout, sequenceKeys, sequenceValues);
String confSequence = (String)modConfig.get(IQEditController.CONFIG_KEY_SEQUENCE); String confSequence = (String)modConfig.get(IQEditController.CONFIG_KEY_SEQUENCE);
if (confSequence == null) confSequence = AssessmentInstance.QMD_ENTRY_SEQUENCE_ITEM; if (confSequence == null) confSequence = AssessmentInstance.QMD_ENTRY_SEQUENCE_ITEM;
sequence.select(confSequence, true); sequence.select(confSequence, true);
sequence.addActionListener(this, FormEvent.ONCLICK);
// when menu rendering is set to section only, show all question on the section otherwise not accessible
if (renderSectionsOnly) confSequence = AssessmentInstance.QMD_ENTRY_SEQUENCE_SECTION;
sequence.setEnabled(!renderSectionsOnly);
Boolean bDisplayQuestionTitle = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_QUESTIONTITLE); Boolean bDisplayQuestionTitle = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_QUESTIONTITLE);
...@@ -409,6 +414,16 @@ public class IQ12EditForm extends FormBasicController { ...@@ -409,6 +414,16 @@ public class IQ12EditForm extends FormBasicController {
endDateElement.clearError(); endDateElement.clearError();
if (!endDateElement.isVisible()) endDateElement.setValue(""); if (!endDateElement.isVisible()) endDateElement.setValue("");
endDateElement.setVisible(startDateElement.isVisible()); endDateElement.setVisible(startDateElement.isVisible());
if (isDisplayMenu() && isEnableMenu()) {
// when items not visible in menu, question sequence must be set to section to make items accessible
if (isMenuRenderSectionsOnly()) {
sequence.select(AssessmentInstance.QMD_ENTRY_SEQUENCE_SECTION, true);
sequence.setEnabled(false);
} else {
sequence.setEnabled(true);
}
}
flc.setDirty(true); flc.setDirty(true);
} }
......
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