本文整理汇总了PHP中grade_report::grade_report方法的典型用法代码示例。如果您正苦于以下问题:PHP grade_report::grade_report方法的具体用法?PHP grade_report::grade_report怎么用?PHP grade_report::grade_report使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类grade_report
的用法示例。
在下文中一共展示了grade_report::grade_report方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* 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();
}
示例2: unserialize
/**
* 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();
}
示例3:
/**
* 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();
}
示例4:
/**
* 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();
}
示例5:
/**
* 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();
}
示例6: unserialize
/**
* 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();
}