Index: lams_tool_laqa/web/learning/mobile/RevisitedLearnerRep.jsp =================================================================== diff -u -raa23416ad623b838b1bc6b1a425ff3da67550240 -r7d0d609b844ea5e9c41f46d209825ce5bd4fb83a --- lams_tool_laqa/web/learning/mobile/RevisitedLearnerRep.jsp (.../RevisitedLearnerRep.jsp) (revision aa23416ad623b838b1bc6b1a425ff3da67550240) +++ lams_tool_laqa/web/learning/mobile/RevisitedLearnerRep.jsp (.../RevisitedLearnerRep.jsp) (revision 7d0d609b844ea5e9c41f46d209825ce5bd4fb83a) @@ -67,15 +67,6 @@ // and a filterList = [[2,Blue],[3,13]] becomes "&fcol[2]=Blue&fcol[3]=13" in the url ajaxUrl : "?method=getResponses&page={page}&size={size}&{sortList:column}&qaSessionId=" + $("#toolSessionID").val() + "&questionUid=" + $(this).attr('data-question-uid') + "&userId=" + $("#userID").val(), - // modify the url after all processing has been applied - // customAjaxUrl: function(table, url) { - // manipulate the url string as you desire - // url += '&cPage=' + window.location.pathname; - // trigger my custom event - //$(table).trigger('changingUrl', url); - // send the server the current page - // return url; - // }, ajaxProcessing: function (data) { if (data && data.hasOwnProperty('rows')) { var rows = [], @@ -158,18 +149,25 @@ // bind to pager events .bind('pagerInitialized pagerComplete', function(event, options){ - $(".rating-stars").jRating({ - phpPath : "?method=rateResponse&toolSessionID=" + $("#toolSessionID").val(), - rateMax : 5, - decimalLength : 1, - onSuccess : function(data, responseUid){ - $("#averageRating" + responseUid).html(data.averageRating); - $("#numberOfVotes" + responseUid).html(data.numberOfVotes); - $("#averageRating" + responseUid).parents(".tablesorter").trigger("update"); - }, - onError : function(){ - jError('Error : please retry'); - } + $(".rating-stars").each(function() { + //make sure jRating gets applied only once + if ($(this)[0].innerHTML.indexOf("jRatingColor") > -1) { + return; + } + + $(this).jRating({ + phpPath : "?method=rateResponse&toolSessionID=" + $("#toolSessionID").val(), + rateMax : 5, + decimalLength : 1, + onSuccess : function(data, responseUid){ + $("#averageRating" + responseUid).html(data.averageRating); + $("#numberOfVotes" + responseUid).html(data.numberOfVotes); + $("#averageRating" + responseUid).parents(".tablesorter").trigger("update"); + }, + onError : function(){ + jError('Error : please retry'); + } + }) }); }); });