From cb06574d5bda61bb5f309833ad2a9dac1e832ab0 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 5 Jun 2009 08:30:35 +0000 Subject: [PATCH] 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. --- question/editlib.php | 4 ++++ question/question.php | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/question/editlib.php b/question/editlib.php index 594a57d0965..6d363ba287e 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -162,6 +162,7 @@ function question_list($contexts, $pageurl, $categoryandcontext, $cm = null, $showquestiontext = false, $addcontexts = array()) { global $USER, $CFG, $THEME, $COURSE; + $lastchangedid=optional_param('lastchanged',0,PARAM_INT); list($categoryid, $contextid)= explode(',', $categoryandcontext); $qtypemenu = question_type_menu(); @@ -298,6 +299,9 @@ function question_list($contexts, $pageurl, $categoryandcontext, $cm = null, if ($showquestiontext) { $nameclass .= ' header'; } + if ($question->id==$lastchangedid) { + $nameclass='highlight'; + } if ($nameclass) { $nameclass = 'class="' . $nameclass . '"'; } diff --git a/question/question.php b/question/question.php index 295497b1000..974c58cb0c8 100644 --- a/question/question.php +++ b/question/question.php @@ -199,7 +199,9 @@ if ($mform->is_cancelled()){ notify(get_string('changessaved'), ''); close_window(3); } else { - redirect($returnurl); + $nexturl = new moodle_url($returnurl); + $nexturl->param('lastchanged',$question->id); + redirect($nexturl->out()); } } else { $nexturlparams = array('returnurl'=>$returnurl);