From: jamiesensei Date: Wed, 29 Oct 2008 10:09:55 +0000 (+0000) Subject: MDL-14209 "quiz stats report:Seperation of functionality and unit tests for calculati... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2685ec17ea39d79e02b891590b3e5494e0ed8d40;p=moodle.git MDL-14209 "quiz stats report:Seperation of functionality and unit tests for calculations" Unit tests for the grade stats calculations. --- diff --git a/mod/quiz/report/statistics/simpletest/mdl_question.csv b/mod/quiz/report/statistics/simpletest/mdl_question.csv new file mode 100644 index 0000000000..1190b7cbe9 --- /dev/null +++ b/mod/quiz/report/statistics/simpletest/mdl_question.csv @@ -0,0 +1,21 @@ +"id","number","category","parent","name","questiontext","questiontextformat","image","generalfeedback","defaultgrade","penalty","qtype","length","stamp","version","hidden","timecreated","timemodified","createdby","modifiedby","maxgrade" +"1","1","5","0","questionessay-11","What is the purpose of life?","0",,"General feedback","1.0000000","0.0000000","essay","1","localhost+080922073527+WeUaUK","localhost+080922073527+qxLjv1","0","1222068927","0","2",NULL,"1.0000000" +"2","2","5","0","questionessay-17","What is the purpose of life?","0",,"General feedback","1.0000000","0.0000000","essay","1","localhost+080922073527+pvCseX","localhost+080922073527+mzy6tY","0","1222068927","0","2",NULL,"1.0000000" +"3","3","5","0","questionessay-6","What is the purpose of life?","0",,"General feedback","1.0000000","0.0000000","essay","1","localhost+080922073527+Cr3gDO","localhost+080922073527+hnxfTy","0","1222068927","0","2",NULL,"1.0000000" +"4","4","5","0","questionessay-8","What is the purpose of life?","0",,"General feedback","1.0000000","0.0000000","essay","1","localhost+080922073527+sSq9ln","localhost+080922073527+PGyab3","0","1222068927","0","2",NULL,"1.0000000" +"5","5","5","0","questionmatch-10","test question, generated by script","0",,"Well done","1.0000000","0.1000000","match","1","localhost+080922073527+oG1i2f","localhost+080922073527+S1UxZy","0","1222068927","0","2",NULL,"0.0000000" +"6","6","5","0","questionmatch-16","test question, generated by script","0",,"Well done","1.0000000","0.1000000","match","1","localhost+080922073527+vMFHyY","localhost+080922073527+4GZIyQ","0","1222068927","0","2",NULL,"0.0000000" +"7","7","5","0","questionmatch-18","test question, generated by script","0",,"Well done","1.0000000","0.1000000","match","1","localhost+080922073527+Xkxqn1","localhost+080922073527+xbU6U7","0","1222068927","0","2",NULL,"0.0000000" +"8","8","5","0","questionmultianswer-12","This question consists of some text with an answer embedded right here {#1} and right after that you will have to deal with this short answer {#2} and finally we have a floating point number {#3}. Note that addresses like www.moodle.org and smileys :-) all work as normal: a) How good is this? {#4} b) What grade would you give it? {#5} Good luck!","0",,"General feedback","8.0000000","0.1000000","multianswer","1","localhost+080922073527+0zKgpF","localhost+080922073527+r1gsde","0","1222068927","0","2",NULL,"8.0000000" +"14","9","5","0","questionmultichoice-13","How old is the sun?","0",,"General feedback","1.0000000","0.1000000","multichoice","1","localhost+080922073527+AjIjeV","localhost+080922073527+UhtTLR","0","1222068927","0","2",NULL,"1.0000000" +"15","10","5","0","questionmultichoice-14","How old is the sun?","0",,"General feedback","1.0000000","0.1000000","multichoice","1","localhost+080922073527+IrAqRl","localhost+080922073527+xRfta8","0","1222068927","0","2",NULL,"1.0000000" +"16","11","5","0","questionmultichoice-3","How old is the sun?","0",,"General feedback","1.0000000","0.1000000","multichoice","1","localhost+080922073527+DMGirU","localhost+080922073527+689V8k","0","1222068927","0","2",NULL,"1.0000000" +"17","12","5","0","questionmultichoice-5","How old is the sun?","0",,"General feedback","1.0000000","0.1000000","multichoice","1","localhost+080922073527+wileZw","localhost+080922073527+zGcaDa","0","1222068927","0","2",NULL,"1.0000000" +"25","13","5","0","Random Short-Answer Matching","

For each of the following questions, select the matching answer from the menu.

","1",,,"1.0000000","0.1000000","randomsamatch","1","localhost+080922073724+qF803I","localhost+080922075820+zbZtaD","0","1222069044","1222070300","2","2","1.0000000" +"22","14","5","0","Is Thai difficult?","Is Thai difficult?","0",,,"1.0000000","0.1000000","shortanswer","1","localhost+080922073655+2FLtCU","localhost+080922073655+fgUeOj","0","1222069015","0","2",NULL,"1.0000000" +"23","15","5","0","Is Thai grammar difficult?","Is Thai grammar difficult?","0",,,"1.0000000","0.1000000","shortanswer","1","localhost+080922073655+LYSD32","localhost+080922073655+WgRYk4","0","1222069015","0","2",NULL,"1.0000000" +"24","16","5","0","Is Thai pronunciation difficult?","Is Thai pronunciation difficult?","0",,,"1.0000000","0.1000000","shortanswer","1","localhost+080922073655+5p1w22","localhost+080922073655+g5jrXa","0","1222069015","0","2",NULL,"1.0000000" +"20","17","5","0","Who's buried in Grant's tomb?","Who's buried in Grant's tomb?","0",,,"1.0000000","0.1000000","shortanswer","1","localhost+080922073655+PTDcDZ","localhost+080922073655+aghyfu","0","1222069015","0","2",NULL,"1.0000000" +"21","18","5","0","Who's buried in Jamie's tomb?","Who's buried in Jamie's tomb?","0",,,"1.0000000","0.1000000","shortanswer","1","localhost+080922073655+Xvy1ns","localhost+080922073655+Mx0Izs","0","1222069015","0","2",NULL,"1.0000000" +"18","19","5","0","questiontruefalse-7","This question is really stupid","0",,"Well done","1.0000000","1.0000000","truefalse","1","localhost+080922073527+9bzTef","localhost+080922073527+hjcQR1","0","1222068927","0","2",NULL,"1.0000000" +"19","20","5","0","questiontruefalse-9","This question is really stupid","0",,"Well done","1.0000000","1.0000000","truefalse","1","localhost+080922073527+TI0yD4","localhost+080922073527+iXIulQ","0","1222068927","0","2",NULL,"1.0000000" diff --git a/mod/quiz/report/statistics/simpletest/mdl_question_states.csv b/mod/quiz/report/statistics/simpletest/mdl_question_states.csv new file mode 100644 index 0000000000..fb70f51a42 --- /dev/null +++ b/mod/quiz/report/statistics/simpletest/mdl_question_states.csv @@ -0,0 +1,441 @@ +"id","question","sumgrades","grade","answer" +"39872","1","12.00000","0.0000000", +"39873","2","12.00000","0.0000000", +"39874","3","12.00000","0.0000000", +"39875","4","12.00000","0.0000000", +"39896","5","12.00000","0.0000000","2-511566162,1-386383057,3-789367675" +"39897","6","12.00000","0.0000000","6-90576172,4-874542236,5-561218262" +"39898","7","12.00000","0.0000000","8-572387695,9-204498291,7-955780029" +"39899","8","12.00000","5.5000000","1-8,2-Wrong answer,3-24.3598688451,4-14,5-4.61546768417" +"39900","14","12.00000","0.3000000","17,19,18:17" +"39901","15","12.00000","0.9000000","21,20,22:21" +"39902","16","12.00000","1.0000000","24,23,25:25" +"39903","17","12.00000","0.3000000","28,27,26:26" +"39910","18","12.00000","0.0000000","29" +"39911","19","12.00000","1.0000000","32" +"39908","20","12.00000","1.0000000","nobody" +"39909","21","12.00000","0.0000000","The wrong answer" +"39905","22","12.00000","0.0000000","The wrong answer" +"39906","23","12.00000","0.0000000","The wrong answer" +"39907","24","12.00000","1.0000000","no" +"39904","25","12.00000","1.0000000","27-43,28-44" +"39992","1","7.40000","0.0000000", +"39993","2","7.40000","0.0000000", +"39994","3","7.40000","0.0000000", +"39995","4","7.40000","0.0000000", +"40016","5","7.40000","0.0000000","2-386383057,3-789367675,1-511566162" +"40017","6","7.40000","0.0000000","4-561218262,5-90576172,6-874542236" +"40018","7","7.40000","0.0000000","8-955780029,7-572387695,9-204498291" +"40019","8","7.40000","1.0000000","1-5,2-The wrong answer,3--31759.1567413,4-14,5-1461.25288609" +"40020","14","7.40000","0.9000000","17,19,18:18" +"40021","15","7.40000","0.9000000","22,20,21:21" +"40022","16","7.40000","0.3000000","24,25,23:23" +"40023","17","7.40000","0.3000000","28,27,26:26" +"40030","18","7.40000","0.0000000","29" +"40031","19","7.40000","1.0000000","32" +"40028","20","7.40000","0.0000000","h560ljJn" +"40029","21","7.40000","1.0000000","someone" +"40025","22","7.40000","0.0000000","The wrong answer" +"40026","23","7.40000","0.0000000","wQ3VDRbwS" +"40027","24","7.40000","1.0000000","no" +"40024","25","7.40000","1.0000000","28-44,26-41" +"40032","1","11.70000","0.0000000", +"40033","2","11.70000","0.0000000", +"40034","3","11.70000","0.0000000", +"40035","4","11.70000","0.0000000", +"40056","5","11.70000","0.0000000","1-511566162,2-789367675,3-386383057" +"40057","6","11.70000","0.0000000","4-90576172,6-561218262,5-874542236" +"40058","7","11.70000","0.0000000","9-955780029,8-204498291,7-572387695" +"40059","8","11.70000","2.5000000","1-7,2-Answer that gives half the credit,3--11453.355254,4-14,5-20166.4042138" +"40060","14","11.70000","1.0000000","19,18,17:19" +"40061","15","11.70000","0.9000000","20,22,21:21" +"40062","16","11.70000","0.3000000","24,23,25:23" +"40063","17","11.70000","1.0000000","27,28,26:28" +"40070","18","11.70000","1.0000000","30" +"40071","19","11.70000","1.0000000","32" +"40068","20","11.70000","1.0000000","nobody" +"40069","21","11.70000","1.0000000","somebody" +"40065","22","11.70000","0.0000000","The wrong answer" +"40066","23","11.70000","1.0000000","no" +"40067","24","11.70000","1.0000000","no" +"40064","25","11.70000","0.0000000","26-44,28-41" +"39352","1","8.50000","0.0000000", +"39353","2","8.50000","0.0000000", +"39354","3","8.50000","0.0000000", +"39355","4","8.50000","0.0000000", +"39376","5","8.50000","0.0000000","1-789367675,2-511566162,3-386383057" +"39377","6","8.50000","0.0000000","4-90576172,6-561218262,5-874542236" +"39378","7","8.50000","0.0000000","7-955780029,9-204498291,8-572387695" +"39379","8","8.50000","4.0000000","1-7,2-Correct answer,3-23.8650406295,4-15,5-13489.4978428" +"39380","14","8.50000","0.3000000","19,18,17:17" +"39381","15","8.50000","0.9000000","21,20,22:21" +"39382","16","8.50000","1.0000000","24,23,25:25" +"39383","17","8.50000","0.3000000","27,26,28:26" +"39390","18","8.50000","0.0000000","29" +"39391","19","8.50000","1.0000000","32" +"39388","20","8.50000","1.0000000","nobody" +"39389","21","8.50000","0.0000000","gZnFVM4nLKJ" +"39385","22","8.50000","0.0000000","The wrong answer" +"39386","23","8.50000","0.0000000","The wrong answer" +"39387","24","8.50000","0.0000000","608GwpY" +"39384","25","8.50000","0.0000000","27-41,26-43" +"37112","1","10.10000","0.0000000", +"37113","2","10.10000","0.0000000", +"37114","3","10.10000","0.0000000", +"37115","4","10.10000","0.0000000", +"37136","5","10.10000","0.0000000","3-386383057,2-511566162,1-789367675" +"37137","6","10.10000","0.0000000","5-561218262,4-90576172,6-874542236" +"37138","7","10.10000","0.0000000","8-572387695,9-955780029,7-204498291" +"37139","8","10.10000","3.0000000","1-6,2-The wrong answer,3-4194.34011879,4-15,5-1.51613103701" +"37140","14","10.10000","0.9000000","18,19,17:18" +"37141","15","10.10000","0.3000000","20,21,22:20" +"37142","16","10.10000","0.9000000","24,23,25:24" +"37143","17","10.10000","1.0000000","26,28,27:28" +"37150","18","10.10000","1.0000000","30" +"37151","19","10.10000","0.0000000","31" +"37148","20","10.10000","1.0000000","nobody" +"37149","21","10.10000","1.0000000","something" +"37145","22","10.10000","1.0000000","yes" +"37146","23","10.10000","0.0000000","tp5yPtP" +"37147","24","10.10000","0.0000000","WpWsp" +"37144","25","10.10000","0.0000000","28-41,26-44" +"37432","1","11.30000","0.0000000", +"37433","2","11.30000","0.0000000", +"37434","3","11.30000","0.0000000", +"37435","4","11.30000","0.0000000", +"37456","5","11.30000","0.0000000","3-789367675,2-511566162,1-386383057" +"37457","6","11.30000","0.0000000","4-561218262,5-874542236,6-90576172" +"37458","7","11.30000","0.0000000","8-955780029,7-572387695,9-204498291" +"37459","8","11.30000","4.5000000","1-8,2-Correct answer,3-23.8492275909,4-14,5--5146.21930938" +"37460","14","11.30000","0.9000000","18,17,19:18" +"37461","15","11.30000","1.0000000","20,22,21:22" +"37462","16","11.30000","1.0000000","24,23,25:25" +"37463","17","11.30000","0.9000000","26,28,27:27" +"37470","18","11.30000","0.0000000","29" +"37471","19","11.30000","0.0000000","31" +"37468","20","11.30000","0.0000000","vWvkQNHX" +"37469","21","11.30000","0.0000000","Llog6lWz" +"37465","22","11.30000","1.0000000","yes" +"37466","23","11.30000","1.0000000","no" +"37467","24","11.30000","1.0000000","no" +"37464","25","11.30000","0.0000000","28-43,27-44" +"37472","1","11.20000","0.0000000", +"37473","2","11.20000","0.0000000", +"37474","3","11.20000","0.0000000", +"37475","4","11.20000","0.0000000", +"37496","5","11.20000","0.0000000","1-386383057,2-789367675,3-511566162" +"37497","6","11.20000","0.0000000","4-90576172,6-561218262,5-874542236" +"37498","7","11.20000","0.0000000","9-955780029,7-572387695,8-204498291" +"37499","8","11.20000","3.0000000","1-5,2-The wrong answer,3-23.7261783051,4-14,5--32402.6363731" +"37500","14","11.20000","0.3000000","19,18,17:17" +"37501","15","11.20000","0.3000000","20,21,22:20" +"37502","16","11.20000","0.3000000","25,24,23:23" +"37503","17","11.20000","0.3000000","27,28,26:26" +"37510","18","11.20000","1.0000000","30" +"37511","19","11.20000","1.0000000","32" +"37508","20","11.20000","1.0000000","no one" +"37509","21","11.20000","1.0000000","someone" +"37505","22","11.20000","0.0000000","HMwPMhROBnOQRn" +"37506","23","11.20000","1.0000000","no" +"37507","24","11.20000","1.0000000","no" +"37504","25","11.20000","1.0000000","28-44,26-41" +"37632","1","14.10000","0.0000000", +"37633","2","14.10000","0.0000000", +"37634","3","14.10000","0.0000000", +"37635","4","14.10000","0.0000000", +"37656","5","14.10000","0.0000000","3-789367675,1-386383057,2-511566162" +"37657","6","14.10000","0.0000000","5-874542236,6-561218262,4-90576172" +"37658","7","14.10000","0.0000000","7-955780029,8-204498291,9-572387695" +"37659","8","14.10000","6.0000000","1-6,2-The wrong answer,3-23.7360174732,4-14,5-3.22848046312" +"37660","14","14.10000","0.9000000","19,18,17:18" +"37661","15","14.10000","0.9000000","21,22,20:21" +"37662","16","14.10000","1.0000000","23,24,25:25" +"37663","17","14.10000","0.3000000","26,28,27:26" +"37670","18","14.10000","0.0000000","29" +"37671","19","14.10000","1.0000000","32" +"37668","20","14.10000","1.0000000","no one" +"37669","21","14.10000","0.0000000","The wrong answer" +"37665","22","14.10000","1.0000000","yes" +"37666","23","14.10000","1.0000000","no" +"37667","24","14.10000","1.0000000","no" +"37664","25","14.10000","0.0000000","27-44,28-43" +"37672","1","8.60000","0.0000000", +"37673","2","8.60000","0.0000000", +"37674","3","8.60000","0.0000000", +"37675","4","8.60000","0.0000000", +"37696","5","8.60000","0.0000000","1-511566162,3-386383057,2-789367675" +"37697","6","8.60000","0.0000000","6-90576172,4-561218262,5-874542236" +"37698","7","8.60000","0.0000000","8-204498291,7-572387695,9-955780029" +"37699","8","8.60000","0.5000000","1-8,2-The wrong answer,3--21833.4044871,4-15,5--18147.2836286" +"37700","14","8.60000","0.9000000","17,19,18:18" +"37701","15","8.60000","1.0000000","22,20,21:22" +"37702","16","8.60000","0.9000000","24,23,25:24" +"37703","17","8.60000","0.3000000","28,27,26:26" +"37710","18","8.60000","0.0000000","29" +"37711","19","8.60000","1.0000000","32" +"37708","20","8.60000","1.0000000","no one" +"37709","21","8.60000","1.0000000","someone" +"37705","22","8.60000","1.0000000","yes" +"37706","23","8.60000","1.0000000","no" +"37707","24","8.60000","0.0000000","The wrong answer" +"37704","25","8.60000","0.0000000","27-44,28-43" +"37712","1","11.60000","0.0000000", +"37713","2","11.60000","0.0000000", +"37714","3","11.60000","0.0000000", +"37715","4","11.60000","0.0000000", +"37736","5","11.60000","0.0000000","2-789367675,1-386383057,3-511566162" +"37737","6","11.60000","0.0000000","4-561218262,6-874542236,5-90576172" +"37738","7","11.60000","0.0000000","8-204498291,7-572387695,9-955780029" +"37739","8","11.60000","5.5000000","1-7,2-Answer that gives half the credit,3--134.762172058,4-14,5-1.48445038141" +"37740","14","11.60000","0.9000000","18,17,19:18" +"37741","15","11.60000","1.0000000","21,20,22:22" +"37742","16","11.60000","0.9000000","24,23,25:24" +"37743","17","11.60000","0.3000000","26,27,28:26" +"37750","18","11.60000","0.0000000","29" +"37751","19","11.60000","0.0000000","31" +"37748","20","11.60000","1.0000000","no one" +"37749","21","11.60000","0.0000000","qbCiWy62bNNg5cl" +"37745","22","11.60000","1.0000000","yes" +"37746","23","11.60000","0.0000000","rak1hirG0wyS" +"37747","24","11.60000","0.0000000","The wrong answer" +"37744","25","11.60000","1.0000000","26-41,27-43" +"38072","1","9.30000","0.0000000", +"38073","2","9.30000","0.0000000", +"38074","3","9.30000","0.0000000", +"38075","4","9.30000","0.0000000", +"38096","5","9.30000","0.0000000","1-789367675,2-386383057,3-511566162" +"38097","6","9.30000","0.0000000","4-90576172,6-561218262,5-874542236" +"38098","7","9.30000","0.0000000","9-204498291,7-572387695,8-955780029" +"38099","8","9.30000","2.5000000","1-8,2-The wrong answer,3-24.4542806399,4-14,5--16990.335599" +"38100","14","9.30000","0.9000000","18,17,19:18" +"38101","15","9.30000","1.0000000","21,20,22:22" +"38102","16","9.30000","1.0000000","25,24,23:25" +"38103","17","9.30000","0.9000000","26,27,28:27" +"38110","18","9.30000","0.0000000","29" +"38111","19","9.30000","1.0000000","32" +"38108","20","9.30000","1.0000000","no one" +"38109","21","9.30000","0.0000000","GuqxaqNR81kfEM" +"38105","22","9.30000","1.0000000","yes" +"38106","23","9.30000","0.0000000","oPeCap" +"38107","24","9.30000","0.0000000","The wrong answer" +"38104","25","9.30000","0.0000000","26-44,28-41" +"38232","1","13.10000","0.0000000", +"38233","2","13.10000","0.0000000", +"38234","3","13.10000","0.0000000", +"38235","4","13.10000","0.0000000", +"38256","5","13.10000","0.0000000","2-789367675,3-386383057,1-511566162" +"38257","6","13.10000","0.0000000","5-90576172,4-561218262,6-874542236" +"38258","7","13.10000","0.0000000","9-572387695,8-204498291,7-955780029" +"38259","8","13.10000","4.0000000","1-5,2-The wrong answer,3-5915.53602752,4-14,5-3.78315457278" +"38260","14","13.10000","0.9000000","19,17,18:18" +"38261","15","13.10000","0.3000000","21,20,22:20" +"38262","16","13.10000","0.9000000","25,24,23:24" +"38263","17","13.10000","1.0000000","26,27,28:28" +"38270","18","13.10000","0.0000000","29" +"38271","19","13.10000","1.0000000","32" +"38268","20","13.10000","1.0000000","nobody" +"38269","21","13.10000","1.0000000","somebody" +"38265","22","13.10000","1.0000000","yes" +"38266","23","13.10000","1.0000000","no" +"38267","24","13.10000","1.0000000","no" +"38264","25","13.10000","0.0000000","27-44,28-43" +"38272","1","11.50000","0.0000000", +"38273","2","11.50000","0.0000000", +"38274","3","11.50000","0.0000000", +"38275","4","11.50000","0.0000000", +"38296","5","11.50000","0.0000000","1-386383057,3-789367675,2-511566162" +"38297","6","11.50000","0.0000000","5-874542236,4-561218262,6-90576172" +"38298","7","11.50000","0.0000000","9-955780029,8-572387695,7-204498291" +"38299","8","11.50000","4.0000000","1-6,2-kX5Sr56nKLjAlg,3--18108.5919771,4-14,5-2.88040082253" +"38300","14","11.50000","0.9000000","18,17,19:18" +"38301","15","11.50000","0.3000000","20,22,21:20" +"38302","16","11.50000","0.3000000","24,25,23:23" +"38303","17","11.50000","1.0000000","27,28,26:28" +"38310","18","11.50000","1.0000000","30" +"38311","19","11.50000","0.0000000","31" +"38308","20","11.50000","0.0000000","The wrong answer" +"38309","21","11.50000","1.0000000","somebody" +"38305","22","11.50000","1.0000000","yes" +"38306","23","11.50000","1.0000000","no" +"38307","24","11.50000","0.0000000","wz0qF0phWo" +"38304","25","11.50000","1.0000000","27-43,26-41" +"38472","1","11.30000","0.0000000", +"38473","2","11.30000","0.0000000", +"38474","3","11.30000","0.0000000", +"38475","4","11.30000","0.0000000", +"38496","5","11.30000","0.0000000","1-386383057,2-789367675,3-511566162" +"38497","6","11.30000","0.0000000","5-874542236,6-561218262,4-90576172" +"38498","7","11.30000","0.0000000","8-572387695,9-204498291,7-955780029" +"38499","8","11.30000","3.0000000","1-5,2-nCTxs,3--5848.53314078,4-15,5-2.33952287138" +"38500","14","11.30000","1.0000000","19,18,17:19" +"38501","15","11.30000","1.0000000","20,22,21:22" +"38502","16","11.30000","0.3000000","25,23,24:23" +"38503","17","11.30000","1.0000000","26,28,27:28" +"38510","18","11.30000","1.0000000","30" +"38511","19","11.30000","0.0000000","31" +"38508","20","11.30000","1.0000000","nobody" +"38509","21","11.30000","1.0000000","something" +"38505","22","11.30000","1.0000000","yes" +"38506","23","11.30000","0.0000000","7IROPXMblfEC" +"38507","24","11.30000","1.0000000","no" +"38504","25","11.30000","0.0000000","26-44,28-41" +"38632","1","5.50000","0.0000000", +"38633","2","5.50000","0.0000000", +"38634","3","5.50000","0.0000000", +"38635","4","5.50000","0.0000000", +"38656","5","5.50000","0.0000000","3-511566162,1-789367675,2-386383057" +"38657","6","5.50000","0.0000000","4-90576172,6-874542236,5-561218262" +"38658","7","5.50000","0.0000000","9-204498291,8-572387695,7-955780029" +"38659","8","5.50000","1.0000000","1-8,2-Answer that gives half the credit,3--17006.6469703,4-15,5--6504.33320749" +"38660","14","5.50000","1.0000000","19,17,18:19" +"38661","15","5.50000","0.9000000","21,22,20:21" +"38662","16","5.50000","0.3000000","24,23,25:23" +"38663","17","5.50000","0.3000000","27,28,26:26" +"38670","18","5.50000","0.0000000","29" +"38671","19","5.50000","0.0000000","31" +"38668","20","5.50000","0.0000000","mcLXCaQ0nf" +"38669","21","5.50000","0.0000000","The wrong answer" +"38665","22","5.50000","0.0000000","bzl8AIwBOAGa" +"38666","23","5.50000","1.0000000","no" +"38667","24","5.50000","0.0000000","w9tmZeS" +"38664","25","5.50000","1.0000000","27-43,26-41" +"38672","1","4.80000","0.0000000", +"38673","2","4.80000","0.0000000", +"38674","3","4.80000","0.0000000", +"38675","4","4.80000","0.0000000", +"38696","5","4.80000","0.0000000","3-511566162,1-386383057,2-789367675" +"38697","6","4.80000","0.0000000","5-90576172,6-561218262,4-874542236" +"38698","7","4.80000","0.0000000","7-204498291,8-572387695,9-955780029" +"38699","8","4.80000","1.0000000","1-6,2-Wrong answer,3-17220.6744582,4-14,5--2846.0946129" +"38700","14","4.80000","0.3000000","17,19,18:17" +"38701","15","4.80000","0.3000000","22,21,20:20" +"38702","16","4.80000","0.3000000","24,23,25:23" +"38703","17","4.80000","0.9000000","28,27,26:27" +"38710","18","4.80000","0.0000000","29" +"38711","19","4.80000","1.0000000","32" +"38708","20","4.80000","0.0000000","The wrong answer" +"38709","21","4.80000","0.0000000","JSIRVzHgPpKo3d4" +"38705","22","4.80000","0.0000000","The wrong answer" +"38706","23","4.80000","0.0000000","1tt76IaskUZVJ" +"38707","24","4.80000","1.0000000","no" +"38704","25","4.80000","0.0000000","27-41,26-43" +"38992","1","8.70000","0.0000000", +"38993","2","8.70000","0.0000000", +"38994","3","8.70000","0.0000000", +"38995","4","8.70000","0.0000000", +"39016","5","8.70000","0.0000000","3-386383057,2-789367675,1-511566162" +"39017","6","8.70000","0.0000000","6-874542236,5-90576172,4-561218262" +"39018","7","8.70000","0.0000000","7-204498291,9-955780029,8-572387695" +"39019","8","8.70000","1.5000000","1-6,2-Answer that gives half the credit,3--22154.8216407,4-14,5-23122.3489355" +"39020","14","8.70000","1.0000000","17,18,19:19" +"39021","15","8.70000","0.3000000","21,22,20:20" +"39022","16","8.70000","0.9000000","25,24,23:24" +"39023","17","8.70000","1.0000000","27,26,28:28" +"39030","18","8.70000","0.0000000","29" +"39031","19","8.70000","0.0000000","31" +"39028","20","8.70000","1.0000000","no one" +"39029","21","8.70000","0.0000000","aCGpaY" +"39025","22","8.70000","1.0000000","yes" +"39026","23","8.70000","0.0000000","The wrong answer" +"39027","24","8.70000","1.0000000","no" +"39024","25","8.70000","1.0000000","28-44,26-41" +"39032","1","11.80000","0.0000000", +"39033","2","11.80000","0.0000000", +"39034","3","11.80000","0.0000000", +"39035","4","11.80000","0.0000000", +"39056","5","11.80000","0.0000000","3-386383057,2-789367675,1-511566162" +"39057","6","11.80000","0.0000000","5-90576172,6-561218262,4-874542236" +"39058","7","11.80000","0.0000000","8-572387695,7-204498291,9-955780029" +"39059","8","11.80000","4.0000000","1-5,2-The wrong answer,3-12799.1604217,4-14,5-1.91687118712" +"39060","14","11.80000","0.9000000","19,17,18:18" +"39061","15","11.80000","1.0000000","20,21,22:22" +"39062","16","11.80000","0.9000000","25,23,24:24" +"39063","17","11.80000","1.0000000","28,26,27:28" +"39070","18","11.80000","0.0000000","29" +"39071","19","11.80000","0.0000000","31" +"39068","20","11.80000","0.0000000","The wrong answer" +"39069","21","11.80000","1.0000000","someone" +"39065","22","11.80000","1.0000000","yes" +"39066","23","11.80000","1.0000000","no" +"39067","24","11.80000","1.0000000","no" +"39064","25","11.80000","0.0000000","26-43,27-41" +"39272","1","6.00000","0.0000000", +"39273","2","6.00000","0.0000000", +"39274","3","6.00000","0.0000000", +"39275","4","6.00000","0.0000000", +"39296","5","6.00000","0.0000000","1-789367675,2-511566162,3-386383057" +"39297","6","6.00000","0.0000000","5-561218262,6-874542236,4-90576172" +"39298","7","6.00000","0.0000000","9-204498291,8-955780029,7-572387695" +"39299","8","6.00000","2.0000000","1-7,2-OhNBFCc,3-21451.3654305,4-14,5-13758.6327684" +"39300","14","6.00000","0.9000000","19,17,18:18" +"39301","15","6.00000","0.9000000","22,20,21:21" +"39302","16","6.00000","0.3000000","24,25,23:23" +"39303","17","6.00000","0.9000000","28,27,26:27" +"39310","18","6.00000","0.0000000","29" +"39311","19","6.00000","0.0000000","31" +"39308","20","6.00000","0.0000000","The wrong answer" +"39309","21","6.00000","0.0000000","zNTD0TDf" +"39305","22","6.00000","1.0000000","yes" +"39306","23","6.00000","0.0000000","The wrong answer" +"39307","24","6.00000","0.0000000","The wrong answer" +"39304","25","6.00000","0.0000000","26-44,28-41" +"36192","1","5.90000","0.0000000", +"36193","2","5.90000","0.0000000", +"36194","3","5.90000","0.0000000", +"36195","4","5.90000","0.0000000", +"36216","5","5.90000","0.0000000","1-386383057,3-789367675,2-511566162" +"36217","6","5.90000","0.0000000","5-90576172,4-874542236,6-561218262" +"36218","7","5.90000","0.0000000","8-572387695,9-204498291,7-955780029" +"36219","8","5.90000","1.0000000","1-7,2-pJkaD2j2i,3-6047.21651207,4-15,5-14488.106299" +"36220","14","5.90000","1.0000000","17,19,18:19" +"36221","15","5.90000","0.3000000","22,21,20:20" +"36222","16","5.90000","0.3000000","23,25,24:23" +"36223","17","5.90000","0.3000000","28,26,27:26" +"36230","18","5.90000","0.0000000","29" +"36231","19","5.90000","0.0000000","31" +"36228","20","5.90000","1.0000000","no one" +"36229","21","5.90000","0.0000000","HifU35OHtKrv9ao" +"36225","22","5.90000","1.0000000","yes" +"36226","23","5.90000","1.0000000","no" +"36227","24","5.90000","0.0000000","The wrong answer" +"36224","25","5.90000","0.0000000","26-44,28-41" +"36352","1","12.80000","0.0000000", +"36353","2","12.80000","0.0000000", +"36354","3","12.80000","0.0000000", +"36355","4","12.80000","0.0000000", +"36376","5","12.80000","0.0000000","2-511566162,1-386383057,3-789367675" +"36377","6","12.80000","0.0000000","6-874542236,5-561218262,4-90576172" +"36378","7","12.80000","0.0000000","8-572387695,9-204498291,7-955780029" +"36379","8","12.80000","6.0000000","1-7,2-Wrong answer,3-23.8238632628,4-15,5-4.09608160016" +"36380","14","12.80000","0.9000000","18,19,17:18" +"36381","15","12.80000","1.0000000","20,22,21:22" +"36382","16","12.80000","1.0000000","24,25,23:25" +"36383","17","12.80000","0.9000000","28,27,26:27" +"36390","18","12.80000","1.0000000","30" +"36391","19","12.80000","1.0000000","32" +"36388","20","12.80000","0.0000000","The wrong answer" +"36389","21","12.80000","0.0000000","The wrong answer" +"36385","22","12.80000","0.0000000","The wrong answer" +"36386","23","12.80000","0.0000000","The wrong answer" +"36387","24","12.80000","1.0000000","no" +"36384","25","12.80000","0.0000000","27-41,26-43" +"36832","1","13.80000","0.0000000", +"36833","2","13.80000","0.0000000", +"36834","3","13.80000","0.0000000", +"36835","4","13.80000","0.0000000", +"36856","5","13.80000","0.0000000","3-511566162,2-386383057,1-789367675" +"36857","6","13.80000","0.0000000","5-561218262,6-90576172,4-874542236" +"36858","7","13.80000","0.0000000","8-204498291,9-955780029,7-572387695" +"36859","8","13.80000","7.0000000","1-7,2-The wrong answer,3-23.8417280892,4-14,5-4.89551127517" +"36860","14","13.80000","0.9000000","18,19,17:18" +"36861","15","13.80000","0.3000000","21,22,20:20" +"36862","16","13.80000","0.3000000","24,23,25:23" +"36863","17","13.80000","0.3000000","27,26,28:26" +"36870","18","13.80000","0.0000000","29" +"36871","19","13.80000","0.0000000","31" +"36868","20","13.80000","1.0000000","nobody" +"36869","21","13.80000","1.0000000","something" +"36865","22","13.80000","0.0000000","dauFTJ" +"36866","23","13.80000","1.0000000","no" +"36867","24","13.80000","1.0000000","no" +"36864","25","13.80000","1.0000000","27-43,26-41" diff --git a/mod/quiz/report/statistics/simpletest/slowtest_qstats.php b/mod/quiz/report/statistics/simpletest/slowtest_qstats.php new file mode 100644 index 0000000000..0a676a879d --- /dev/null +++ b/mod/quiz/report/statistics/simpletest/slowtest_qstats.php @@ -0,0 +1,107 @@ +libdir . '/simpletestlib.php'); // Include the test libraries +require_once("$CFG->dirroot/mod/quiz/report/statistics/qstats.php"); +require_once($CFG->dirroot.'/mod/quiz/locallib.php'); +require_once($CFG->dirroot.'/mod/quiz/report/reportlib.php'); + +/** + * This class contains the test cases for the functions in qstats.php. + * + * */ +class quiz_report_qstats_test extends UnitTestCase { + /** + * @var qstats object created to test class + */ + var $qstats; + + function test_qstats() { + global $CFG; + //data is taken from randomly generated attempts data generated by contrib/tools/generators/qagenerator/ + $states = $this->get_records_from_csv($CFG->dirroot.'\mod\quiz\report\statistics\simpletest\mdl_question_states.csv'); + //data is taken from questions mostly generated by contrib/tools/generators/generator.php + $questions = $this->get_records_from_csv($CFG->dirroot.'\mod\quiz\report\statistics\simpletest\mdl_question.csv'); + $this->qstats = new qstats($questions, 22, 10045.45455); + $this->qstats->states = $states; + $this->qstats->process_states(); + + //values expected are taken from contrib/tools/quiz_tools/stats.xls + $facility = array(0,0,0,0,null,null,null,41.19318182,81.36363636,71.36363636,65.45454545,65.90909091,36.36363636,59.09090909,50,59.09090909,63.63636364,45.45454545,27.27272727,50); + $this->qstats_q_fields('facility', $facility, 100); + $sd = array(0,0,0,0,null,null,null,1912.733589,251.2738111,322.6312277,333.4199022,337.5811591,492.3659639,503.2362797,511.7663157,503.2362797,492.3659639,509.6471914,455.8423058,511.7663157); + $this->qstats_q_fields('sd', $sd, 1000); + $effectiveweight = array(0,0,0,0,0,0,0,26.58464457,3.368456046,3.253955259,7.584083694,3.79658376,3.183278505,4.532356904,7.78856243,10.08351572,8.381139345,8.727645713,7.946277111,4.769500946); + $this->qstats_q_fields('effectiveweight', $effectiveweight); + $discriminationindex = array(null,null,null,null,null,null,null,25.88327077,1.170256965,-4.207816809,28.16930644,-2.513606859,-12.99017581,-8.900638238,8.670004606,29.63337745,15.18945843,16.21079629,15.52451404,-8.396734802); + $this->qstats_q_fields('discriminationindex', $discriminationindex); + $discriminativeefficiency = array(null,null,null,null,null,null,null,27.23492723,1.382386552,-4.691171307,31.12404354,-2.877487579,-17.5074184,-10.27568922,10.86956522,34.58997279,17.4790556,20.14359793,22.06477733,-10); + $this->qstats_q_fields('discriminativeefficiency', $discriminativeefficiency); + } + function qstats_q_fields($fieldname, $values, $multiplier=1) { + foreach ($this->qstats->questions as $question){ + $value = array_shift($values); + if ($value !== null){ + $this->assertWithinMargin($question->_stats->{$fieldname}*$multiplier, $value, 1E-6); + } else { + $this->assertEqual($question->_stats->{$fieldname}*$multiplier, $value); + } + } + } + + function get_fields_from_csv($line){ + $line = trim($line); + $items = preg_split('!,!', $line); + while (list($key) = each($items)){ + if ($items[$key]!=''){ + if ($start = ($items[$key]{0}=='"')){ + $items[$key] = substr($items[$key], 1); + while (!$end = ($items[$key]{strlen($items[$key])-1}=='"')){ + $item = $items[$key]; + unset($items[$key]); + list($key) = each($items); + $items[$key] = $item.','.$items[$key]; + } + $items[$key] = substr($items[$key], 0, strlen($items[$key])-1); + } + + } + } + return $items; + } + + function get_records_from_csv($filename){ + $filecontents = file($filename, FILE_IGNORE_NEW_LINES); + $records = array(); + $keys = $this->get_fields_from_csv(array_shift($filecontents));//first line is field names + while (NULL !== ($line = array_shift($filecontents))) { + $data = $this->get_fields_from_csv($line); + $arraykey = reset($data); + $object = new object(); + foreach ($keys as $key) { + $value = array_shift($data); + if ($value !== NULL){ + $object->{$key} = $value; + } else { + $object->{$key} = ''; + } + } + $records[$arraykey] = $object; + } + return $records; + } +} + +//$test = new quiz_report_qstats_test(); +//$test->test_qstats(); +?> \ No newline at end of file