mirror of
https://github.com/moodle/moodle.git
synced 2025-02-13 12:34:28 +01:00
MDL-14209 "quiz stats report:Seperation of functionality and unit tests for calculations" Seperating out call for processing actual student responses from calculation of other grade stats as I want to unit test the grade stats calculations.
This commit is contained in:
parent
2f17b76d4b
commit
45cf6fd910
@ -94,7 +94,6 @@ class qstats{
|
||||
} else {
|
||||
$question =& $this->questions[$stats->questionid];
|
||||
}
|
||||
$this->_process_actual_responses($question, $state);
|
||||
|
||||
}
|
||||
|
||||
@ -269,6 +268,18 @@ class qstats{
|
||||
$this->questions[$qid]->_stats->effectiveweight = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function process_responses(){
|
||||
foreach ($this->states as $state){
|
||||
if ($this->questions[$state->question]->qtype == 'random'){
|
||||
if ($realstate = question_get_real_state($state)){
|
||||
$this->_process_actual_responses($this->subquestions[$realstate->question], $realstate);
|
||||
}
|
||||
} else {
|
||||
$this->_process_actual_responses($this->questions[$state->question], $state);
|
||||
}
|
||||
}
|
||||
$this->responses = quiz_report_unindex($this->responses);
|
||||
}
|
||||
/**
|
||||
|
@ -565,6 +565,7 @@ class quiz_statistics_report extends quiz_default_report {
|
||||
$qstats = new qstats($questions, $s, $sumgradesavg);
|
||||
$qstats->get_records($quizid, $currentgroup, $groupstudents, $useallattempts);
|
||||
$qstats->process_states();
|
||||
$qstats->process_responses();
|
||||
} else {
|
||||
$qstats = false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user