本文整理汇总了PHP中grade_report类的典型用法代码示例。如果您正苦于以下问题:PHP grade_report类的具体用法?PHP grade_report怎么用?PHP grade_report使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了grade_report类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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
*/
public function __construct($userid, $gpr, $context)
{
global $CFG, $COURSE, $DB;
parent::__construct($COURSE->id, $gpr, $context);
// Get the user (for full name).
$this->user = $DB->get_record('user', array('id' => $userid));
// Load the user's courses.
$this->courses = enrol_get_users_courses($this->user->id, false, 'id, shortname, showgrades');
$this->showrank = array();
$this->showrank['any'] = false;
$this->showtotalsifcontainhidden = array();
if ($this->courses) {
foreach ($this->courses as $course) {
$this->showrank[$course->id] = grade_get_setting($course->id, 'report_overview_showrank', !empty($CFG->grade_report_overview_showrank));
if ($this->showrank[$course->id]) {
$this->showrank['any'] = true;
}
$this->showtotalsifcontainhidden[$course->id] = grade_get_setting($course->id, 'report_overview_showtotalsifcontainhidden', $CFG->grade_report_overview_showtotalsifcontainhidden);
}
}
// 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();
}
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:31,代码来源:lib.php
示例2: grade_report_grader
/**
* 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();
}
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:42,代码来源:lib.php
示例3: __construct
/**
* 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
*/
public function __construct($courseid, $gpr, $context, $userid)
{
global $CFG, $DB;
parent::__construct($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->showtotalsifcontainhidden = grade_get_setting($this->courseid, 'report_user_showtotalsifcontainhidden', $CFG->grade_report_user_showtotalsifcontainhidden);
$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, null, !$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 = $DB->get_record('user', array('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();
}
开发者ID:vuchannguyen,项目名称:web,代码行数:36,代码来源:lib.php
示例4: grade_report_overview
/**
* 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();
}
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:17,代码来源:lib.php
示例5: __construct
/**
* 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
*/
public function __construct($userid, $gpr, $context)
{
global $CFG, $COURSE, $DB;
parent::__construct($COURSE->id, $gpr, $context);
$this->showrank = grade_get_setting($this->courseid, 'report_overview_showrank', !empty($CFG->grade_report_overview_showrank));
// get the user (for full name)
$this->user = $DB->get_record('user', array('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();
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:18,代码来源:lib.php
示例6: grade_report_overview
/**
* 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();
}
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:19,代码来源:lib.php
示例7: grade_report_user
/**
* 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();
}
开发者ID:r007,项目名称:PMoodle,代码行数:24,代码来源:lib.php
示例8: grade_report_user
/**
* 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();
}
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:24,代码来源:lib.php
示例9: __construct
/**
* 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
*/
public function __construct($userid, $gpr, $context)
{
global $CFG, $COURSE, $DB;
parent::__construct($COURSE->id, $gpr, $context);
// Get the user (for full name).
$this->user = $DB->get_record('user', array('id' => $userid));
// Load the user's courses.
$this->courses = enrol_get_users_courses($this->user->id, false, 'id, shortname, showgrades');
$this->showrank = array();
$this->showrank['any'] = false;
$this->showtotalsifcontainhidden = array();
$this->studentcourseids = array();
$this->teachercourses = array();
$roleids = explode(',', get_config('moodle', 'gradebookroles'));
if ($this->courses) {
foreach ($this->courses as $course) {
$this->showrank[$course->id] = grade_get_setting($course->id, 'report_overview_showrank', !empty($CFG->grade_report_overview_showrank));
if ($this->showrank[$course->id]) {
$this->showrank['any'] = true;
}
$this->showtotalsifcontainhidden[$course->id] = grade_get_setting($course->id, 'report_overview_showtotalsifcontainhidden', $CFG->grade_report_overview_showtotalsifcontainhidden);
$coursecontext = context_course::instance($course->id);
foreach ($roleids as $roleid) {
if (user_has_role_assignment($userid, $roleid, $coursecontext->id)) {
$this->studentcourseids[$course->id] = $course->id;
// We only need to check if one of the roleids has been assigned.
break;
}
}
if (has_capability('moodle/grade:viewall', $coursecontext, $userid)) {
$this->teachercourses[$course->id] = $course;
}
}
}
// 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();
}
开发者ID:grug,项目名称:moodle,代码行数:45,代码来源:lib.php
示例10: grade_report_grader
/**
* 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();
}
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:46,代码来源:lib.php
示例11: __construct
/**
* 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
*/
public function __construct($courseid, $gpr, $context, $page = null, $sortitemid = null)
{
global $CFG;
parent::__construct($courseid, $gpr, $context, $page);
$this->canviewhidden = has_capability('moodle/grade:viewhidden', context_course::instance($this->course->id));
// load collapsed settings for this report
$this->collapsed = static::get_collapsed_preferences($this->course->id);
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
$this->baseurl = new moodle_url('index.php', array('id' => $this->courseid));
$studentsperpage = $this->get_students_per_page();
if (!empty($this->page) && !empty($studentsperpage)) {
$this->baseurl->params(array('perpage' => $studentsperpage, 'page' => $this->page));
}
$this->pbarurl = new moodle_url('/grade/report/grader/index.php', array('id' => $this->courseid));
$this->setup_groups();
$this->setup_users();
$this->setup_sortitemid();
$this->overridecat = (bool) get_config('moodle', 'grade_overridecat');
}
开发者ID:Gavinthisisit,项目名称:Moodle,代码行数:40,代码来源:lib.php
示例12: get_pref
/**
* Given the name of a user preference (without grade_report_ prefix), locally saves then returns
* the value of that preference. If the preference has already been fetched before,
* the saved value is returned. If the preference is not set at the User level, the $CFG equivalent
* is given (site default).
* @static (Can be called statically, but then doesn't benefit from caching)
* @param string $pref The name of the preference (do not include the grade_report_ prefix)
* @param int $objectid An optional itemid or categoryid to check for a more fine-grained preference
* @return mixed The value of the preference
*/
public function get_pref($pref, $objectid = null)
{
global $CFG;
$fullprefname = 'grade_report_' . $pref;
$shortprefname = 'grade_' . $pref;
$retval = null;
if (!isset($this) or get_class($this) != 'grade_report') {
if (!empty($objectid)) {
$retval = get_user_preferences($fullprefname . $objectid, grade_report::get_pref($pref));
} elseif (isset($CFG->{$fullprefname})) {
$retval = get_user_preferences($fullprefname, $CFG->{$fullprefname});
} elseif (isset($CFG->{$shortprefname})) {
$retval = get_user_preferences($fullprefname, $CFG->{$shortprefname});
} else {
$retval = null;
}
} else {
if (empty($this->prefs[$pref . $objectid])) {
if (!empty($objectid)) {
$retval = get_user_preferences($fullprefname . $objectid);
if (empty($retval)) {
// No item pref found, we are returning the global preference
$retval = $this->get_pref($pref);
$objectid = null;
}
} else {
$retval = get_user_preferences($fullprefname, $CFG->{$fullprefname});
}
$this->prefs[$pref . $objectid] = $retval;
} else {
$retval = $this->prefs[$pref . $objectid];
}
}
return $retval;
}
开发者ID:tyleung,项目名称:CMPUT401MoodleExams,代码行数:45,代码来源:lib.php
示例13: __construct
/**
* Constructor. Initialises grade_tree, sets up group, baseurl
* and pbarurl.
* @param int $courseid the coures id for the report
* @param object $gpr grade plugin tracking object
* @context string $context
*/
public function __construct($courseid, $gpr, $context, $visid = null)
{
global $CFG;
parent::__construct($courseid, $gpr, $context, null);
$this->canviewhidden = has_capability('moodle/grade:viewhidden', get_context_instance(CONTEXT_COURSE, $this->course->id));
/// Set up urls
$this->baseurl = 'index.php?id=' . $this->courseid;
$this->pbarurl = 'index.php?id=' . $this->courseid;
/// Set the position of the aggregation categorie based on pref
$switch = $this->get_pref('visual', 'aggregationposition');
if ($switch == '' && isset($CFG->grade_aggregationposition)) {
$switch = grade_get_setting($this->courseid, 'aggregationposition', $CFG->grade_aggregationposition);
}
/// Build grade tree
$this->gtree = new grade_tree($this->courseid, false, $switch);
$this->load_visualizations();
if (!is_null($visid) && !empty($visid) && array_key_exists($visid, grade_report_visual::$visualizations)) {
$this->visid = $visid;
} else {
$keys = array_keys(grade_report_visual::$visualizations);
$this->visid = $keys[0];
}
$this->set_up_flashvars();
/// Set up Groups
if ($this->visid && grade_report_visual::get_visualization($this->visid)->usegroups) {
$this->setup_groups();
}
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:35,代码来源:lib.php
示例14: grade_regrade_final_grades
$returnurl = $gpr->get_return_url(null);
//first make sure we have proper final grades - we need it for locking changes
grade_regrade_final_grades($courseid);
// get the grading tree object
// note: total must be first for moving to work correctly, if you want it last moving code must be rewritten!
$gtree = new grade_tree($courseid, false, false);
if (empty($eid)) {
$element = null;
$object = null;
} else {
if (!($element = $gtree->locate_element($eid))) {
error('Incorrect element id!', $returnurl);
}
$object = $element['object'];
}
$switch = grade_report::get_pref('aggregationposition');
$strgrades = get_string('grades');
$strgraderreport = get_string('graderreport', 'grades');
$strcategoriesedit = get_string('categoriesedit', 'grades');
$strcategoriesanditems = get_string('categoriesanditems', 'grades');
$navigation = grade_build_nav(__FILE__, $strcategoriesanditems, array('courseid' => $courseid));
$moving = false;
switch ($action) {
case 'delete':
if ($eid) {
$confirm = optional_param('confirm', 0, PARAM_BOOL);
if ($confirm and confirm_sesskey()) {
$object->delete('grade/report/grader/category');
redirect($returnurl);
} else {
print_header_simple($strgrades . ': ' . $strgraderreport, ': ' . $strcategoriesedit, $navigation, '', '', true, '', navmenu($course));
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:31,代码来源:index.php
示例15: error
}
if (!isset($data->aggregateonlygraded)) {
$data->aggregateonlygraded = 0;
}
if (!isset($data->aggregateoutcomes)) {
$data->aggregateoutcomes = 0;
}
grade_category::set_properties($grade_category, $data);
if (empty($grade_category->id)) {
$grade_category->insert();
} else {
$grade_category->update();
}
// Handle user preferences
if (isset($data->pref_aggregationview)) {
if (!grade_report::set_pref('aggregationview', $data->pref_aggregationview, $grade_category->id)) {
error("Could not set preference aggregationview to {$value} for this grade category");
}
}
// set parent if needed
if (isset($data->parentcategory)) {
$grade_category->set_parent($data->parentcategory, 'gradebook');
}
// update agg coef if needed
if (isset($data->aggregationcoef)) {
$data->aggregationcoef = unformat_float($data->aggregationcoef);
$grade_item = $grade_category->load_grade_item();
$grade_item->aggregationcoef = $data->aggregationcoef;
$grade_item->update();
}
redirect($returnurl);
开发者ID:r007,项目名称:PMoodle,代码行数:31,代码来源:category.php
示例16: __construct
/**
* 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
* @param boolean $hidereport Hide all report only show assessments
*/
public function __construct($courseid, $gpr, $context, $userid, $hidereport)
{
global $DB, $CFG;
parent::__construct($courseid, $gpr, $context);
if (isset($hidereport)) {
$this->hidereport = $hidereport;
}
$this->showhiddenactivity = grade_get_setting($this->courseid, 'report_marksheet_showhiddenactivity', $CFG->grade_report_marksheet_showhiddenactivity);
$this->showrank = grade_get_setting($this->courseid, 'report_marksheet_showrank', $CFG->grade_report_marksheet_showrank);
$this->showpercentage = grade_get_setting($this->courseid, 'report_marksheet_showpercentage', $CFG->grade_report_marksheet_showpercentage);
$this->showhiddenitems = grade_get_setting($this->courseid, 'report_marksheet_showhiddenitems', $CFG->grade_report_marksheet_showhiddenitems);
$this->showtotalsifcontainhidden = array($this->courseid => grade_get_setting($this->courseid, 'report_marksheet_showtotalsifcontainhidden', $CFG->grade_report_marksheet_showtotalsifcontainhidden));
$this->showgrade = grade_get_setting($this->courseid, 'report_marksheet_showgrade', !empty($CFG->grade_report_marksheet_showgrade));
$this->showrange = grade_get_setting($this->courseid, 'report_marksheet_showrange', !empty($CFG->grade_report_marksheet_showrange));
$this->showfeedback = grade_get_setting($this->courseid, 'report_marksheet_showfeedback', !empty($CFG->grade_report_marksheet_showfeedback));
$this->showweight = grade_get_setting($this->courseid, 'report_marksheet_showweight', !empty($CFG->grade_report_marksheet_showweight));
$this->showlettergrade = grade_get_setting($this->courseid, 'report_marksheet_showlettergrade', !empty($CFG->grade_report_marksheet_showlettergrade));
$this->showaverage = grade_get_setting($this->courseid, 'report_marksheet_showaverage', !empty($CFG->grade_report_marksheet_showaverage));
$this->showtimeupdate = grade_get_setting($this->courseid, 'report_marksheet_showtimeupdate', !empty($CFG->grade_report_marksheet_showtimeupdate));
$this->showstartdate = grade_get_setting($this->courseid, 'report_marksheet_showstartdate', !empty($CFG->grade_report_marksheet_showstartdate));
$this->grade_category_modids = array();
$this->grade_category_start_dates = array();
// The default grade decimals is 2
$defaultdecimals = 2;
date_default_timezone_set('Australia/Victoria');
if (property_exists($CFG, 'grade_decimalpoints')) {
$defaultdecimals = $CFG->grade_decimalpoints;
}
$this->decimals = grade_get_setting($this->courseid, 'decimalpoints', $defaultdecimals);
// The default range decimals is 0
$defaultrangedecimals = 0;
if (property_exists($CFG, 'grade_report_marksheet_rangedecimals')) {
$defaultrangedecimals = $CFG->grade_report_marksheet_rangedecimals;
}
$this->rangedecimals = grade_get_setting($this->courseid, 'report_marksheet_rangedecimals', $defaultrangedecimals);
$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, null, !$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', context_course::instance($this->courseid));
// get the user (for full name)
$this->user = $DB->get_record('user', array('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();
//optionally calculate grade item averages
$this->calculate_averages();
// //Set Marksheet Categoryid
// $cat = grade_category::fetch(array('courseid'=>$this->courseid,'fullname'=>'Marksheet'));
// if (isset($cat)) {
// $this->marksheet_category_id = $cat->id;
// }else
// {
// $this->marksheet_category_id = nil;
// }
}
开发者ID:abhiahirwar,项目名称:moodle_plugin,代码行数:74,代码来源:lib.php
示例17: __construct
/**
* 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
*/
public function __construct($courseid, $gpr, $context, $page = null, $sortitemid = null)
{
global $CFG;
parent::__construct($courseid, $gpr, $context, $page);
//Basado en el constructor de la clase grade_report_grader
// Grab the grade_tree for this course
$this->gtree = new grade_tree($this->courseid, false, false);
$this->add_activities_to_gtree();
$this->grade_viewer = new grade_expert_db_block();
$this->calculator = new calculator_average();
$this->sortitemid = $sortitemid;
// base url for sorting by first/last name
$this->baseurl = new moodle_url('index.php', array('id' => $this->courseid));
$this->studentsperpage = $this->get_pref('studentsperpage');
$studentsperpage = $this->studentsperpage;
if (!empty($studentsperpage)) {
$this->baseurl->params(array('perpage' => $studentsperpage, 'page' => $this->page));
}
$this->pbarurl = new moodle_url('/blocks/evalcomix/assessment/index.php', array('id' => $this->courseid, 'perpage' => $studentsperpage));
$this->setup_groups();
$this->setup_sortitemid();
$this->canviewhidden = has_capability('moodle/grade:viewhidden', context_course::instance($this->course->id));
}
开发者ID:srpaedagogus,项目名称:aulavirtual,代码行数:31,代码来源:lib.php
示例18: __construct
/**
* 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
* @param bool $viewasuser Set this to true when the current user is a mentor/parent of the targetted user.
*/
public function __construct($courseid, $gpr, $context, $userid, $viewasuser = null)
{
global $DB, $CFG;
parent::__construct($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->showtotalsifcontainhidden = array($this->courseid => grade_get_setting($this->courseid, 'report_user_showtotalsifcontainhidden', $CFG->grade_report_user_showtotalsifcontainhidden));
$this->showgrade = grade_get_setting($this->courseid, 'report_user_showgrade', !empty($CFG->grade_report_user_showgrade));
$this->showrange = grade_get_setting($this->courseid, 'report_user_showrange', !empty($CFG->grade_report_user_showrange));
$this->showfeedback = grade_get_setting($this->courseid, 'report_user_showfeedback', !empty($CFG->grade_report_user_showfeedback));
$this->showweight = grade_get_setting($this->courseid, 'report_user_showweight', !empty($CFG->grade_report_user_showweight));
$this->showlettergrade = grade_get_setting($this->courseid, 'report_user_showlettergrade', !empty($CFG->grade_report_user_showlettergrade));
$this->showaverage = grade_get_setting($this->courseid, 'report_user_showaverage', !empty($CFG->grade_report_user_showaverage));
$this->viewasuser = $viewasuser;
// The default grade decimals is 2
$defaultdecimals = 2;
if (property_exists($CFG, 'grade_decimalpoints')) {
$defaultdecimals = $CFG->grade_decimalpoints;
}
$this->decimals = grade_get_setting($this->courseid, 'decimalpoints', $defaultdecimals);
// The default range decimals is 0
$defaultrangedecimals = 0;
if (property_exists($CFG, 'grade_report_user_rangedecimals')) {
$defaultrangedecimals = $CFG->grade_report_user_rangedecimals;
}
$this->rangedecimals = grade_get_setting($this->courseid, 'report_user_rangedecimals', $defaultrangedecimals);
$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, null, !$CFG->enableoutcomes);
// Get the user (for full name).
$this->user = $DB->get_record('user', array('id' => $userid));
// What user are we viewing this as?
$coursecontext = context_course::instance($this->courseid);
if ($viewasuser) {
$this->modinfo = new course_modinfo($this->course, $this->user->id);
$this->canviewhidden = has_capability('moodle/grade:viewhidden', $coursecontext, $this->user->id);
} else {
$this->modinfo = $this->gtree->modinfo;
$this->canviewhidden = has_capability('moodle/grade:viewhidden', $coursecontext);
}
// 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();
// 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();
//optionally calculate grade item averages
$this->calculate_averages();
}
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:66,代码来源:lib.php
示例19: __construct
/**
* 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
*/
public function __construct($courseid, $gpr, $context, $page = null, $sortitemid = null)
{
global $CFG;
parent::__construct($courseid, $gpr, $context, $page);
$this->canviewhidden = has_capability('moodle/grade:viewhidden', get_context_instance(CONTEXT_COURSE, $this->course->id));
// 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
$this->baseurl = new moodle_url('index.php', array('id' => $this->courseid));
if (!empty($this->page)) {
$this->baseurl->params(array('page' => $this->page));
}
$this->pbarurl = new moodle_url('/grade/report/grader/index.php', array('id' => $this->courseid));
$this->setup_groups();
$this->setup_sortitemid();
}
开发者ID:robadobdob,项目名称:moodle,代码行数:41,代码来源:lib.php
示例20: __construct
/**
* Constructor for this report. Creates the appropriate screen class based on itemtype.
*
* @param int $courseid The course id.
* @param object $gpr grade plugin return tracking object
* @param context_course $context
* @param string $itemtype Should be user, select or grade
* @param int $itemid The id of the user or grade item
* @param int $groupid (optional) The current groupid.
*/
public
|
请发表评论