Merge branch 'MDL-44535-master-v2' of https://github.com/jamiepratt/moodle

This commit is contained in:
Sam Hemelryk
2014-03-25 12:51:14 +13:00
4 changed files with 29 additions and 4 deletions
@@ -1,6 +1,9 @@
slot,subpart,modelresponse,actualresponse,totalcount,count1,count2,count3,count4,count5
1,1,frog: insect,insect,2,2,0,0,0,0
1,1,frog: insect,insect,3,3,0,0,0,0
1,1,"frog: mammal",mammal,1,0,0,1,0,0
1,2,"cat: insect",insect,2,1,1,0,0,0
1,1,"frog: amphibian",amphibian,1,0,0,0,0,1
1,2,"cat: insect",insect,3,2,1,0,0,0
1,2,cat: amphibian,amphibian,1,1,0,0,0,0
1,3,newt: insect,insect,2,2,0,0,0,0
1,2,cat: mammal,mammal,2,0,0,0,0,2
1,3,newt: insect,insect,3,3,0,0,0,0
1,3,newt: amphibian,amphibian,2,0,0,0,0,2
1 slot subpart modelresponse actualresponse totalcount count1 count2 count3 count4 count5
2 1 1 frog: insect insect 2 3 2 3 0 0 0 0
3 1 1 frog: mammal mammal 1 0 0 1 0 0
4 1 2 1 cat: insect frog: amphibian insect amphibian 2 1 1 0 1 0 0 0 0 1
5 1 2 cat: insect insect 3 2 1 0 0 0
6 1 2 cat: amphibian amphibian 1 1 0 0 0 0
7 1 3 2 newt: insect cat: mammal insect mammal 2 2 0 0 0 0 0 2
8 1 3 newt: insect insect 3 3 0 0 0 0
9 1 3 newt: amphibian amphibian 2 0 0 0 0 2
+14 -1
View File
@@ -16,4 +16,17 @@ quizattempt,firstname,lastname,responses.1.0,responses.1.1,responses.1.2,respons
2,Mark,Jones,mammal,insect,insect,0,1,0
2,Mark,Jones,mammal,insect,insect,1,0,0
2,Mark,Jones,mammal,insect,insect,0,1,0
2,Mark,Jones,mammal,insect,insect,1,0,1
2,Mark,Jones,mammal,mammal,insect,1,0,0
2,Mark,Jones,mammal,mammal,insect,0,1,0
2,Mark,Jones,mammal,mammal,amphibian,1,0,1
3,Michael,Jackson,insect,insect,insect,1,0,0
3,Michael,Jackson,insect,insect,insect,0,1,0
3,Michael,Jackson,insect,insect,insect,1,0,0
3,Michael,Jackson,insect,insect,insect,0,1,0
3,Michael,Jackson,insect,insect,insect,1,0,0
3,Michael,Jackson,insect,insect,insect,0,1,0
3,Michael,Jackson,insect,insect,insect,1,0,0
3,Michael,Jackson,insect,insect,insect,0,1,0
3,Michael,Jackson,insect,insect,insect,1,0,0
3,Michael,Jackson,insect,insect,insect,0,1,0
3,Michael,Jackson,amphibian,mammal,amphibian,1,0,1
1 quizattempt firstname lastname responses.1.0 responses.1.1 responses.1.2 responses.1.-submit responses.1.-tryagain finished
16 2 Mark Jones mammal insect insect 0 1 0
17 2 Mark Jones mammal insect insect 1 0 0
18 2 Mark Jones mammal insect insect 0 1 0
19 2 Mark Jones mammal insect mammal insect 1 0 1 0
20 2 Mark Jones mammal mammal insect 0 1 0
21 2 Mark Jones mammal mammal amphibian 1 0 1
22 3 Michael Jackson insect insect insect 1 0 0
23 3 Michael Jackson insect insect insect 0 1 0
24 3 Michael Jackson insect insect insect 1 0 0
25 3 Michael Jackson insect insect insect 0 1 0
26 3 Michael Jackson insect insect insect 1 0 0
27 3 Michael Jackson insect insect insect 0 1 0
28 3 Michael Jackson insect insect insect 1 0 0
29 3 Michael Jackson insect insect insect 0 1 0
30 3 Michael Jackson insect insect insect 1 0 0
31 3 Michael Jackson insect insect insect 0 1 0
32 3 Michael Jackson amphibian mammal amphibian 1 0 1
@@ -35,6 +35,12 @@ defined('MOODLE_INTERNAL') || die();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class analyser {
/**
* @var int When analysing responses and breaking down the count of responses per try, how many columns should we break down
* tries into? This is set to 5 columns, any response in a try more than try 5 will be counted in the fifth column.
*/
const MAX_TRY_COUNTED = 5;
/** @var int Time after which responses are automatically reanalysed. */
const TIME_TO_CACHE = 900; // 15 minutes.
@@ -80,6 +80,9 @@ class analysis_for_actual_response {
public function increment_count($try = 0) {
$this->totalcount++;
if ($try != 0) {
if ($try > analyser::MAX_TRY_COUNTED) {
$try = analyser::MAX_TRY_COUNTED;
}
if (!isset($this->trycount[$try])) {
$this->trycount[$try] = 0;
}