Index: lams_tool_assessment/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rce25caee003fbe6c0c3e1e0d4fa1238106b0aecf -rb4efdafc56d24361458ebb803387771843e452f7 --- lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision ce25caee003fbe6c0c3e1e0d4fa1238106b0aecf) +++ lams_tool_assessment/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision b4efdafc56d24361458ebb803387771843e452f7) @@ -259,6 +259,7 @@ label.info.maximum.number.words = This answer must have a maximum of {0} words. label.info.minimum.number.words = This answer must have a minimum of {0} words. label.info.max.and.min.number.words = This answer must have a minimal of {0} and maximum of {1} words. +warn.maximum.number.words = Entered text exceeds the maximum number of words. warn.answers.word.requirements.limit = In order to continue, please note the word limit restrictions. label.words = Words: message.no.reflection.available = No notebook entry has been added. Index: lams_tool_assessment/web/pages/learning/learning.jsp =================================================================== diff -u -r5d2ff2494dcfe4c72f1fa20564e29d707120268c -rb4efdafc56d24361458ebb803387771843e452f7 --- lams_tool_assessment/web/pages/learning/learning.jsp (.../learning.jsp) (revision 5d2ff2494dcfe4c72f1fa20564e29d707120268c) +++ lams_tool_assessment/web/pages/learning/learning.jsp (.../learning.jsp) (revision b4efdafc56d24361458ebb803387771843e452f7) @@ -40,13 +40,17 @@ padding: 0; } - [data-toggle="collapse"].collapsed .if-not-collapsed, [data-toggle="collapse"]:not(.collapsed) .if-collapsed { + [data-toggle="collapse"].collapsed .if-not-collapsed, + [data-toggle="collapse"]:not(.collapsed) .if-collapsed, + .max-word-limit-exceeded { display: none; } .countdown-timeout { color: #FF3333 !important; } + + @@ -382,12 +386,11 @@ }); } - //only if time limit is not expired - if (!isTimelimitExpired) { - if (!validateAnswers()) { - return; - } + // only if time limit is not expired + if (!isTimelimitExpired && !validateAnswers()) { + return; } + disableButtons(); // copy value from lams:textarea (only available in essay and mark hedging type of questions) to hidden input before submit @@ -430,7 +433,6 @@ var missingRequiredQuestions = []; var minWordsLimitNotReachedQuestions = []; - var maxWordsLimitExceededQuestions = []; var markHedgingWrongTotalQuestions = []; @@ -503,15 +505,6 @@ - //essay question which has max words limit - - var wordCount${status.index} = $('#word-count${status.index}').text(); - //max words limit is exceeded - if(wordCount${status.index} > ${question.maxWordsLimit}) { - maxWordsLimitExceededQuestions.push("${status.index}"); - } - - //essay question which has min words limit var wordCount${status.index} = $('#word-count${status.index}').text(); @@ -547,7 +540,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) { + && markHedgingWrongTotalQuestions.length == 0) { return true; } else { @@ -567,15 +560,6 @@ } - if (maxWordsLimitExceededQuestions.length != 0) { - //add .bg-warning class to those needs to be filled - for (i = 0; i < maxWordsLimitExceededQuestions.length; i++) { - $("#question-area-" + maxWordsLimitExceededQuestions[i]).addClass('bg-warning'); - } - //show alert message as well - $("#warning-words-limit").show(); - } - if (minWordsLimitNotReachedQuestions.length != 0) { //add .bg-warning class to those needs to be filled for (i = 0; i < minWordsLimitNotReachedQuestions.length; i++) { @@ -600,18 +584,11 @@ } } - function getNumberOfWords(value, isRemoveHtmlTags) { - - //HTML tags stripping - if (isRemoveHtmlTags) { - value = value.replace(/ /g, '').replace(/<\/?[a-z][^>]*>/gi, ''); - } - value = value.trim(); - - var wordCount = value ? (value.replace(/['";:,.?\-!]+/g, '').match(/\S+/g) || []).length : 0; - return wordCount; + function getNumberOfWords(value) { + var wordsForCounting = value.trim().replace(/['";:,.?\-!]+/g, ''); + return value ? (value.match(/\S+/g) || []).length : 0; } - + function logLearnerInteractionEvent(eventType, qbToolQuestionUid, optionUid) { $.ajax({ url: '', Index: lams_tool_assessment/web/pages/learning/parts/allquestions.jsp =================================================================== diff -u -r10e6a1f74ecf6ba2d60569e9b9677b88ed39650a -rb4efdafc56d24361458ebb803387771843e452f7 --- lams_tool_assessment/web/pages/learning/parts/allquestions.jsp (.../allquestions.jsp) (revision 10e6a1f74ecf6ba2d60569e9b9677b88ed39650a) +++ lams_tool_assessment/web/pages/learning/parts/allquestions.jsp (.../allquestions.jsp) (revision b4efdafc56d24361458ebb803387771843e452f7) @@ -40,7 +40,7 @@ ${question.question} -
+
Index: lams_tool_assessment/web/pages/learning/parts/essay.jsp =================================================================== diff -u -r2816144c4052c9d190639ba1f0a707ec5d884bb4 -rb4efdafc56d24361458ebb803387771843e452f7 --- lams_tool_assessment/web/pages/learning/parts/essay.jsp (.../essay.jsp) (revision 2816144c4052c9d190639ba1f0a707ec5d884bb4) +++ lams_tool_assessment/web/pages/learning/parts/essay.jsp (.../essay.jsp) (revision b4efdafc56d24361458ebb803387771843e452f7) @@ -1,53 +1,48 @@ <%@ include file="/common/taglibs.jsp"%> - + @@ -76,7 +71,6 @@ -
@@ -85,13 +79,19 @@ ${question.maxWordsLimit}
+
+ +
${question.maxWordsLimit}
+
+ +
@@ -109,7 +109,7 @@ - + @@ -124,7 +124,7 @@ - + 0