当前位置: 首页>>代码示例>>PHP>>正文


PHP grade_item::get_name方法代码示例

本文整理汇总了PHP中grade_item::get_name方法的典型用法代码示例。如果您正苦于以下问题:PHP grade_item::get_name方法的具体用法?PHP grade_item::get_name怎么用?PHP grade_item::get_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在grade_item的用法示例。


在下文中一共展示了grade_item::get_name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: certificate_print_outcome

/**
 * Prepare to print an outcome.
 *
 * @param stdClass $course
 * @param int $moduleid
 * @return mixed
 */
function certificate_print_outcome($course, $id)
{
    global $USER, $DB;
    if ($grade_item = new grade_item(array('id' => $id))) {
        $outcomeinfo = new stdClass();
        $outcomeinfo->name = $grade_item->get_name();
        $outcome = new grade_grade(array('itemid' => $grade_item->id, 'userid' => $USER->id));
        $outcomeinfo->grade = grade_format_gradevalue($outcome->finalgrade, $grade_item, true, GRADE_DISPLAY_TYPE_REAL);
        return $outcomeinfo;
    }
    return false;
}
开发者ID:noisyjerm,项目名称:moodle-mod_certificate,代码行数:19,代码来源:lib.php

示例2: certificate_get_outcome

/**
 * Returns the outcome to display on the certificate
 *
 * @param stdClass $certificate
 * @param stdClass $course
 * @return string the outcome
 */
function certificate_get_outcome($certificate, $course)
{
    global $USER;
    if ($certificate->printoutcome > 0) {
        if ($grade_item = new grade_item(array('id' => $certificate->printoutcome))) {
            $outcomeinfo = new stdClass();
            $outcomeinfo->name = $grade_item->get_name();
            $outcome = new grade_grade(array('itemid' => $grade_item->id, 'userid' => $USER->id));
            $outcomeinfo->grade = grade_format_gradevalue($outcome->finalgrade, $grade_item, true, GRADE_DISPLAY_TYPE_REAL);
            return $outcomeinfo->name . ': ' . $outcomeinfo->grade;
        }
    }
    return '';
}
开发者ID:ccle,项目名称:moodle-mod_certificate,代码行数:21,代码来源:locallib.php

示例3: get_outcome

 /**
  * Returns the outcome to display on the certificate
  * 
  * @return string the outcome
  */
 protected function get_outcome($userid)
 {
     global $USER, $DB;
     if (empty($userid)) {
         $userid = $USER->id;
     }
     if ($this->get_instance()->outcome > 0) {
         if ($grade_item = new grade_item(array('id' => $this->get_instance()->outcome))) {
             $outcomeinfo = new stdClass();
             $outcomeinfo->name = $grade_item->get_name();
             $outcome = new grade_grade(array('itemid' => $grade_item->id, 'userid' => $userid));
             $outcomeinfo->grade = grade_format_gradevalue($outcome->finalgrade, $grade_item, true, GRADE_DISPLAY_TYPE_REAL);
             return $outcomeinfo->name . ': ' . $outcomeinfo->grade;
         }
     }
     return '';
 }
开发者ID:seducto,项目名称:moodle-mod_simplecertificate,代码行数:22,代码来源:locallib.php

示例4: foreach

 }
 $sitewide_html = '<td class="cell c2" rowspan="' . $rowspan . '">' . $sitewide . "</td>\n";
 $outcomedata['outcome']->sum = 0;
 $scale = new grade_scale(array('id' => $outcomedata['outcome']->scaleid), false);
 $print_tr = false;
 $items_html = '';
 if (!empty($outcomedata['items'])) {
     foreach ($outcomedata['items'] as $itemid => $item) {
         if ($print_tr) {
             $row++;
             $items_html .= "<tr class=\"r{$row}\">\n";
         }
         $grade_item = new grade_item($item, false);
         if ($item->itemtype == 'mod') {
             $cm = get_coursemodule_from_instance($item->itemmodule, $item->iteminstance, $item->courseid);
             $itemname = '<a href="' . $CFG->wwwroot . '/mod/' . $item->itemmodule . '/view.php?id=' . $cm->id . '">' . $grade_item->get_name() . '</a>';
         } else {
             $itemname = $grade_item->get_name();
         }
         $outcomedata['outcome']->sum += $item->avg;
         $gradehtml = $scale->get_nearest_item($item->avg);
         $items_html .= "<td class=\"cell c3\">{$itemname}</td>" . "<td class=\"cell c4\">{$gradehtml} ({$item->avg})</td>" . "<td class=\"cell c5\">{$item->count}</td></tr>\n";
         $print_tr = true;
     }
 } else {
     $items_html .= "<td class=\"cell c3\"> - </td><td class=\"cell c4\"> - </td><td class=\"cell c5\"> 0 </td></tr>\n";
 }
 // Calculate outcome average
 if (is_array($outcomedata['items'])) {
     $count = count($outcomedata['items']);
     if ($count > 0) {
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:31,代码来源:index.php

示例5: foreach

 $outcomedata['outcome']->sum = 0;
 $scale = new grade_scale(array('id' => $outcomedata['outcome']->scaleid), false);
 $print_tr = false;
 $items_html = '';
 if (!empty($outcomedata['items'])) {
     foreach ($outcomedata['items'] as $itemid => $item) {
         if ($print_tr) {
             $row++;
             $items_html .= "<tr class=\"r{$row}\">\n";
         }
         $grade_item = new grade_item($item, false);
         if ($item->itemtype == 'mod') {
             $cm = get_coursemodule_from_instance($item->itemmodule, $item->iteminstance, $item->courseid);
             $itemname = '<a href="' . $CFG->wwwroot . '/mod/' . $item->itemmodule . '/view.php?id=' . $cm->id . '">' . format_string($cm->name, true, $cm->course) . '</a>';
         } else {
             $itemname = $grade_item->get_name();
         }
         $outcomedata['outcome']->sum += $item->avg;
         $gradehtml = $scale->get_nearest_item($item->avg);
         $items_html .= "<td class=\"cell c3\">{$itemname}</td>" . "<td class=\"cell c4\">{$gradehtml} ({$item->avg})</td>" . "<td class=\"cell c5\">{$item->count}</td></tr>\n";
         $print_tr = true;
     }
 } else {
     $items_html .= "<td class=\"cell c3\"> - </td><td class=\"cell c4\"> - </td><td class=\"cell c5\"> 0 </td></tr>\n";
 }
 // Calculate outcome average
 if (is_array($outcomedata['items'])) {
     $count = count($outcomedata['items']);
     if ($count > 0) {
         $avg = $outcomedata['outcome']->sum / $count;
     } else {
开发者ID:JP-Git,项目名称:moodle,代码行数:31,代码来源:index.php


注:本文中的grade_item::get_name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。