Index: lams_tool_assessment/web/pages/monitoring/parts/masterDetailLoadUp.jsp =================================================================== diff -u -rb24905d1333db0acd4bd02019d43c877e849e97a -r0db48a90dde9c1543cf5d752955592ffb6dca5ee --- lams_tool_assessment/web/pages/monitoring/parts/masterDetailLoadUp.jsp (.../masterDetailLoadUp.jsp) (revision b24905d1333db0acd4bd02019d43c877e849e97a) +++ lams_tool_assessment/web/pages/monitoring/parts/masterDetailLoadUp.jsp (.../masterDetailLoadUp.jsp) (revision 0db48a90dde9c1543cf5d752955592ffb6dca5ee) @@ -11,13 +11,19 @@ var responseStr = ""; <%@ include file="userresponse.jsp"%> - jQuery("#userSummary${assessmentResult.sessionId}").addRowData(${i.index + 1}, { + + var table = jQuery("#userSummary${assessmentResult.sessionId}"); + table.addRowData(${i.index + 1}, { id:"${i.index + 1}", questionResultUid:"${questionResult.uid}", title:"${fn:escapeXml(title)}", response:responseStr, grade:"" }); + + + // set maxGrade attribute to cell DOM element + table.setCell(${i.index + 1}, "grade", "", null, {"maxGrade" : ${questionResult.maxMark}}); }; masterDetailLoadUp(); Index: lams_tool_assessment/web/pages/monitoring/parts/questionsummary.jsp =================================================================== diff -u -r1e33f64c06430834c80a2b01d42bcdf844c5d958 -r0db48a90dde9c1543cf5d752955592ffb6dca5ee --- lams_tool_assessment/web/pages/monitoring/parts/questionsummary.jsp (.../questionsummary.jsp) (revision 1e33f64c06430834c80a2b01d42bcdf844c5d958) +++ lams_tool_assessment/web/pages/monitoring/parts/questionsummary.jsp (.../questionsummary.jsp) (revision 0db48a90dde9c1543cf5d752955592ffb6dca5ee) @@ -57,6 +57,17 @@ beforeEditCell: function (rowid,name,val,iRow,iCol){ previousCellValue = val; }, + beforeSaveCell : function(rowid, name, val, iRow, iCol) { + if (isNaN(val)) { + return null; + } + + var maxGrade = jQuery("table#session${session.sessionId} tr#" + iRow + + " td[aria-describedby$='_" + name + "']").attr("maxGrade"); + if (val > maxGrade) { + return maxGrade; + } + }, afterSaveCell : function (rowid,name,val,iRow,iCol){ var questionResultUid = jQuery("#session${session.sessionId}").getCell(rowid, 'questionResultUid'); if (isNaN(val) || (questionResultUid=="")) { @@ -102,12 +113,16 @@ - jQuery("#session${session.sessionId}").addRowData(${i.index + 1}, { + var table = jQuery("#session${session.sessionId}"); + table.addRowData(${i.index + 1}, { questionResultUid:"${questionResult.uid}", userName:"${questionResult.user.lastName}, ${questionResult.user.firstName}", response:responseStr, grade:grade }); + + // set maxGrade attribute to cell DOM element + table.setCell(${i.index + 1}, "grade", "", null, {"maxGrade" : ${questionResult.maxMark}}); Index: lams_tool_assessment/web/pages/monitoring/parts/usersummary.jsp =================================================================== diff -u -r1e33f64c06430834c80a2b01d42bcdf844c5d958 -r0db48a90dde9c1543cf5d752955592ffb6dca5ee --- lams_tool_assessment/web/pages/monitoring/parts/usersummary.jsp (.../usersummary.jsp) (revision 1e33f64c06430834c80a2b01d42bcdf844c5d958) +++ lams_tool_assessment/web/pages/monitoring/parts/usersummary.jsp (.../usersummary.jsp) (revision 0db48a90dde9c1543cf5d752955592ffb6dca5ee) @@ -57,7 +57,18 @@ cellEdit: true, beforeEditCell: function (rowid,name,val,iRow,iCol){ previousCellValue = val; - }, + }, + beforeSaveCell : function(rowid, name, val, iRow, iCol) { + if (isNaN(val)) { + return null; + } + + var maxGrade = jQuery("table#user${question.uid} tr#" + iRow + + " td[aria-describedby$='_" + name + "']").attr("maxGrade"); + if (val > maxGrade) { + return maxGrade; + } + }, afterSaveCell : function (rowid,name,val,iRow,iCol){ //var questionResultUid = jQuery("#user${question.uid}").getCell(rowid, 'questionResultUid'); if (isNaN(val)) { //|| (questionResultUid=="")) { @@ -91,13 +102,17 @@ var responseStr = ""; <%@ include file="userresponse.jsp"%> - jQuery("#user${question.uid}").addRowData(${i.index + 1}, { + var table = jQuery("#user${question.uid}"); + table.addRowData(${i.index + 1}, { id:"${i.index + 1}", questionResultUid:"${questionResult.uid}", time:"${questionResult.finishDate}", response:responseStr, grade:"" }); + + // set maxGrade attribute to cell DOM element + table.setCell(${i.index + 1}, "grade", "", null, {"maxGrade" : ${questionResult.maxMark}}); Index: lams_tool_assessment/web/pages/monitoring/summary.jsp =================================================================== diff -u -rb222d3b5e15dfb4da05a89778bfc0982f3fbd53c -r0db48a90dde9c1543cf5d752955592ffb6dca5ee --- lams_tool_assessment/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision b222d3b5e15dfb4da05a89778bfc0982f3fbd53c) +++ lams_tool_assessment/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision 0db48a90dde9c1543cf5d752955592ffb6dca5ee) @@ -94,7 +94,19 @@ cellEdit: true, afterEditCell: function (rowid,name,val,iRow,iCol){ oldValue = eval(val); - }, + }, + beforeSaveCell : function(rowid, name, val, iRow, iCol) { + if (isNaN(val)) { + return null; + } + + // get maxGrade attribute which was set in masterDetailLoadUp.jsp + var maxGrade = jQuery("table#userSummary${summary.sessionId} tr#" + iRow + + " td[aria-describedby$='_" + name + "']").attr("maxGrade"); + if (val > maxGrade) { + return maxGrade; + } + }, afterSaveCell : function (rowid,name,val,iRow,iCol){ if (isNaN(val)) { jQuery("#userSummary${summary.sessionId}").restoreCell(iRow,iCol); Index: lams_tool_lamc/web/monitoring/SummaryContent.jsp =================================================================== diff -u -r732f77a31113c5838d0704829b99418d90053471 -r0db48a90dde9c1543cf5d752955592ffb6dca5ee --- lams_tool_lamc/web/monitoring/SummaryContent.jsp (.../SummaryContent.jsp) (revision 732f77a31113c5838d0704829b99418d90053471) +++ lams_tool_lamc/web/monitoring/SummaryContent.jsp (.../SummaryContent.jsp) (revision 0db48a90dde9c1543cf5d752955592ffb6dca5ee) @@ -113,12 +113,25 @@ afterEditCell: function (rowid,name,val,iRow,iCol){ oldValue = eval(val); }, + beforeSaveCell : function(rowid, name, val, iRow, iCol) { + var intRegex = /^\d+$/; + if (!intRegex.test(val)) { + return null; + } + + // get maxGrade attribute which was set in masterDetailLoadUp.jsp + var maxGrade = jQuery("table#userSummary${sessionMarkDto.sessionId} tr#" + iRow + + " td[aria-describedby$='_" + name + "']").attr("maxGrade"); + if (val > maxGrade) { + return maxGrade; + } + }, afterSaveCell : function (rowid,name,val,iRow,iCol){ var intRegex = /^\d+$/; if (!intRegex.test(val)) { jQuery("#userSummary${sessionMarkDto.sessionId}").restoreCell(iRow,iCol); } else { - var parentSelectedRowId = jQuery("#group${sessionMarkDto.sessionId}").getGridParam("selrow"); + var parentSelectedRowId = jQuery("#group${sessionMarkDto.sessionId}").getGridParam("selrow"); var previousTotal = eval(jQuery("#group${sessionMarkDto.sessionId}").getCell(parentSelectedRowId, 'total')); jQuery("#group${sessionMarkDto.sessionId}").setCell(parentSelectedRowId, 'total', previousTotal - oldValue + eval(val), {}, {}); } Index: lams_tool_lamc/web/monitoring/masterDetailLoadUp.jsp =================================================================== diff -u -r3f7d82f8f5d0c6881eb83f9ce8c36720e9756649 -r0db48a90dde9c1543cf5d752955592ffb6dca5ee --- lams_tool_lamc/web/monitoring/masterDetailLoadUp.jsp (.../masterDetailLoadUp.jsp) (revision 3f7d82f8f5d0c6881eb83f9ce8c36720e9756649) +++ lams_tool_lamc/web/monitoring/masterDetailLoadUp.jsp (.../masterDetailLoadUp.jsp) (revision 0db48a90dde9c1543cf5d752955592ffb6dca5ee) @@ -5,15 +5,18 @@ jQuery("#userSummary${toolSessionID}").clearGridData().setGridParam({scrollOffset: 18}); - - jQuery("#userSummary${toolSessionID}").addRowData(${i.index + 1}, { + var table = jQuery("#userSummary${toolSessionID}"); + + table.addRowData(${i.index + 1}, { id: "${i.index + 1}", userAttemptUid: "${userAttempt.uid}", title: "${userAttempt.mcQueContent.escapedQuestion}", response: "${userAttempt.mcOptionsContent.escapedOptionText}", grade: "" }); + // set maxGrade attribute to cell DOM element + table.setCell(${i.index + 1}, "grade", "", null, {"maxGrade" : ${userAttempt.mcQueContent.mark}}); };