question bank: MDL-18822 Highlight the last question you edited in the list
Helpful if you need to edit a lot of questions - saves you from losing your place. Idea and patch by Oleg Sychev.
This commit is contained in:
@@ -776,6 +776,7 @@ class question_bank_view {
|
||||
protected $extrarows;
|
||||
protected $requiredcolumns;
|
||||
protected $sort;
|
||||
protected $lastchangedid;
|
||||
protected $countsql;
|
||||
protected $loadsql;
|
||||
protected $sqlparams;
|
||||
@@ -803,6 +804,8 @@ class question_bank_view {
|
||||
$this->editquestionurl->param('courseid', $this->course->id);
|
||||
}
|
||||
|
||||
$this->lastchangedid = optional_param('lastchanged',0,PARAM_INT);
|
||||
|
||||
$this->init_column_types();
|
||||
$this->init_columns($this->wanted_columns());
|
||||
$this->init_sort();
|
||||
@@ -1340,6 +1343,9 @@ class question_bank_view {
|
||||
if ($question->hidden) {
|
||||
$classes[] = 'dimmed_text';
|
||||
}
|
||||
if ($question->id == $this->lastchangedid) {
|
||||
$nameclass='highlight';
|
||||
}
|
||||
if (!empty($this->extrarows)) {
|
||||
$classes[] = 'r' . ($rowcount % 2);
|
||||
}
|
||||
|
||||
@@ -216,11 +216,12 @@ if ($mform->is_cancelled()){
|
||||
notify(get_string('changessaved'), '');
|
||||
close_window(3);
|
||||
} else {
|
||||
if($appendqnumstring){
|
||||
$returnurl_object=new moodle_url($returnurl);
|
||||
$returnurl=$returnurl_object->out(false,array($appendqnumstring=>($question->id), "sesskey"=>sesskey(), "cmid"=>$cmid));
|
||||
$nexturl = new moodle_url($returnurl);
|
||||
$nexturl->param('lastchanged', $question->id);
|
||||
if($appendqnumstring) {
|
||||
$nexturl->params(array($appendqnumstring=>($question->id), "sesskey"=>sesskey(), "cmid"=>$cmid));
|
||||
}
|
||||
redirect($returnurl);
|
||||
redirect($nexturl->out());
|
||||
}
|
||||
} else {
|
||||
$nexturlparams = array('returnurl'=>$returnurl, 'appendqnumstring'=>$appendqnumstring);
|
||||
|
||||
Reference in New Issue
Block a user