Widget:WJG Sandbox Merge: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1,138: Line 1,138:
$(".navPaneButton").unbind('click');
$(".navPaneButton").unbind('click');
$(".navPaneButton").click(window.exam, questionReviewNavigation);
$(".navPaneButton").click(window.exam, questionReviewNavigation);
}
point_labels=[];
 
for (var j = 0; j < qdist.length; j+=1){
point_labels=[];
    point_labels[j]=j.toString();
for (var j = 0; j < qdist.length; j+=1){
    point_labels[j]=j.toString();
}
 
 
var simExamData = {
                labels : point_labels,
                datasets : [
{
fillColor : "rgba(220,220,220,0.5)",
strokeColor : "rgba(220,220,220,1)",
pointColor : "rgba(220,220,220,1)",
pointStrokeColor : "#fff",
data : qdist,
title: "Percent of test takers"
}
}
            ]
            }




var newopts = {
var simExamData = {
yAxisLabel : "Percent of test takers",
                labels : point_labels,
yAxisFontFamily : "'Arial'",
                datasets : [
yAxisFontSize : 16,
{
yAxisFontStyle : "normal",
fillColor : "rgba(220,220,220,0.5)",
yAxisFontColor : "#666",
strokeColor : "rgba(220,220,220,1)",
xAxisLabel : "Number of correct answers",
pointColor : "rgba(220,220,220,1)",
pointStrokeColor : "#fff",
data : qdist,
title: "Percent of test takers"
}
            ]
            }


legend : false,
var newopts = {
legendFontFamily : "'Arial'",
yAxisLabel : "Percent of test takers",
legendFontSize : 12,
yAxisFontFamily : "'Arial'",
legendFontStyle : "normal",
yAxisFontSize : 16,
legendFontColor : "#666",
yAxisFontStyle : "normal",
legendBlockSize : 15,
yAxisFontColor : "#666",
legendBorders : false,
xAxisLabel : "Number of correct answers",
legendBordersColor : "#666",


 
legend : false,
graphTitle : "Peer Performance",
legendFontFamily : "'Arial'",
graphTitleFontFamily : "'Arial'",
legendFontSize : 12,
graphTitleFontSize : 24,
legendFontStyle : "normal",
graphTitleFontStyle : "bold",
legendFontColor : "#666",
graphTitleFontColor : "#666",
legendBlockSize : 15,
}
legendBorders : false,
 
legendBordersColor : "#666",
            // get line chart canvas
            var simExams = document.getElementById('simExams').getContext('2d');
            // draw line chart
            new Chart(simExams).Line(simExamData,newopts);




graphTitle : "Peer Performance",
graphTitleFontFamily : "'Arial'",
graphTitleFontSize : 24,
graphTitleFontStyle : "bold",
graphTitleFontColor : "#666",
}


$(".navPaneButton").unbind('click');
            // get line chart canvas
$(".navPaneButton").click(window.exam, questionReviewNavigation);
            var simExams = document.getElementById('simExams').getContext('2d');
}
            // draw line chart
function submitRating(ratingType, score, page) {
            new Chart(simExams).Line(simExamData,newopts);
      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) {}
});
}
}
}



Latest revision as of 02:08, 11 August 2014