Index: lams_tool_assessment/web/pages/learning/learning.jsp =================================================================== diff -u -re10da332d88104fe61b1f646b8bcac22bbfd15f0 -rde19c5e8fd8537f1a34191cc5568d32eefd30c8f --- lams_tool_assessment/web/pages/learning/learning.jsp (.../learning.jsp) (revision e10da332d88104fe61b1f646b8bcac22bbfd15f0) +++ lams_tool_assessment/web/pages/learning/learning.jsp (.../learning.jsp) (revision de19c5e8fd8537f1a34191cc5568d32eefd30c8f) @@ -351,6 +351,7 @@ var minWordsLimitNotReachedQuestions = []; var maxWordsLimitExceededQuestions = []; var markHedgingWrongTotalQuestions = []; + var markHedgingWrongJustification = []; @@ -443,10 +444,12 @@ var totalSelected = countHedgeQuestionSelectTotal(questionIndex); //if totalSelected not equals to question's grade OR textarea is empty or contains only white-space - show warning - if (totalSelected != grade - || ${question.hedgingJustificationEnabled} && !$.trim($("#question" + questionIndex + "__lamstextarea").val())) { + if (totalSelected != grade) { markHedgingWrongTotalQuestions.push("${status.index}"); } + if(${question.hedgingJustificationEnabled} && !$.trim($("#question" + questionIndex + "__lamstextarea").val())){ + markHedgingWrongJustification.push("${status.index}"); + } } @@ -455,7 +458,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) { + && maxWordsLimitExceededQuestions.length == 0 && markHedgingWrongTotalQuestions.length == 0 && markHedgingWrongJustification.length ==0) { return true; } else { @@ -464,6 +467,7 @@ $('#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 @@ -501,6 +505,14 @@ //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); @@ -567,6 +579,10 @@ + + + +