mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-25721 core_question: added ability to order questions by dates
This commit is contained in:
parent
20d38830ae
commit
810920b15d
3 changed files with 17 additions and 2 deletions
|
@ -804,6 +804,15 @@ table.quizreviewsummary td.cell {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
}
|
}
|
||||||
|
#categoryquestions td.modifiername,
|
||||||
|
#categoryquestions td.creatorname {
|
||||||
|
line-height: 1em;
|
||||||
|
}
|
||||||
|
#categoryquestions td.modifiername span.date,
|
||||||
|
#categoryquestions td.creatorname span.date {
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
table#categoryquestions {
|
table#categoryquestions {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
@ -37,7 +37,8 @@ class creator_name_column extends column_base {
|
||||||
if (!empty($question->creatorfirstname) && !empty($question->creatorlastname)) {
|
if (!empty($question->creatorfirstname) && !empty($question->creatorlastname)) {
|
||||||
$u = new \stdClass();
|
$u = new \stdClass();
|
||||||
$u = username_load_fields_from_object($u, $question, 'creator');
|
$u = username_load_fields_from_object($u, $question, 'creator');
|
||||||
echo fullname($u);
|
$date = userdate($question->timecreated, get_string('strftimedatetime', 'langconfig'));
|
||||||
|
echo fullname($u) . '<br>' . \html_writer::tag('span', $date, array('class' => 'date'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +52,7 @@ class creator_name_column extends column_base {
|
||||||
foreach ($allnames as $allname) {
|
foreach ($allnames as $allname) {
|
||||||
$requiredfields[] = 'uc.' . $allname . ' AS creator' . $allname;
|
$requiredfields[] = 'uc.' . $allname . ' AS creator' . $allname;
|
||||||
}
|
}
|
||||||
|
$requiredfields[] = 'q.timecreated';
|
||||||
return $requiredfields;
|
return $requiredfields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +60,7 @@ class creator_name_column extends column_base {
|
||||||
return array(
|
return array(
|
||||||
'firstname' => array('field' => 'uc.firstname', 'title' => get_string('firstname')),
|
'firstname' => array('field' => 'uc.firstname', 'title' => get_string('firstname')),
|
||||||
'lastname' => array('field' => 'uc.lastname', 'title' => get_string('lastname')),
|
'lastname' => array('field' => 'uc.lastname', 'title' => get_string('lastname')),
|
||||||
|
'timecreated' => array('field' => 'q.timecreated', 'title' => get_string('date'))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,8 @@ class modifier_name_column extends column_base {
|
||||||
if (!empty($question->modifierfirstname) && !empty($question->modifierlastname)) {
|
if (!empty($question->modifierfirstname) && !empty($question->modifierlastname)) {
|
||||||
$u = new \stdClass();
|
$u = new \stdClass();
|
||||||
$u = username_load_fields_from_object($u, $question, 'modifier');
|
$u = username_load_fields_from_object($u, $question, 'modifier');
|
||||||
echo fullname($u);
|
$date = userdate($question->timemodified, get_string('strftimedatetime', 'langconfig'));
|
||||||
|
echo fullname($u) . '<br>' . \html_writer::tag('span', $date, array('class' => 'date'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +51,7 @@ class modifier_name_column extends column_base {
|
||||||
foreach ($allnames as $allname) {
|
foreach ($allnames as $allname) {
|
||||||
$requiredfields[] = 'um.' . $allname . ' AS modifier' . $allname;
|
$requiredfields[] = 'um.' . $allname . ' AS modifier' . $allname;
|
||||||
}
|
}
|
||||||
|
$requiredfields[] = 'q.timemodified';
|
||||||
return $requiredfields;
|
return $requiredfields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,6 +59,7 @@ class modifier_name_column extends column_base {
|
||||||
return array(
|
return array(
|
||||||
'firstname' => array('field' => 'um.firstname', 'title' => get_string('firstname')),
|
'firstname' => array('field' => 'um.firstname', 'title' => get_string('firstname')),
|
||||||
'lastname' => array('field' => 'um.lastname', 'title' => get_string('lastname')),
|
'lastname' => array('field' => 'um.lastname', 'title' => get_string('lastname')),
|
||||||
|
'timemodified' => array('field' => 'q.timemodified', 'title' => get_string('date'))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue