mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Merge branch 'MDL-67002' of https://github.com/timhunt/moodle into master
This commit is contained in:
commit
d40cecdb8a
@ -385,8 +385,13 @@ abstract class quiz_attempts_report_table extends table_sql {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get any fields that might be needed when sorting on date for a particular slot.
|
* Get any fields that might be needed when sorting on date for a particular slot.
|
||||||
|
*
|
||||||
|
* Note: these values are only used for sorting. The values displayed are taken
|
||||||
|
* from $this->lateststeps loaded in load_extra_data().
|
||||||
|
*
|
||||||
* @param int $slot the slot for the column we want.
|
* @param int $slot the slot for the column we want.
|
||||||
* @param string $alias the table alias for latest state information relating to that slot.
|
* @param string $alias the table alias for latest state information relating to that slot.
|
||||||
|
* @return string definitions of extra fields to add to the SELECT list of the query.
|
||||||
*/
|
*/
|
||||||
protected function get_required_latest_state_fields($slot, $alias) {
|
protected function get_required_latest_state_fields($slot, $alias) {
|
||||||
return '';
|
return '';
|
||||||
|
@ -114,14 +114,7 @@ class quiz_last_responses_table extends quiz_attempts_report_table {
|
|||||||
if (!isset($this->lateststeps[$attempt->usageid][$slot])) {
|
if (!isset($this->lateststeps[$attempt->usageid][$slot])) {
|
||||||
return '-';
|
return '-';
|
||||||
}
|
}
|
||||||
$stepdata = $this->lateststeps[$attempt->usageid][$slot];
|
return $this->lateststeps[$attempt->usageid][$slot]->$field;
|
||||||
|
|
||||||
if (property_exists($stepdata, $field . 'full')) {
|
|
||||||
$value = $stepdata->{$field . 'full'};
|
|
||||||
} else {
|
|
||||||
$value = $stepdata->$field;
|
|
||||||
}
|
|
||||||
return $value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function other_cols($colname, $attempt) {
|
public function other_cols($colname, $attempt) {
|
||||||
@ -158,20 +151,8 @@ class quiz_last_responses_table extends quiz_attempts_report_table {
|
|||||||
*/
|
*/
|
||||||
protected function get_required_latest_state_fields($slot, $alias) {
|
protected function get_required_latest_state_fields($slot, $alias) {
|
||||||
global $DB;
|
global $DB;
|
||||||
$sortableresponse = $DB->sql_order_by_text("{$alias}.questionsummary");
|
return $DB->sql_order_by_text("{$alias}.questionsummary") . " AS question{$slot},
|
||||||
if ($sortableresponse === "{$alias}.questionsummary") {
|
" . $DB->sql_order_by_text("{$alias}.rightanswer") . " AS right{$slot},
|
||||||
// Can just order by text columns. No complexity needed.
|
" . $DB->sql_order_by_text("{$alias}.responsesummary") . " AS response{$slot}";
|
||||||
return "{$alias}.questionsummary AS question{$slot},
|
|
||||||
{$alias}.rightanswer AS right{$slot},
|
|
||||||
{$alias}.responsesummary AS response{$slot}";
|
|
||||||
} else {
|
|
||||||
// Work-around required.
|
|
||||||
return $DB->sql_order_by_text("{$alias}.questionsummary") . " AS question{$slot},
|
|
||||||
{$alias}.questionsummary AS question{$slot}full,
|
|
||||||
" . $DB->sql_order_by_text("{$alias}.rightanswer") . " AS right{$slot},
|
|
||||||
{$alias}.rightanswer AS right{$slot}full,
|
|
||||||
" . $DB->sql_order_by_text("{$alias}.responsesummary") . " AS response{$slot},
|
|
||||||
{$alias}.responsesummary AS response{$slot}full";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user