Widget:Sandbox: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
Line 617: | Line 617: | ||
click : function (score, event) { | click : function (score, event) { | ||
submitRating("yield", score, exam.examQuestions[exam.currentQuestion].PageName) | submitRating("yield", score, exam.examQuestions[exam.currentQuestion].PageName) | ||
}, | }, | ||
score : function(){ | |||
var api = new mw.Api(); | |||
api.get({ | |||
action : 'wbrgetrating', | |||
question : exam.examQuestions[exam.currentQuestion].PageName, | |||
format : 'json' | |||
}, { | |||
ok : function (res) { | |||
return res.wbrgetrating.difficulty; | |||
} | |||
}); | |||
}, | }, | ||
hints : ['Very Poor', 'Poor', 'Average', 'Good', 'Very Good'] | hints : ['Very Poor', 'Poor', 'Average', 'Good', 'Very Good'] | ||
Line 627: | Line 636: | ||
click : function (score, event) { | click : function (score, event) { | ||
submitRating("quality", score, exam.examQuestions[exam.currentQuestion].PageName) | submitRating("quality", score, exam.examQuestions[exam.currentQuestion].PageName) | ||
}, | }, score : function(){ | ||
var api = new mw.Api(); | |||
api.get({ | |||
action : 'wbrgetrating', | |||
question : exam.examQuestions[exam.currentQuestion].PageName, | |||
format : 'json' | |||
}, { | |||
ok : function (res) { | |||
return res.wbrgetrating.difficulty; | |||
} | |||
}); | |||
}, | }, | ||
hints : ['Very Poor', 'Poor', 'Average', 'Good', 'Very Good'] | hints : ['Very Poor', 'Poor', 'Average', 'Good', 'Very Good'] |