Index: lams_tool_assessment/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r6cb917bd72987d40f27b9ac4de8359b7014c94b3 -r10e6a1f74ecf6ba2d60569e9b9677b88ed39650a --- lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 6cb917bd72987d40f27b9ac4de8359b7014c94b3) +++ lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 10e6a1f74ecf6ba2d60569e9b9677b88ed39650a) @@ -269,7 +269,6 @@ warn.mark.hedging.wrong.total = In order to continue, all mark hedging questions should have all available marks assigned. label.incorrect.answer.nullifies.mark = Assigns full mark only when the correct answers are selected. label.export.summary = Summary -label.justify.hedging.marks = Please, justify your mark allocation. label.select.leader = Leader selection label.question.options = Question options label.activity.completion = End of activity Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java =================================================================== diff -u -r8ad6317cfff329136f05042200f2af81cbee110f -r10e6a1f74ecf6ba2d60569e9b9677b88ed39650a --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 8ad6317cfff329136f05042200f2af81cbee110f) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 10e6a1f74ecf6ba2d60569e9b9677b88ed39650a) @@ -731,7 +731,8 @@ } // store justification entered by the learner - if (assessment.isAllowAnswerJustification()) { + if (assessment.isAllowAnswerJustification() || (questionDto.getType().equals(QbQuestion.TYPE_MARK_HEDGING) + && questionDto.isHedgingJustificationEnabled())) { questionResult.setJustification(questionDto.getJustification()); } @@ -1808,6 +1809,17 @@ if (assessment.getQuestions() != null) { Set questions = assessment.getQuestions(); + boolean allowAnswerJustification = assessment.isAllowAnswerJustification(); + if (!allowAnswerJustification) { + for (AssessmentQuestion question : questions) { + if (question.getType().equals(QbQuestion.TYPE_MARK_HEDGING) + && question.getQbQuestion().isHedgingJustificationEnabled()) { + allowAnswerJustification = true; + break; + } + } + } + // question row title ExcelRow questionTitleRow = new ExcelRow(); questionTitleRow.addCell(getMessage("label.monitoring.question.summary.question"), true, @@ -1829,7 +1841,7 @@ ExcelCell.BORDER_STYLE_BOTTOM_THIN); questionTitleRow.addCell(getMessage("label.export.time.taken"), true, ExcelCell.BORDER_STYLE_BOTTOM_THIN); questionTitleRow.addCell(getMessage("label.export.mark"), true, ExcelCell.BORDER_STYLE_BOTTOM_THIN); - if (assessment.isAllowAnswerJustification()) { + if (allowAnswerJustification) { questionTitleRow.addCell(getMessage("label.answer.justification"), true, ExcelCell.BORDER_STYLE_BOTTOM_THIN); } @@ -1965,7 +1977,7 @@ userResultRow.addEmptyCell(); } - if (assessment.isAllowAnswerJustification()) { + if (allowAnswerJustification) { userResultRow.addCell(AssessmentEscapeUtils .escapeStringForExcelExport(questionResult.getJustification())); } @@ -3332,7 +3344,8 @@ if (user == null) { return null; } - AssessmentResult assessmentResult = getLastAssessmentResult(assessment.getUid(), Integer.valueOf(userId).longValue()); + AssessmentResult assessmentResult = getLastAssessmentResult(assessment.getUid(), + Integer.valueOf(userId).longValue()); if (assessmentResult == null) { return 0; } @@ -3343,10 +3356,10 @@ QbQuestion qbQuestion = qbToolQuestion.getQbQuestion(); if (qbQuestion.getType() == QbQuestion.TYPE_MULTIPLE_CHOICE || qbQuestion.getType() == QbQuestion.TYPE_MARK_HEDGING) { - + QuestionDTO questionDTO = new QuestionDTO(qbToolQuestion); loadupQuestionResultIntoQuestionDto(questionDTO, questionResult); - + calculateAnswerMark(assessment.getUid(), user.getUid(), questionResult, questionDTO); if (questionResult.getMark() > 0) { count++; Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/controller/LearningController.java =================================================================== diff -u -r64bfad846c475db43b1b303e0df03735f39d34ce -r10e6a1f74ecf6ba2d60569e9b9677b88ed39650a --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/controller/LearningController.java (.../LearningController.java) (revision 64bfad846c475db43b1b303e0df03735f39d34ce) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/controller/LearningController.java (.../LearningController.java) (revision 10e6a1f74ecf6ba2d60569e9b9677b88ed39650a) @@ -908,7 +908,8 @@ } // store justification entered by the learner - if (assessment.isAllowAnswerJustification()) { + if (assessment.isAllowAnswerJustification() || (questionDto.getType().equals(QbQuestion.TYPE_MARK_HEDGING) + && questionDto.isHedgingJustificationEnabled())) { String justification = WebUtil.readStrParam(request, AssessmentConstants.ATTR_ANSWER_JUSTIFICATION_PREFIX + i, true); questionDto.setJustification(justification); @@ -974,11 +975,6 @@ sumMarkHedging += optionDto.getAnswerInt(); } isAnswered = sumMarkHedging == questionDto.getMaxMark(); - - //verify justification of hedging is provided if it was enabled - if (questionDto.isHedgingJustificationEnabled()) { - isAnswered &= StringUtils.isNotBlank(questionDto.getAnswer()); - } } // check all questions were answered Index: lams_tool_assessment/web/includes/css/assessment.scss =================================================================== diff -u -r394f403c289f0fd7808c228840bead5c4e7d5d32 -r10e6a1f74ecf6ba2d60569e9b9677b88ed39650a --- lams_tool_assessment/web/includes/css/assessment.scss (.../assessment.scss) (revision 394f403c289f0fd7808c228840bead5c4e7d5d32) +++ lams_tool_assessment/web/includes/css/assessment.scss (.../assessment.scss) (revision 10e6a1f74ecf6ba2d60569e9b9677b88ed39650a) @@ -68,7 +68,7 @@ margin-left: 10px; } -#warning-answers-required, #warning-words-limit, #warning-mark-hedging-wrong-total,#warning-mark-hedging-wrong-justification{ +#warning-answers-required, #warning-words-limit, #warning-mark-hedging-wrong-total{ display: none; } Index: lams_tool_assessment/web/pages/learning/learning.jsp =================================================================== diff -u -r8d440baa0d18441b56553aabcc56e1981a84b206 -r10e6a1f74ecf6ba2d60569e9b9677b88ed39650a --- lams_tool_assessment/web/pages/learning/learning.jsp (.../learning.jsp) (revision 8d440baa0d18441b56553aabcc56e1981a84b206) +++ lams_tool_assessment/web/pages/learning/learning.jsp (.../learning.jsp) (revision 10e6a1f74ecf6ba2d60569e9b9677b88ed39650a) @@ -66,12 +66,6 @@ var isButtonEnabled = (totalSelected == maxMark); - //check if hedging justification is enabled - var justificationTextarea = $("#justification-question" + questionIndex); - if( justificationTextarea.length) { - isButtonEnabled = isButtonEnabled && $.trim(justificationTextarea.val()); - } - //if totalSelected equals to question's maxMark - show button if (isButtonEnabled) { $("[type=button][name=submit-hedging-question" + questionIndex + "]").prop("disabled", "").removeClass("button-disabled"); @@ -384,7 +378,6 @@ var minWordsLimitNotReachedQuestions = []; var maxWordsLimitExceededQuestions = []; var markHedgingWrongTotalQuestions = []; - var markHedgingWrongJustification = []; @@ -481,9 +474,6 @@ if (totalSelected != maxMark) { markHedgingWrongTotalQuestions.push("${status.index}"); } - if(${question.hedgingJustificationEnabled} && !$.trim($("#justification-question" + questionIndex).val())){ - markHedgingWrongJustification.push("${status.index}"); - } } @@ -492,7 +482,7 @@ //return true in case all required questions were answered, false otherwise if (missingRequiredQuestions.length == 0 && minWordsLimitNotReachedQuestions.length == 0 - && maxWordsLimitExceededQuestions.length == 0 && markHedgingWrongTotalQuestions.length == 0 && markHedgingWrongJustification.length ==0) { + && maxWordsLimitExceededQuestions.length == 0 && markHedgingWrongTotalQuestions.length == 0) { return true; } else { @@ -501,7 +491,6 @@ $('#warning-answers-required').hide(); $('#warning-words-limit').hide(); $('#warning-mark-hedging-wrong-total').hide(); - $('#warning-mark-hedging-wrong-justification').hide(); if (missingRequiredQuestions.length != 0) { //add .bg-warning class to those needs to be filled @@ -539,14 +528,6 @@ //show alert message as well $("#warning-mark-hedging-wrong-total").show(); } - if (markHedgingWrongJustification.length != 0) { - //add .bg-warning class to those needs to be filled - for (i = 0; i < markHedgingWrongJustification.length; i++) { - $("#question-area-" + markHedgingWrongJustification[i]).addClass('bg-warning'); - } - //show alert message as well - $("#warning-mark-hedging-wrong-justification").show(); - } $("html, body").animate({ scrollTop: 0 }, "slow");//window.scrollTo(0, 0); @@ -613,10 +594,6 @@ - - - -
Index: lams_tool_assessment/web/pages/learning/parts/allquestions.jsp =================================================================== diff -u -rcf0eebcaab1317079c30cb1d4e056ba9dd4ec048 -r10e6a1f74ecf6ba2d60569e9b9677b88ed39650a --- lams_tool_assessment/web/pages/learning/parts/allquestions.jsp (.../allquestions.jsp) (revision cf0eebcaab1317079c30cb1d4e056ba9dd4ec048) +++ lams_tool_assessment/web/pages/learning/parts/allquestions.jsp (.../allquestions.jsp) (revision 10e6a1f74ecf6ba2d60569e9b9677b88ed39650a) @@ -95,7 +95,8 @@ <%--Display jsutification for each question --%> - +