Index: lams_tool_assessment/web/pages/learning/learning.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r4353f26f9509808acdf41d0deef6cf5fd458a2b7 --- lams_tool_assessment/web/pages/learning/learning.jsp (.../learning.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_assessment/web/pages/learning/learning.jsp (.../learning.jsp) (revision 4353f26f9509808acdf41d0deef6cf5fd458a2b7) @@ -44,17 +44,15 @@ if (${isLeadershipEnabled}) { $(".mark-hedging-select").on('change keydown keypress keyup paste', function() { - //get questionIndex based on whether element is select or textbox - var questionIndex = $(this).is("select") ? $(this).data("question-index") : $(this).attr("name").substring(8, $(this).attr("name").indexOf("__")); - + var questionIndex = $(this).data("question-index"); var selects = $("select[name^=question" + questionIndex + "_]"); var grade = selects.length == 0 ? 0 : eval(selects.first().find('option:last-child').val()) var totalSelected = countHedgeQuestionSelectTotal(questionIndex); var isButtonEnabled = (totalSelected == grade); //check if hedging justification is enabled - var justificationTextarea = $("#question" + questionIndex + "__lamstextarea"); + var justificationTextarea = $("#justification-question" + questionIndex); if( justificationTextarea.length) { isButtonEnabled = isButtonEnabled && $.trim(justificationTextarea.val()); } @@ -175,15 +173,12 @@ if (isWaitingForConfirmation) return; //copy value from CKEditor (only available in essay type of questions) to textarea before ajax submit - $("textarea[id^='question']:not([id$='__lamstextarea'])").each(function() { + $("textarea[id^='question']").each(function() { var ckeditorData = CKEDITOR.instances[this.name].getData(); //skip out empty values this.value = ((ckeditorData == null) || (ckeditorData.replace(/ | |
|\s|

|<\/p>|\xa0/g, "").length == 0)) ? "" : ckeditorData; }); - //fire onchange event for lams:textarea - $("[id$=__lamstextarea]").change(); - //ajax form submit $('#answers').ajaxSubmit({ url: "?sessionMapID=${sessionMapID}&date=" + new Date().getTime(), @@ -400,7 +395,7 @@ if (totalSelected != grade) { markHedgingWrongTotalQuestions.push("${status.index}"); } - if(${question.hedgingJustificationEnabled} && !$.trim($("#question" + questionIndex + "__lamstextarea").val())){ + if(${question.hedgingJustificationEnabled} && !$.trim($("#justification-question" + questionIndex).val())){ markHedgingWrongJustification.push("${status.index}"); } } @@ -526,9 +521,9 @@

- + <%@ include file="/common/messages.jsp"%> @@ -543,11 +538,11 @@
- + class="btn btn-primary voffset10 pull-right na"> - +