本文整理汇总了PHP中assign::display_grade方法的典型用法代码示例。如果您正苦于以下问题:PHP assign::display_grade方法的具体用法?PHP assign::display_grade怎么用?PHP assign::display_grade使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assign
的用法示例。
在下文中一共展示了assign::display_grade方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
* Display a grade with scales etc.
*
* @param string $grade
* @param boolean $editable
* @param int $userid The user id of the user this grade belongs to
* @param int $modified Timestamp showing when the grade was last modified
* @return string The formatted grade
*/
function display_grade($grade, $editable, $userid, $modified) {
if ($this->is_downloading()) {
return $grade;
}
$o = $this->assignment->display_grade($grade, $editable, $userid, $modified);
return $o;
}
示例2: display_grade
/**
* Display a grade with scales etc.
*
* @param string $grade
* @param boolean $editable
* @param int $userid The user id of the user this grade belongs to
* @param int $modified Timestamp showing when the grade was last modified
* @return string The formatted grade
*/
public function display_grade($grade, $editable, $userid, $modified) {
if ($this->is_downloading()) {
if ($this->assignment->get_instance()->grade >= 0) {
if ($grade == -1 || $grade === null) {
return '';
}
return format_float($grade, 2);
} else {
// This is a custom scale.
$scale = $this->assignment->display_grade($grade, false);
if ($scale == '-') {
$scale = '';
}
return $scale;
}
}
return $this->assignment->display_grade($grade, $editable, $userid, $modified);
}