MDL-13298 "Question bank displays always page 1 after adding new question" this was caused because the question creation page was redirecting back to the question back edit page and telling it to change to the category of the question that was just saved. This was causing the edit page to go back to page 0 of the new category. Now we only go back to page 0 if the category has actually changed.

This commit is contained in:
jamiesensei
2008-02-05 12:08:38 +00:00
parent 0e47869e99
commit 1fe2c24de3
+4 -2
View File
@@ -637,8 +637,10 @@ function question_edit_setup($edittab, $requirecmid = false, $requirecourseid =
//a new cat.
$pagevars['cat'] = optional_param('cat', 0, PARAM_SEQUENCE);// if empty will be set up later
if ($category = optional_param('category', 0, PARAM_SEQUENCE)){
$pagevars['cat'] = $category;
$pagevars['qpage'] = 0;
if ($pagevars['cat'] != $category){ // is this a move to a new category?
$pagevars['cat'] = $category;
$pagevars['qpage'] = 0;
}
}
if ($pagevars['cat']){
$thispageurl->param('cat', $pagevars['cat']);