mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-29920 The link from gradebook back to the activity contains itemnumber
The activity module must have a chance to display appropriate grades report per itemnumber. Most activity modules have just one grade items si they can ignore the param. Complex modules like the Workshop need this.
This commit is contained in:
parent
49a537b356
commit
25ab1d50e2
@ -1145,6 +1145,7 @@ class grade_structure {
|
|||||||
$itemtype = $element['object']->itemtype;
|
$itemtype = $element['object']->itemtype;
|
||||||
$itemmodule = $element['object']->itemmodule;
|
$itemmodule = $element['object']->itemmodule;
|
||||||
$iteminstance = $element['object']->iteminstance;
|
$iteminstance = $element['object']->iteminstance;
|
||||||
|
$itemnumber = $element['object']->itemnumber;
|
||||||
|
|
||||||
// Links only for module items that have valid instance, module and are
|
// Links only for module items that have valid instance, module and are
|
||||||
// called from grade_tree with valid modinfo
|
// called from grade_tree with valid modinfo
|
||||||
@ -1167,7 +1168,7 @@ class grade_structure {
|
|||||||
// If module has grade.php, link to that, otherwise view.php
|
// If module has grade.php, link to that, otherwise view.php
|
||||||
$dir = $CFG->dirroot . '/mod/' . $itemmodule;
|
$dir = $CFG->dirroot . '/mod/' . $itemmodule;
|
||||||
if (file_exists($dir.'/grade.php')) {
|
if (file_exists($dir.'/grade.php')) {
|
||||||
return new moodle_url('/mod/' . $itemmodule . '/grade.php', array('id' => $cm->id));
|
return new moodle_url('/mod/' . $itemmodule . '/grade.php', array('id' => $cm->id, 'itemnumber' => $itemnumber));
|
||||||
} else {
|
} else {
|
||||||
return new moodle_url('/mod/' . $itemmodule . '/view.php', array('id' => $cm->id));
|
return new moodle_url('/mod/' . $itemmodule . '/view.php', array('id' => $cm->id));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user