Merge branch 'MDL-72124_master' of https://github.com/marxjohnson/moodle

This commit is contained in:
Paul Holden 2023-03-20 17:04:53 +00:00 committed by Sara Arjona
commit 1eb6c49fa3
5 changed files with 14 additions and 14 deletions

View file

@ -50,8 +50,8 @@ abstract class question_base extends base {
* @return \moodle_url
*/
public function get_url() {
$cat = $this->other['categoryid'] . ',' . $this->contextid;
if ($this->courseid) {
$cat = $this->other['categoryid'] . ',' . $this->contextid;
if ($this->contextlevel == CONTEXT_MODULE) {
return new \moodle_url('/question/edit.php',
['cmid' => $this->contextinstanceid, 'cat' => $cat, 'lastchanged' => $this->objectid]);
@ -60,8 +60,8 @@ abstract class question_base extends base {
['courseid' => $this->courseid, 'cat' => $cat, 'lastchanged' => $this->objectid]);
}
// Lets try viewing from the frontpage for contexts above course.
return new \moodle_url('/question/bank/managecategories/category.php',
['courseid' => SITEID, 'edit' => $this->other['categoryid'], 'lastchanged' => $this->objectid]);
return new \moodle_url('/question/edit.php',
['courseid' => SITEID, 'edit' => $cat, 'lastchanged' => $this->objectid]);
}
/**

View file

@ -50,15 +50,15 @@ abstract class question_category_base extends base {
* @return \moodle_url
*/
public function get_url() {
$cat = $this->objectid . ',' . $this->contextid;
if ($this->courseid) {
$cat = $this->objectid . ',' . $this->contextid;
if ($this->contextlevel == CONTEXT_MODULE) {
return new \moodle_url('/question/edit.php', ['cmid' => $this->contextinstanceid, 'cat' => $cat]);
}
return new \moodle_url('/question/edit.php', ['courseid' => $this->courseid, 'cat' => $cat]);
}
// Lets try viewing from the frontpage for contexts above course.
return new \moodle_url('/question/bank/managecategories/category.php', ['courseid' => SITEID, 'edit' => $this->objectid]);
return new \moodle_url('/question/edit.php', ['courseid' => SITEID, 'cat' => $cat, 'edit' => $this->objectid]);
}
/**

View file

@ -77,8 +77,8 @@ class question_moved extends question_base {
* @return \moodle_url
*/
public function get_url() {
$cat = $this->other['newcategoryid'] . ',' . $this->contextid;
if ($this->courseid) {
$cat = $this->other['newcategoryid'] . ',' . $this->contextid;
if ($this->contextlevel == CONTEXT_MODULE) {
return new \moodle_url('/question/edit.php',
['cmid' => $this->contextinstanceid, 'cat' => $cat, 'lastchanged' => $this->objectid]);
@ -87,8 +87,8 @@ class question_moved extends question_base {
['courseid' => $this->courseid, 'cat' => $cat, 'lastchanged' => $this->objectid]);
}
// Lets try viewing from the frontpage for contexts above course.
return new \moodle_url('/question/bank/managecategories/category.php',
['courseid' => SITEID, 'edit' => $this->other['newcategoryid'], 'lastchanged' => $this->objectid]);
return new \moodle_url('/question/edit.php',
['courseid' => SITEID, 'cat' => $cat, 'lastchanged' => $this->objectid]);
}
/**

View file

@ -76,15 +76,15 @@ class questions_exported extends question_base {
* @return \moodle_url
*/
public function get_url() {
$cat = $this->other['categoryid'] . ',' . $this->contextid;
if ($this->courseid) {
$cat = $this->other['categoryid'] . ',' . $this->contextid;
if ($this->contextlevel == CONTEXT_MODULE) {
return new \moodle_url('/question/edit.php', ['cmid' => $this->contextinstanceid, 'cat' => $cat]);
}
return new \moodle_url('/question/edit.php', ['courseid' => $this->courseid, 'cat' => $cat]);
}
return new \moodle_url('/question/bank/managecategories/category.php',
['courseid' => SITEID, 'edit' => $this->other['categoryid']]);
return new \moodle_url('/question/edit.php',
['courseid' => SITEID, 'cat' => $cat]);
}
/**

View file

@ -76,15 +76,15 @@ class questions_imported extends question_base {
* @return \moodle_url
*/
public function get_url() {
$cat = $this->other['categoryid'] . ',' . $this->contextid;
if ($this->courseid) {
$cat = $this->other['categoryid'] . ',' . $this->contextid;
if ($this->contextlevel == CONTEXT_MODULE) {
return new \moodle_url('/question/edit.php', ['cmid' => $this->contextinstanceid, 'cat' => $cat]);
}
return new \moodle_url('/question/edit.php', ['courseid' => $this->courseid, 'cat' => $cat]);
}
return new \moodle_url('/question/bank/managecategories/category.php',
['courseid' => SITEID, 'edit' => $this->other['categoryid']]);
return new \moodle_url('/question/edit.php',
['courseid' => SITEID, 'cat' => $cat]);
}
/**