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 593: Line 593:
var ratyLayers = "<center>Rate this question!</center><br /><span style='position:relative; float:left;'>Difficulty: <div id='star1'></div></span><span style='position:relative; float:left;left:33%;'>High Yield: <div id='star2'></div></span><span style='position:relative; float:left;left:66%'>Quality: <div id='star3'></div></span><br /><br /><br />"
var ratyLayers = "<center>Rate this question!</center><br /><span style='position:relative; float:left;'>Difficulty: <div id='star1'></div></span><span style='position:relative; float:left;left:33%;'>High Yield: <div id='star2'></div></span><span style='position:relative; float:left;left:66%'>Quality: <div id='star3'></div></span><br /><br /><br />"
$("#examSpace").prepend(ratyLayers);
$("#examSpace").prepend(ratyLayers);
        exam.examQuestions[exam.currentQuestion].ratings = getRating("difficulty", exam.examQuestions[exam.currentQuestion].PageName);
$("#star1").raty({
$("#star1").raty({
path : 'http://www.wikidoc.org/includes/raty/img/',
path : 'http://www.wikidoc.org/includes/raty/img/',
Line 599: Line 598:
submitRating("difficulty", score, exam.examQuestions[exam.currentQuestion].PageName)
submitRating("difficulty", score, exam.examQuestions[exam.currentQuestion].PageName)
},
},
score : exam.examQuestions[exam.currentQuestion].ratings.d,
score : getRating("difficulty", exam.examQuestions[exam.currentQuestion].PageName).d,
hints : ['Very Poor', 'Poor', 'Average', 'Good', 'Very Good']
hints : ['Very Poor', 'Poor', 'Average', 'Good', 'Very Good']
});
});
Line 607: Line 606:
submitRating("yield", score, exam.examQuestions[exam.currentQuestion].PageName)
submitRating("yield", score, exam.examQuestions[exam.currentQuestion].PageName)
},
},
score : exam.examQuestions[exam.currentQuestion].ratings.y,
score : getRating("difficulty", exam.examQuestions[exam.currentQuestion].PageName).y,
hints : ['Very Poor', 'Poor', 'Average', 'Good', 'Very Good']
hints : ['Very Poor', 'Poor', 'Average', 'Good', 'Very Good']
});
});
Line 615: Line 614:
submitRating("quality", score, exam.examQuestions[exam.currentQuestion].PageName)
submitRating("quality", score, exam.examQuestions[exam.currentQuestion].PageName)
},
},
score : exam.examQuestions[exam.currentQuestion].ratings.q,
score : getRating("difficulty", exam.examQuestions[exam.currentQuestion].PageName).q,
hints : ['Very Poor', 'Poor', 'Average', 'Good', 'Very Good']
hints : ['Very Poor', 'Poor', 'Average', 'Good', 'Very Good']
});
});
Line 763: Line 762:
}, {
}, {
ok : function (res) {
ok : function (res) {
                      console.log({d:res.wbrgetrating.difficulty, q:res.wbrgetrating.quality, y:res.wbrgetrating.yield});
                       return {d:res.wbrgetrating.difficulty, q:res.wbrgetrating.quality, y:res.wbrgetrating.yield}
                       return {d:res.wbrgetrating.difficulty, q:res.wbrgetrating.quality, y:res.wbrgetrating.yield}
}
}

Revision as of 21:43, 20 February 2014