MDL-15268 "Content for Quiz Statistics report table" fixed a bug where every a row was added to the table for every time a subquestion was attempted.
This commit is contained in:
@@ -127,8 +127,8 @@ class qstats{
|
||||
$subquestionstats[$itemid]->differentweights = true;
|
||||
}
|
||||
$this->_initial_states_walker($state, $subquestionstats[$itemid], false);
|
||||
$subquestionstats[$itemid]->usedin[] = $state->question;
|
||||
$this->questions[$state->question]->_stats->subitems[] = $itemid;
|
||||
$subquestionstats[$itemid]->usedin[$state->question] = $state->question;
|
||||
$this->questions[$state->question]->_stats->subitems[$itemid] = $itemid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,6 +274,7 @@ class quiz_statistics_report extends quiz_default_report {
|
||||
if (isset($qstats)){
|
||||
foreach ($qstats->questions as $question){
|
||||
$table->add_data_keyed($table->format_row($question));
|
||||
ksort($question->_stats->subitems);
|
||||
foreach ($question->_stats->subitems as $itemid){
|
||||
$table->add_data_keyed($table->format_row($qstats->subquestions[$itemid]));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user