Index: lams_tool_assessment/web/pages/learning/learning.jsp =================================================================== diff -u -r43fb0f7cdc24246ee4b4469e4e8f22b5035f4daa -r09147fe666e4bd39661695a2bace9b226a4b6130 --- lams_tool_assessment/web/pages/learning/learning.jsp (.../learning.jsp) (revision 43fb0f7cdc24246ee4b4469e4e8f22b5035f4daa) +++ lams_tool_assessment/web/pages/learning/learning.jsp (.../learning.jsp) (revision 09147fe666e4bd39661695a2bace9b226a4b6130) @@ -97,10 +97,15 @@ var grade = selects.length == 0 ? 0 : eval(selects.first().find('option:last-child').val()) var totalSelected = countHedgeQuestionSelectTotal(questionIndex); - var textareaValue = $("#question" + questionIndex + "__lamstextarea").val(); - var isButtonEnabled = (totalSelected == grade) && $.trim(textareaValue); + var isButtonEnabled = (totalSelected == grade); + //check if hedging justification is enabled + var justificationTextarea = $("#question" + questionIndex + "__lamstextarea"); + if( justificationTextarea.length) { + isButtonEnabled = isButtonEnabled && $.trim(justificationTextarea.val()); + } + //if totalSelected equals to question's grade - show button if (isButtonEnabled) { $("[type=button][name=submit-hedging-question" + questionIndex + "]").prop("disabled", "").removeClass("button-disabled"); @@ -450,12 +455,10 @@ } else { var grade = ${question.grade}; var totalSelected = countHedgeQuestionSelectTotal(questionIndex); - - var justificationTextareaValue = $("#question" + questionIndex + "__lamstextarea").val(); //if totalSelected not equals to question's grade OR textarea is empty or contains only white-space - show warning if (totalSelected != grade - || !$.trim(justificationTextareaValue)) { + || ${question.hedgingJustificationEnabled} && !$.trim($("#question" + questionIndex + "__lamstextarea").val())) { markHedgingWrongTotalQuestions.push("${status.index}"); } }