/** * 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, $gpr, $context, $userid) { global $CFG; parent::grade_report($courseid, $gpr, $context); $this->showrank = grade_get_setting($this->courseid, 'report_user_showrank', $CFG->grade_report_user_showrank); $this->showpercentage = grade_get_setting($this->courseid, 'report_user_showpercentage', $CFG->grade_report_user_showpercentage); $this->showhiddenitems = grade_get_setting($this->courseid, 'report_user_showhiddenitems', $CFG->grade_report_user_showhiddenitems); $this->showrange = true; $this->switch = grade_get_setting($this->courseid, 'aggregationposition', $CFG->grade_aggregationposition); // Grab the grade_tree for this course $this->gtree = new grade_tree($this->courseid, false, $this->switch, false, !$CFG->enableoutcomes); // Determine the number of rows and indentation $this->maxdepth = 1; $this->inject_rowspans($this->gtree->top_element); $this->maxdepth++; // Need to account for the lead column that spans all children for ($i = 1; $i <= $this->maxdepth; $i++) { $this->evenodd[$i] = 0; } $this->tabledata = array(); $this->canviewhidden = has_capability('moodle/grade:viewhidden', get_context_instance(CONTEXT_COURSE, $this->courseid)); // get the user (for full name) $this->user = get_record('user', 'id', $userid); // base url for sorting by first/last name $this->baseurl = $CFG->wwwroot . '/grade/report?id=' . $courseid . '&userid=' . $userid; $this->pbarurl = $this->baseurl; // no groups on this report - rank is from all course users $this->setup_table(); }
/** * 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) * @param int $sortitemid The id of the grade_item by which to sort the table */ function grade_report_grader($courseid, $gpr, $context, $page = null, $sortitemid = null) { global $CFG; parent::grade_report($courseid, $gpr, $context, $page); // load collapsed settings for this report if ($collapsed = get_user_preferences('grade_report_grader_collapsed_categories')) { $this->collapsed = unserialize($collapsed); } else { $this->collapsed = array('aggregatesonly' => array(), 'gradesonly' => array()); } if (empty($CFG->enableoutcomes)) { $nooutcomes = false; } else { $nooutcomes = get_user_preferences('grade_report_shownooutcomes'); } // Grab the grade_tree for this course $this->gtree = new grade_tree($this->courseid, true, $this->get_pref('aggregationposition'), $this->collapsed, $nooutcomes); $this->sortitemid = $sortitemid; // base url for sorting by first/last name $studentsperpage = $this->get_pref('studentsperpage'); $perpage = ''; $curpage = ''; if (!empty($studentsperpage)) { $perpage = '&perpage=' . $studentsperpage; $curpage = '&page=' . $this->page; } $this->baseurl = 'index.php?id=' . $this->courseid . $perpage . $curpage . '&'; $this->pbarurl = 'index.php?id=' . $this->courseid . $perpage . '&'; // Setup groups if requested if ($this->get_pref('showgroups')) { $this->setup_groups(); } $this->setup_sortitemid(); }
/** * Constructor. Sets local copies of user preferences and initialises grade_tree. * @param int $userid * @param object $gpr grade plugin return tracking object * @param string $context */ function grade_report_overview($userid, $gpr, $context) { global $CFG, $COURSE; parent::grade_report($COURSE->id, $gpr, $context); // get the user (for full name) $this->user = get_record('user', 'id', $userid); // base url for sorting by first/last name $this->baseurl = $CFG->wwwroot . '/grade/overview/index.php?id=' . $userid; $this->pbarurl = $this->baseurl; $this->setup_table(); }
/** * Constructor. Sets local copies of user preferences and initialises grade_tree. * @param int $userid * @param object $gpr grade plugin return tracking object * @param string $context */ function grade_report_overview($userid, $gpr, $context) { global $CFG, $COURSE; parent::grade_report($COURSE->id, $gpr, $context); $this->showrank = grade_get_setting($this->courseid, 'report_overview_showrank', !empty($CFG->grade_report_overview_showrank)); $this->showtotalsifcontainhidden = grade_get_setting($this->courseid, 'report_overview_showtotalsifcontainhidden', $CFG->grade_report_overview_showtotalsifcontainhidden); // get the user (for full name) $this->user = get_record('user', 'id', $userid); // base url for sorting by first/last name $this->baseurl = $CFG->wwwroot . '/grade/overview/index.php?id=' . $userid; $this->pbarurl = $this->baseurl; $this->setup_table(); }
/** * 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, $gpr, $context, $userid) { global $CFG; parent::grade_report($courseid, $gpr, $context); $this->showrank = grade_get_setting($this->courseid, 'report_user_showrank', $CFG->grade_report_user_showrank); $this->showhiddenitems = grade_get_setting($this->courseid, 'report_user_showhiddenitems', $CFG->grade_report_user_showhiddenitems); $switch = grade_get_setting($this->courseid, 'aggregationposition', $CFG->grade_aggregationposition); // Grab the grade_seq for this course $this->gseq = new grade_seq($this->courseid, $switch); // get the user (for full name) $this->user = get_record('user', 'id', $userid); // base url for sorting by first/last name $this->baseurl = $CFG->wwwroot . '/grade/report?id=' . $courseid . '&userid=' . $userid; $this->pbarurl = $this->baseurl; // no groups on this report - rank is from all course users $this->setup_table(); }
/** * 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, $gpr, $context, $userid) { global $CFG; parent::grade_report($courseid, $gpr, $context); // Grab the grade_tree for this course $this->gtree = new grade_tree($this->courseid, true, $this->get_pref('aggregationposition')); // get the user (for full name) $this->user = get_record('user', 'id', $userid); // base url for sorting by first/last name $this->baseurl = $CFG->wwwroot . '/grade/report?id=' . $courseid . '&userid=' . $userid; $this->pbarurl = $this->baseurl; // Setup groups if requested if ($this->get_pref('showgroups')) { $this->setup_groups(); } $this->setup_table(); }
/** * 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) * @param int $sortitemid The id of the grade_item by which to sort the table */ function grade_report_grader($courseid, $gpr, $context, $page = null, $sortitemid = null) { global $CFG; parent::grade_report($courseid, $gpr, $context, $page); $this->canviewhidden = has_capability('moodle/grade:viewhidden', get_context_instance(CONTEXT_COURSE, $this->course->id)); $this->canviewuserreport = has_capability('gradereport/' . $CFG->grade_profilereport . ':view', $this->context); // load collapsed settings for this report if ($collapsed = get_user_preferences('grade_report_grader_collapsed_categories')) { $this->collapsed = unserialize($collapsed); } else { $this->collapsed = array('aggregatesonly' => array(), 'gradesonly' => array()); } if (empty($CFG->enableoutcomes)) { $nooutcomes = false; } else { $nooutcomes = get_user_preferences('grade_report_shownooutcomes'); } // if user report preference set or site report setting set use it, otherwise use course or site setting $switch = $this->get_pref('aggregationposition'); if ($switch == '') { $switch = grade_get_setting($this->courseid, 'aggregationposition', $CFG->grade_aggregationposition); } // Grab the grade_tree for this course $this->gtree = new grade_tree($this->courseid, true, $switch, $this->collapsed, $nooutcomes); $this->sortitemid = $sortitemid; // base url for sorting by first/last name $studentsperpage = $this->get_pref('studentsperpage'); $perpage = ''; $curpage = ''; if (!empty($studentsperpage)) { $perpage = '&perpage=' . $studentsperpage; $curpage = '&page=' . $this->page; } $this->baseurl = 'index.php?id=' . $this->courseid . $perpage . $curpage . '&'; $this->pbarurl = 'index.php?id=' . $this->courseid . $perpage . '&'; $this->setup_groups(); $this->setup_sortitemid(); }