Skip to content

Commit

Permalink
MDL-32245 question bank: update URL after moving question between cat…
Browse files Browse the repository at this point in the history
…egories.

Also, improve the URL when you go to edit the questions in a category.
  • Loading branch information
timhunt authored and Sam Hemelryk committed Dec 19, 2012
1 parent 9171692 commit 9645fe8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion question/category_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function item_html($extraargs = array()){
$editqestions = get_string('editquestions', 'question');

/// Each section adds html to be displayed as part of this list item
$questionbankurl = new moodle_url("/question/edit.php", ($this->parentlist->pageurl->params() + array('category'=>"$category->id,$category->contextid")));
$questionbankurl = new moodle_url("/question/edit.php", ($this->parentlist->pageurl->params() + array('cat'=>"$category->id,$category->contextid")));
$catediturl = $this->parentlist->pageurl->out(true, array('edit' => $this->id));
$item = "<b><a title=\"{$str->edit}\" href=\"$catediturl\">" .
format_string($category->name, true, array('context' => $this->parentlist->context)) .
Expand Down Expand Up @@ -456,6 +456,8 @@ public function update_category($updateid, $newparent, $newname, $newinfo) {
question_move_category_to_context($cat->id, $oldcat->contextid, $tocontextid);
}

// Cat param depends on the context id, so update it.
$this->pageurl->param('cat', $updateid . ',' . $tocontextid);
redirect($this->pageurl);
}
}

0 comments on commit 9645fe8

Please sign in to comment.