Skip to content
Snippets Groups Projects
Commit 276baef3 authored by srosse's avatar srosse
Browse files

OO-1593: set allowSkipping per default to true, add this option for the itemSessionControl editor

parent face54bf
No related branches found
No related tags found
No related merge requests found
......@@ -271,7 +271,7 @@ public class AssessmentTestFactory {
ItemSessionControl itemSessionControl = new ItemSessionControl(part);
itemSessionControl.setAllowComment(Boolean.FALSE);
itemSessionControl.setAllowReview(Boolean.FALSE);
itemSessionControl.setAllowSkipping(Boolean.FALSE);
itemSessionControl.setAllowSkipping(Boolean.TRUE);//default is true
itemSessionControl.setShowFeedback(Boolean.FALSE);
itemSessionControl.setShowSolution(Boolean.FALSE);
part.setItemSessionControl(itemSessionControl);
......
......@@ -48,7 +48,7 @@ public abstract class ItemSessionControlController extends FormBasicController {
private static final String[] attemtpsKeys = new String[] { "y", "n", "inherit" };
private TextElement maxAttemptsEl /*, maxTimeEl */;
private SingleSelection limitAttemptsEl, allowCommentEl, allowReviewEl, showSolutionEl;
private SingleSelection limitAttemptsEl, allowSkippingEl, allowCommentEl, allowReviewEl, showSolutionEl;
protected final boolean editable;
protected final boolean restrictedEdit;
......@@ -78,8 +78,8 @@ public abstract class ItemSessionControlController extends FormBasicController {
ItemSessionControl itemSessionControl = part.getItemSessionControl();//can be null
Integer maxAttempts = null;
if(part.getItemSessionControl() != null) {
maxAttempts = part.getItemSessionControl().getMaxAttempts();
if(itemSessionControl != null) {
maxAttempts = itemSessionControl.getMaxAttempts();
}
String[] aKeys = part instanceof TestPart ? yesnoKeys : attemtpsKeys;
String[] yesnoValues = new String[] { translate("yes"), translate("no") };
......@@ -106,6 +106,16 @@ public abstract class ItemSessionControlController extends FormBasicController {
maxAttemptsEl.setVisible(limitAttemptsEl.isSelected(0));
maxAttemptsEl.setEnabled(!restrictedEdit && editable);
allowSkippingEl = uifactory.addRadiosHorizontal("item.session.control.allow.skipping", formLayout, yesnoKeys, yesnoValues);
allowSkippingEl.addActionListener(FormEvent.ONCHANGE);
allowSkippingEl.setEnabled(!restrictedEdit && editable);
// the default value is allowSkipping=true
if(itemSessionControl != null && itemSessionControl.getAllowSkipping() != null && !itemSessionControl.getAllowSkipping().booleanValue()) {
allowSkippingEl.select(yesnoKeys[1], true);
} else {
allowSkippingEl.select(yesnoKeys[0], true);
}
allowCommentEl = uifactory.addRadiosHorizontal("item.session.control.allow.comment", formLayout, yesnoKeys, yesnoValues);
allowCommentEl.addActionListener(FormEvent.ONCHANGE);
allowCommentEl.setEnabled(!restrictedEdit && editable);
......@@ -207,6 +217,13 @@ public abstract class ItemSessionControlController extends FormBasicController {
protected void formOK(UserRequest ureq) {
ItemSessionControl itemSessionControl = part.getItemSessionControl();//can be null
// need to be first!
if(allowSkippingEl.isOneSelected() && allowSkippingEl.isSelected(0)) {
checkNotNull(itemSessionControl).setAllowSkipping(Boolean.TRUE);
} else if(itemSessionControl != null) {
itemSessionControl.setAllowSkipping(Boolean.FALSE);
}
if(allowCommentEl.isOneSelected() && allowCommentEl.isSelected(0)) {
checkNotNull(itemSessionControl).setAllowComment(Boolean.TRUE);
} else if(itemSessionControl != null) {
......
......@@ -89,6 +89,7 @@ form.testPart.navigationMode.nonlinear=Nicht linear
form.unkown=Unbekannt
item.session.control.allow.comment=Kommentar erlauben
item.session.control.allow.review=R\u00FCckblick erlauben
item.session.control.allow.skipping=Fragen \u00FCberspring erlauben
item.session.control.attempts=Versuch
item.session.control.show.solution=L\u00F6sung anzeigen
max.score=Maximal erreichbare Punktzahl
......
......@@ -89,6 +89,7 @@ form.unkown=Unkown
inherit=Inherit
item.session.control.allow.comment=Allow comments
item.session.control.allow.review=Allow review of questions
item.session.control.allow.skipping=Allow skipping questions
item.session.control.attempts=Attempts
item.session.control.show.solution=Show solution
max.score=Max. score
......
#Sun Aug 28 10:52:20 CEST 2016
#Wed Sep 14 18:02:58 CEST 2016
answers=R\u00E9ponses
change.elements=Edition
correct.answers=Correct
......@@ -89,6 +89,7 @@ form.unkown=Inconnu
inherit=H\u00E9rit\u00E9
item.session.control.allow.comment=Autoriser les commentaires
item.session.control.allow.review=Autoriser la revue des questions
item.session.control.allow.skipping=Autoriser \u00E0 sauter les questions
item.session.control.attempts=Tentatives
item.session.control.show.solution=Afficher la solution
max.score=Nombre de points maximum
......
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