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

OO-1096: if the checkbox is not saved on the database (as in preview of a...

OO-1096: if the checkbox is not saved on the database (as in preview of a checkbox which is not published) do nothing but write a warning
parent 17a5e87e
No related branches found
No related tags found
No related merge requests found
......@@ -277,21 +277,26 @@ public class CheckListRunController extends FormBasicController implements Contr
} else {
theOne = wrapper.getDbCheckbox();
}
Float score;
if(checked) {
score = wrapper.getCheckbox().getPoints();
if(theOne == null) {
//only warning because this happen in course preview
logWarn("A checkbox is missing: " + courseOres + " / " + courseNode.getIdent(), null);
} else {
score = 0f;
Float score;
if(checked) {
score = wrapper.getCheckbox().getPoints();
} else {
score = 0f;
}
checkboxManager.check(theOne, getIdentity(), score, new Boolean(checked));
//make sure all results is on the database before calculating some scores
//manager commit already DBFactory.getInstance().commit();
courseNode.updateScoreEvaluation(userCourseEnv, getIdentity());
Checkbox checkbox = wrapper.getCheckbox();
logUpdateCheck(checkbox.getCheckboxId(), checkbox.getTitle());
}
checkboxManager.check(theOne, getIdentity(), score, new Boolean(checked));
//make sure all results is on the database before calculating some scores
//manager commit already DBFactory.getInstance().commit();
courseNode.updateScoreEvaluation(userCourseEnv, getIdentity());
Checkbox checkbox = wrapper.getCheckbox();
logUpdateCheck(checkbox.getCheckboxId(), checkbox.getTitle());
exposeUserDataToVC(flc);
}
......
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