Index: lams_tool_laqa/web/learning/LearnerRep.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/web/learning/LearnerRep.jsp,v
diff -u -r1.56 -r1.57
--- lams_tool_laqa/web/learning/LearnerRep.jsp 29 Aug 2014 23:50:12 -0000 1.56
+++ lams_tool_laqa/web/learning/LearnerRep.jsp 1 Sep 2014 22:44:50 -0000 1.57
@@ -61,18 +61,7 @@
// {sortList:col} adds the sortList to the url into a "col" array, and {filterList:fcol} adds
// the filterList to the url into an "fcol" array.
// So a sortList = [[2,0],[3,0]] becomes "&col[2]=0&col[3]=0" in the url
- // 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 = [],
@@ -155,19 +144,27 @@
// 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');
+ }
+ })
+ })
+
});
});