Widget:WJG Sandbox Merge: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 1,159: Line 1,159:
             ]
             ]
             }
             }


var newopts = {
var newopts = {
Line 1,196: Line 1,195:
$(".navPaneButton").click(window.exam, questionReviewNavigation);
$(".navPaneButton").click(window.exam, questionReviewNavigation);
}
}
function submitRating(ratingType, score, page) {
      if(ratingType === "difficulty"){
var api = new mw.Api();
api.get({
action : 'wbrinsertrating',
username : mw.user.getName(),
question : page,
difficulty : score,
format : 'json'
}, {
ok : function (res) {}
});
} else if (ratingType === "yield"){
var api = new mw.Api();
api.get({
action : 'wbrinsertrating',
username : mw.user.getName(),
question : page,
yield : score,
format : 'json'
}, {
ok : function (res) {}
});
}
else if (ratingType === "quality"){
var api = new mw.Api();
api.get({
action : 'wbrinsertrating',
username : mw.user.getName(),
question : page,
quality : score,
format : 'json'
}, {
ok : function (res) {}
});
}
}


function submitRating(ratingType, score, page) {
function submitRating(ratingType, score, page) {

Revision as of 02:03, 11 August 2014