Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java,v diff -u -r1.42.2.5 -r1.42.2.6 --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java 3 Jul 2015 16:36:01 -0000 1.42.2.5 +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java 30 Jul 2015 17:01:51 -0000 1.42.2.6 @@ -792,13 +792,20 @@ } else if (questionType == AssessmentConstants.QUESTION_TYPE_ORDERING) { } else if (questionType == AssessmentConstants.QUESTION_TYPE_MARK_HEDGING) { + + //store hedging marks for (AssessmentQuestionOption option : question.getOptions()) { Integer markHedging = WebUtil.readIntParam(request, AssessmentConstants.ATTR_QUESTION_PREFIX + i + "_" + option.getSequenceId(), true); if (markHedging != null) { option.setAnswerInt(markHedging); } } + + //store justificaion of hedging + String answerString = request.getParameter(AssessmentConstants.ATTR_QUESTION_PREFIX + i); + answerString = answerString.replaceAll("[\n\r\f]", ""); + question.setAnswerString(answerString); } } } @@ -821,13 +828,15 @@ int pageCount; for (pageCount = 0; pageCount < pagedQuestions.size(); pageCount++) { LinkedHashSet questionsForOnePage = pagedQuestions.get(pageCount); - + for (AssessmentQuestion question : questionsForOnePage) { - if (question.isAnswerRequired()) { + int questionType = question.getType(); + + //enforce all hedging marks question type to be answered as well + if (question.isAnswerRequired() || (questionType == AssessmentConstants.QUESTION_TYPE_MARK_HEDGING)) { boolean isAnswered = false; - int questionType = question.getType(); if (questionType == AssessmentConstants.QUESTION_TYPE_MULTIPLE_CHOICE) { for (AssessmentQuestionOption option : question.getOptions()) { @@ -850,11 +859,15 @@ } else if (questionType == AssessmentConstants.QUESTION_TYPE_MARK_HEDGING) { + //verify sum of all hedging marks is equal to question's grade int sumMarkHedging = 0; for (AssessmentQuestionOption option : question.getOptions()) { sumMarkHedging += option.getAnswerInt(); } - isAnswered = sumMarkHedging == question.getGrade(); + isAnswered = sumMarkHedging == question.getGrade(); + + //verify justification of hedging is provided + isAnswered &= StringUtils.isNotBlank(question.getAnswerString()); } // check all questions were answered Index: lams_tool_assessment/web/pages/learning/learning.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_assessment/web/pages/learning/learning.jsp,v diff -u -r1.37.2.4 -r1.37.2.5 --- lams_tool_assessment/web/pages/learning/learning.jsp 3 Jul 2015 16:36:02 -0000 1.37.2.4 +++ lams_tool_assessment/web/pages/learning/learning.jsp 30 Jul 2015 17:01:51 -0000 1.37.2.5 @@ -86,21 +86,29 @@