Widget:WJG Sandbox: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 1,018: Line 1,018:
datas += "<br />You answered " + event.data.answeredRight + " out of " + event.data.examQuestions.length + " correctly.<br /> Your percentage score is: ";
datas += "<br />You answered " + event.data.answeredRight + " out of " + event.data.examQuestions.length + " correctly.<br /> Your percentage score is: ";
var percent = (event.data.answeredRight / event.data.examQuestions.length) * 100;
var percent = (event.data.answeredRight / event.data.examQuestions.length) * 100;
testlength=event.data.examQuestions.length;
testlength=event.data.examQuestions.length;
var question_probs=[];
var question_probs=[];
for (var j = 0; j < testlength; j+=1){
for (var j = 0; j < testlength; j+=1){
     question_probs[j]=Math.random();
     question_probs[j]=Math.random();
}
}
qdist=convolve_bernouli(question_probs);
qdist=convolve_bernouli(question_probs);




datas += percent + "%<br /><br />Click the Navigation Buttons on the left to review the questions you answered.";
datas += percent + "%<br /><br />Click the Navigation Buttons on the left to review the questions you answered.";


datas+="<canvas id="buyers" width="600" height="400"></canvas>";
datas += "<canvas id='buyers' width='600' height='400'></canvas>";
var api = new mw.Api();
var api = new mw.Api();



Revision as of 22:48, 22 May 2014