diff --git a/grade/report/grader/index.php b/grade/report/grader/index.php index 3de8b30daeb..65c2f3d33ab 100644 --- a/grade/report/grader/index.php +++ b/grade/report/grader/index.php @@ -21,7 +21,7 @@ if (!is_null($toggle) && !empty($toggle_type)) { } // Initialise the grader report object -$report = new grade_report_grader($courseid, $context, $page, $sortitemid); +$report = new grade_report_grader($courseid, $gpr, $context, $page, $sortitemid); /// processing posted grades & feedback here if ($data = data_submitted() and confirm_sesskey()) { @@ -64,11 +64,11 @@ echo $report->get_toggles_html(); print_paging_bar($numusers, $report->page, $report->get_pref('studentsperpage'), $report->pbarurl); $reporthtml = '
'. "\n";
} else if ($type == 'item' or $type == 'categoryitem' or $type == 'courseitem'){
$url = GRADE_EDIT_URL . '/item.php?courseid='.$object->courseid.'&id='.$object->id;
- $url = $gpr->add_url_params($url);
+ $url = $this->gpr->add_url_params($url);
$edit_icon = '
'. "\n";
} else if ($type == 'grade' and ($states['is_editable'] or empty($object->id))) {
// TODO: change link to use itemid and userid to allow creating of new grade objects
$url = GRADE_EDIT_URL . '/grade.php?courseid='.$object->courseid.'&id='.$object->id;
- $url = $gpr->add_url_params($url);
+ $url = $this->gpr->add_url_params($url);
$edit_icon = '
'. "\n";
}
@@ -1008,7 +1009,7 @@ class grade_report_grader extends grade_report {
// show calculation icon only when calculation possible
if (!$object->is_normal_item() and ($object->gradetype == GRADE_TYPE_SCALE or $object->gradetype == GRADE_TYPE_VALUE)) {
$url = GRADE_EDIT_URL . '/calculation.php?courseid='.$object->courseid.'&id='.$object->id;
- $url = $gpr->add_url_params($url);
+ $url = $this->gpr->add_url_params($url);
$edit_calculation_icon = '
'. "\n";
}
diff --git a/grade/report/lib.php b/grade/report/lib.php
index 31cc011022b..6084efc5d21 100755
--- a/grade/report/lib.php
+++ b/grade/report/lib.php
@@ -18,6 +18,9 @@ class grade_report {
*/
var $courseid;
+ /** Grade plugin return tracking object.
+ var $gpr;
+
/**
* The context.
* @var int $context
@@ -69,15 +72,17 @@ class grade_report {
/**
* Constructor. Sets local copies of user preferences and initialises grade_tree.
* @param int $courseid
+ * @param object $gpr grade plugin return tracking object
* @param string $context
* @param int $page The current page being viewed (when report is paged)
*/
- function grade_report($courseid, $context, $page=null) {
+ function grade_report($courseid, $gpr, $context, $page=null) {
global $CFG;
$this->courseid = $courseid;
- $this->context = $context;
- $this->page = $page;
+ $this->gpr = $gpr;
+ $this->context = $context;
+ $this->page = $page;
// roles to be displayed in the gradebook
$this->gradebookroles = $CFG->gradebookroles;
diff --git a/grade/report/user/index.php b/grade/report/user/index.php
index 3d102c323cf..4e1e8936634 100644
--- a/grade/report/user/index.php
+++ b/grade/report/user/index.php
@@ -11,7 +11,7 @@ if (!$userid = optional_param('user', 0, PARAM_INT)) {
}
// Create a report instance
-$report = new grade_report_user($courseid, $context, $userid);
+$report = new grade_report_user($courseid, $gpr, $context, $userid);
// find total number of participants
$numusers = $report->get_numusers();
diff --git a/grade/report/user/lib.php b/grade/report/user/lib.php
index dfeeccb66f6..3b8e21c26c5 100644
--- a/grade/report/user/lib.php
+++ b/grade/report/user/lib.php
@@ -29,12 +29,13 @@ class grade_report_user extends grade_report {
/**
* Constructor. Sets local copies of user preferences and initialises grade_tree.
* @param int $courseid
+ * @param object $gpr grade plugin return tracking object
* @param string $context
* @param int $userid The id of the user
*/
- function grade_report_user($courseid, $context, $userid) {
+ function grade_report_user($courseid, $gpr, $context, $userid) {
global $CFG;
- parent::grade_report($courseid, $context);
+ parent::grade_report($courseid, $gpr, $context);
// get the user (for full name)
$this->user = get_record('user', 'id', $userid);