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


PHP assign::grading_disabled方法代码示例

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


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

示例1: col_grade

    /**
     * Format a column of data for display.
     *
     * @param stdClass $row
     * @return string
     */
    public function col_grade(stdClass $row) {
        $o = '';

        $link = '';
        $separator = $this->output->spacer(array(), true);
        $grade = '';
        $gradingdisabled = $this->assignment->grading_disabled($row->id);

        if (!$this->is_downloading() && $this->hasgrade) {
            $name = fullname($row);
            if ($this->assignment->is_blind_marking()) {
                $name = get_string('hiddenuser', 'assign') .
                        $this->assignment->get_uniqueid_for_user($row->userid);
            }
            $icon = $this->output->pix_icon('gradefeedback',
                                            get_string('gradeuser', 'assign', $name),
                                            'mod_assign');
            $urlparams = array('id' => $this->assignment->get_course_module()->id,
                               'rownum'=>$this->rownum,
                               'action'=>'grade');
            $url = new moodle_url('/mod/assign/view.php', $urlparams);
            $link = $this->output->action_link($url, $icon);
            $grade .= $link . $separator;
        }

        $grade .= $this->display_grade($row->grade,
                                       $this->quickgrading && !$gradingdisabled,
                                       $row->userid,
                                       $row->timemarked);

        return $grade;
    }
开发者ID:rwijaya,项目名称:moodle,代码行数:38,代码来源:gradingtable.php

示例2: fullname

 /**
  * Format a column of data for display
  *
  * @param stdClass $row
  * @return string
  */
 function col_grade(stdClass $row)
 {
     $o = '';
     $link = '';
     $separator = '';
     $grade = '';
     if (!$this->is_downloading()) {
         $name = fullname($row);
         $icon = $this->output->pix_icon('gradefeedback', get_string('gradeuser', 'assign', $name), 'mod_assign');
         $url = new moodle_url('/mod/assign/view.php', array('id' => $this->assignment->get_course_module()->id, 'rownum' => $this->rownum, 'action' => 'grade'));
         $link = $this->output->action_link($url, $icon);
         $separator = $this->output->spacer(array(), true);
     }
     $gradingdisabled = $this->assignment->grading_disabled($row->id);
     $grade = $this->display_grade($row->grade, $this->quickgrading && !$gradingdisabled, $row->userid, $row->timemarked);
     //return $grade . $separator . $link;
     return $link . $separator . $grade;
 }
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:24,代码来源:gradingtable.php

示例3: col_grade

 /**
  * Format a column of data for display.
  *
  * @param stdClass $row
  * @return string
  */
 public function col_grade(stdClass $row)
 {
     $o = '';
     $link = '';
     $separator = $this->output->spacer(array(), true);
     $grade = '';
     $gradingdisabled = $this->assignment->grading_disabled($row->id);
     if (!$this->is_downloading() && $this->hasgrade) {
         $urlparams = array('id' => $this->assignment->get_course_module()->id, 'rownum' => 0, 'action' => 'grader');
         if ($this->assignment->is_blind_marking()) {
             $urlparams['blindid'] = $this->assignment->get_uniqueid_for_user($row->userid);
         } else {
             $urlparams['userid'] = $row->userid;
         }
         $url = new moodle_url('/mod/assign/view.php', $urlparams);
         $link = '<a href="' . $url . '" class="btn btn-primary">' . get_string('grade') . '</a>';
         $grade .= $link . $separator;
     }
     $grade .= $this->display_grade($row->grade, $this->quickgrading && !$gradingdisabled, $row->userid, $row->timemarked);
     return $grade;
 }
开发者ID:IFPBMoodle,项目名称:moodle,代码行数:27,代码来源:gradingtable.php

示例4: grading_popup

 /**
  * Makes the grading interface for the pop up. Robbed from /mod/assign/locallib.php
  * line 1583ish - view_single_grade_page().
  *
  * @param array $params From $_GET
  * @param object $coursemodule The coursemodule object that the user has been authenticated
  * against
  * @param bool $data
  * @throws coding_exception
  * @global $PAGE
  * @global stdClass $CFG
  * @global moodle_database $DB
  * @global $OUTPUT
  * @global stdClass $USER
  * @return string
  */
 public function grading_popup($params, $coursemodule, $data = false)
 {
     global $PAGE, $CFG, $DB;
     $modulecontext = context_module::instance($coursemodule->id);
     $course = $DB->get_record('course', array('id' => $coursemodule->course));
     $coursecontext = context_course::instance($course->id);
     $assign = new assign($modulecontext, $coursemodule, $course);
     /* @var mod_assign_renderer $renderer */
     $renderer = $PAGE->get_renderer('mod_assign');
     $output = '';
     // Include grade form.
     require_once $CFG->dirroot . '/mod/assign/gradeform.php';
     // Need submit permission to submit an assignment.
     require_capability('mod/assign:grade', $modulecontext);
     /* Pinched from private method assign::get_grading_userid_list() */
     $filter = get_user_preferences('assign_filter', '');
     $table = new assign_grading_table($assign, 0, $filter, 0, false);
     $useridlist = $table->get_column_data('userid');
     $userid = $params['userid'];
     $rownum = 0;
     foreach ($useridlist as $key => $useridinlist) {
         if ($useridinlist == $userid) {
             $rownum = $key;
             reset($useridlist);
             // Just in case.
             break;
         }
     }
     $last = false;
     if ($rownum == count($useridlist) - 1) {
         $last = true;
     }
     $user = $DB->get_record('user', array('id' => $userid));
     if ($user) {
         $output .= $renderer->render(new assign_user_summary($user, $course->id, has_capability('moodle/site:viewfullnames', $coursecontext)));
     }
     $submission = $DB->get_record('assign_submission', array('assignment' => $assign->get_instance()->id, 'userid' => $userid));
     // Get the current grade. Pinched from assign::get_user_grade().
     $grade = $DB->get_record('assign_grades', array('assignment' => $assign->get_instance()->id, 'userid' => $userid));
     // Pinched from assign::is_graded().
     $isgraded = !empty($grade) && $grade->grade !== null && $grade->grade >= 0;
     if ($assign->can_view_submission($userid)) {
         $gradelocked = $grade && $grade->locked || $assign->grading_disabled($userid);
         $widget = new assign_submission_status($assign->get_instance()->allowsubmissionsfromdate, $assign->get_instance()->alwaysshowdescription, $submission, $assign->is_any_submission_plugin_enabled(), $gradelocked, $isgraded, $assign->get_instance()->duedate, $assign->get_submission_plugins(), $assign->get_return_action(), $assign->get_return_params(), $assign->get_course_module()->id, assign_submission_status::GRADER_VIEW, false, false);
         $output .= $renderer->render($widget);
     }
     if ($grade) {
         $data = new stdClass();
         if ($grade->grade !== null && $grade->grade >= 0) {
             $data->grade = format_float($grade->grade, 2);
         }
     } else {
         $data = new stdClass();
         $data->grade = '';
     }
     // Now show the grading form.
     $customdata = array('useridlist' => $useridlist, 'rownum' => $rownum, 'last' => $last);
     $mform = new mod_assign_grade_form(block_ajax_marking_form_url($params), array($assign, $data, $customdata), 'post', '', array('class' => 'gradeform'));
     $output .= $renderer->render(new assign_form('gradingform', $mform));
     $assign->add_to_log('view grading form', get_string('viewgradingformforstudent', 'assign', array('id' => $user->id, 'fullname' => fullname($user))));
     return $output;
 }
开发者ID:nadavkav,项目名称:moodle-block_ajax_marking,代码行数:78,代码来源:block_ajax_marking_assign.class.php


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