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


PHP assign::is_blind_marking方法代码示例

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


在下文中一共展示了assign::is_blind_marking方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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:reconnectmedia,项目名称:moodle,代码行数:27,代码来源:gradingtable.php

示例3: __construct


//.........这里部分代码省略.........
             // Only show users allocated to this marker.
             $where .= ' AND uf.allocatedmarker = :markerid';
             $params['markerid'] = $USER->id;
         }
     }
     if ($this->assignment->get_instance()->markingworkflow) {
         $workflowstates = $this->assignment->get_marking_workflow_states_for_current_user();
         if (!empty($workflowstates)) {
             $workflowfilter = get_user_preferences('assign_workflowfilter', '');
             if ($workflowfilter == ASSIGN_MARKING_WORKFLOW_STATE_NOTMARKED) {
                 $where .= ' AND (uf.workflowstate = :workflowstate OR uf.workflowstate IS NULL OR ' . $DB->sql_isempty('assign_user_flags', 'workflowstate', true, true) . ')';
                 $params['workflowstate'] = $workflowfilter;
             } else {
                 if (array_key_exists($workflowfilter, $workflowstates)) {
                     $where .= ' AND uf.workflowstate = :workflowstate';
                     $params['workflowstate'] = $workflowfilter;
                 }
             }
         }
     }
     $this->set_sql($fields, $from, $where, $params);
     if ($downloadfilename) {
         $this->is_downloading('csv', $downloadfilename);
     }
     $columns = array();
     $headers = array();
     // Select.
     if (!$this->is_downloading() && $this->hasgrade) {
         $columns[] = 'select';
         $headers[] = get_string('select') . '<div class="selectall"><label class="accesshide" for="selectall">' . get_string('selectall') . '</label>
                 <input type="checkbox" id="selectall" name="selectall" title="' . get_string('selectall') . '"/></div>';
     }
     // User picture.
     if ($this->hasviewblind || !$this->assignment->is_blind_marking()) {
         if (!$this->is_downloading()) {
             $columns[] = 'picture';
             $headers[] = get_string('pictureofuser');
         } else {
             $columns[] = 'recordid';
             $headers[] = get_string('recordid', 'assign');
         }
         // Fullname.
         $columns[] = 'fullname';
         $headers[] = get_string('fullname');
         foreach ($extrauserfields as $extrafield) {
             $columns[] = $extrafield;
             $headers[] = get_user_field_name($extrafield);
         }
     } else {
         // Record ID.
         $columns[] = 'recordid';
         $headers[] = get_string('recordid', 'assign');
     }
     // Submission status.
     $columns[] = 'status';
     $headers[] = get_string('status', 'assign');
     // Team submission columns.
     if ($assignment->get_instance()->teamsubmission) {
         $columns[] = 'team';
         $headers[] = get_string('submissionteam', 'assign');
     }
     // Allocated marker.
     if ($this->assignment->get_instance()->markingworkflow && $this->assignment->get_instance()->markingallocation && has_capability('mod/assign:manageallocations', $this->assignment->get_context())) {
         // Add a column for the allocated marker.
         $columns[] = 'allocatedmarker';
         $headers[] = get_string('marker', 'assign');
开发者ID:antoniorodrigues,项目名称:redes-digitais,代码行数:67,代码来源:gradingtable.php

示例4: col_userid

 /**
  * Format a column of data for display.
  *
  * @param stdClass $row
  * @return string
  */
 public function col_userid(stdClass $row)
 {
     global $USER;
     $edit = '';
     $actions = array();
     $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);
     $noimage = null;
     if (!$row->grade) {
         $description = get_string('grade');
     } else {
         $description = get_string('updategrade', 'assign');
     }
     $actions['grade'] = new action_menu_link_secondary($url, $noimage, $description);
     // Everything we need is in the row.
     $submission = $row;
     $flags = $row;
     if ($this->assignment->get_instance()->teamsubmission) {
         // Use the cache for this.
         $submission = false;
         $group = false;
         $this->get_group_and_submission($row->id, $group, $submission, -1);
     }
     $submissionsopen = $this->assignment->submissions_open($row->id, true, $submission, $flags, $this->gradinginfo);
     $caneditsubmission = $this->assignment->can_edit_submission($row->id, $USER->id);
     // Hide for offline assignments.
     if ($this->assignment->is_any_submission_plugin_enabled()) {
         if (!$row->status || $row->status == ASSIGN_SUBMISSION_STATUS_DRAFT || !$this->assignment->get_instance()->submissiondrafts) {
             if (!$row->locked) {
                 $urlparams = array('id' => $this->assignment->get_course_module()->id, 'userid' => $row->id, 'action' => 'lock', 'sesskey' => sesskey(), 'page' => $this->currpage);
                 $url = new moodle_url('/mod/assign/view.php', $urlparams);
                 $description = get_string('preventsubmissionsshort', 'assign');
                 $actions['lock'] = new action_menu_link_secondary($url, $noimage, $description);
             } else {
                 $urlparams = array('id' => $this->assignment->get_course_module()->id, 'userid' => $row->id, 'action' => 'unlock', 'sesskey' => sesskey(), 'page' => $this->currpage);
                 $url = new moodle_url('/mod/assign/view.php', $urlparams);
                 $description = get_string('allowsubmissionsshort', 'assign');
                 $actions['unlock'] = new action_menu_link_secondary($url, $noimage, $description);
             }
         }
         if ($submissionsopen && $USER->id != $row->id && $caneditsubmission) {
             $urlparams = array('id' => $this->assignment->get_course_module()->id, 'userid' => $row->id, 'action' => 'editsubmission', 'sesskey' => sesskey(), 'page' => $this->currpage);
             $url = new moodle_url('/mod/assign/view.php', $urlparams);
             $description = get_string('editsubmission', 'assign');
             $actions['editsubmission'] = new action_menu_link_secondary($url, $noimage, $description);
         }
     }
     if (($this->assignment->get_instance()->duedate || $this->assignment->get_instance()->cutoffdate) && $this->hasgrantextension) {
         $urlparams = array('id' => $this->assignment->get_course_module()->id, 'userid' => $row->id, 'action' => 'grantextension', 'sesskey' => sesskey(), 'page' => $this->currpage);
         $url = new moodle_url('/mod/assign/view.php', $urlparams);
         $description = get_string('grantextension', 'assign');
         $actions['grantextension'] = new action_menu_link_secondary($url, $noimage, $description);
     }
     if ($row->status == ASSIGN_SUBMISSION_STATUS_SUBMITTED && $this->assignment->get_instance()->submissiondrafts) {
         $urlparams = array('id' => $this->assignment->get_course_module()->id, 'userid' => $row->id, 'action' => 'reverttodraft', 'sesskey' => sesskey(), 'page' => $this->currpage);
         $url = new moodle_url('/mod/assign/view.php', $urlparams);
         $description = get_string('reverttodraftshort', 'assign');
         $actions['reverttodraft'] = new action_menu_link_secondary($url, $noimage, $description);
     }
     if ($row->status == ASSIGN_SUBMISSION_STATUS_DRAFT && $this->assignment->get_instance()->submissiondrafts && $caneditsubmission && $submissionsopen && $row->id != $USER->id) {
         $urlparams = array('id' => $this->assignment->get_course_module()->id, 'userid' => $row->id, 'action' => 'submitotherforgrading', 'sesskey' => sesskey(), 'page' => $this->currpage);
         $url = new moodle_url('/mod/assign/view.php', $urlparams);
         $description = get_string('submitforgrading', 'assign');
         $actions['submitforgrading'] = new action_menu_link_secondary($url, $noimage, $description);
     }
     $ismanual = $this->assignment->get_instance()->attemptreopenmethod == ASSIGN_ATTEMPT_REOPEN_METHOD_MANUAL;
     $hassubmission = !empty($row->status);
     $notreopened = $hassubmission && $row->status != ASSIGN_SUBMISSION_STATUS_REOPENED;
     $isunlimited = $this->assignment->get_instance()->maxattempts == ASSIGN_UNLIMITED_ATTEMPTS;
     $hasattempts = $isunlimited || $row->attemptnumber < $this->assignment->get_instance()->maxattempts - 1;
     if ($ismanual && $hassubmission && $notreopened && $hasattempts) {
         $urlparams = array('id' => $this->assignment->get_course_module()->id, 'userid' => $row->id, 'action' => 'addattempt', 'sesskey' => sesskey(), 'page' => $this->currpage);
         $url = new moodle_url('/mod/assign/view.php', $urlparams);
         $description = get_string('addattempt', 'assign');
         $actions['addattempt'] = new action_menu_link_secondary($url, $noimage, $description);
     }
     $menu = new action_menu();
     $menu->set_owner_selector('.gradingtable-actionmenu');
     $menu->set_alignment(action_menu::TL, action_menu::BL);
     $menu->set_constraint('.gradingtable > .no-overflow');
     $menu->set_menu_trigger(get_string('edit'));
     foreach ($actions as $action) {
         $menu->add($action);
     }
     // Prioritise the menu ahead of all other actions.
     $menu->prioritise = true;
     $edit .= $this->output->render($menu);
     return $edit;
 }
开发者ID:IFPBMoodle,项目名称:moodle,代码行数:100,代码来源:gradingtable.php

示例5: assign_print_recent_activity

/**
 * Print recent activity from all assignments in a given course
 *
 * This is used by the recent activity block
 * @param mixed $course the course to print activity for
 * @param bool $viewfullnames boolean to determine whether to show full names or not
 * @param int $timestart the time the rendering started
 * @return bool true if activity was printed, false otherwise.
 */
function assign_print_recent_activity($course, $viewfullnames, $timestart)
{
    global $CFG, $USER, $DB, $OUTPUT;
    require_once $CFG->dirroot . '/mod/assign/locallib.php';
    // Do not use log table if possible, it may be huge.
    $dbparams = array($timestart, $course->id, 'assign', ASSIGN_SUBMISSION_STATUS_SUBMITTED);
    $namefields = user_picture::fields('u', null, 'userid');
    if (!($submissions = $DB->get_records_sql("SELECT asb.id, asb.timemodified, cm.id AS cmid, um.id as recordid,\n                                                     {$namefields}\n                                                FROM {assign_submission} asb\n                                                     JOIN {assign} a      ON a.id = asb.assignment\n                                                     JOIN {course_modules} cm ON cm.instance = a.id\n                                                     JOIN {modules} md        ON md.id = cm.module\n                                                     JOIN {user} u            ON u.id = asb.userid\n                                                LEFT JOIN {assign_user_mapping} um ON um.userid = u.id AND um.assignment = a.id\n                                               WHERE asb.timemodified > ? AND\n                                                     asb.latest = 1 AND\n                                                     a.course = ? AND\n                                                     md.name = ? AND\n                                                     asb.status = ?\n                                            ORDER BY asb.timemodified ASC", $dbparams))) {
        return false;
    }
    $modinfo = get_fast_modinfo($course);
    $show = array();
    $grader = array();
    $showrecentsubmissions = get_config('assign', 'showrecentsubmissions');
    foreach ($submissions as $submission) {
        if (!array_key_exists($submission->cmid, $modinfo->get_cms())) {
            continue;
        }
        $cm = $modinfo->get_cm($submission->cmid);
        if (!$cm->uservisible) {
            continue;
        }
        if ($submission->userid == $USER->id) {
            $show[] = $submission;
            continue;
        }
        $context = context_module::instance($submission->cmid);
        // The act of submitting of assignment may be considered private -
        // only graders will see it if specified.
        if (empty($showrecentsubmissions)) {
            if (!array_key_exists($cm->id, $grader)) {
                $grader[$cm->id] = has_capability('moodle/grade:viewall', $context);
            }
            if (!$grader[$cm->id]) {
                continue;
            }
        }
        $groupmode = groups_get_activity_groupmode($cm, $course);
        if ($groupmode == SEPARATEGROUPS && !has_capability('moodle/site:accessallgroups', $context)) {
            if (isguestuser()) {
                // Shortcut - guest user does not belong into any group.
                continue;
            }
            // This will be slow - show only users that share group with me in this cm.
            if (!$modinfo->get_groups($cm->groupingid)) {
                continue;
            }
            $usersgroups = groups_get_all_groups($course->id, $submission->userid, $cm->groupingid);
            if (is_array($usersgroups)) {
                $usersgroups = array_keys($usersgroups);
                $intersect = array_intersect($usersgroups, $modinfo->get_groups($cm->groupingid));
                if (empty($intersect)) {
                    continue;
                }
            }
        }
        $show[] = $submission;
    }
    if (empty($show)) {
        return false;
    }
    echo $OUTPUT->heading(get_string('newsubmissions', 'assign') . ':', 3);
    foreach ($show as $submission) {
        $cm = $modinfo->get_cm($submission->cmid);
        $context = context_module::instance($submission->cmid);
        $assign = new assign($context, $cm, $cm->course);
        $link = $CFG->wwwroot . '/mod/assign/view.php?id=' . $cm->id;
        // Obscure first and last name if blind marking enabled.
        if ($assign->is_blind_marking()) {
            $submission->firstname = get_string('participant', 'mod_assign');
            if (empty($submission->recordid)) {
                $submission->recordid = $assign->get_uniqueid_for_user($submission->userid);
            }
            $submission->lastname = $submission->recordid;
        }
        print_recent_activity_note($submission->timemodified, $submission, $cm->name, $link, false, $viewfullnames);
    }
    return true;
}
开发者ID:dg711,项目名称:moodle,代码行数:88,代码来源:lib.php

示例6: assignsubmission_comments_comment_display

/**
 * Callback called by comment::get_comments() and comment::add(). Gives an opportunity to enforce blind-marking.
 *
 * @param array $comments
 * @param stdClass $options
 * @return array
 * @throws comment_exception
 */
function assignsubmission_comments_comment_display($comments, $options)
{
    global $CFG, $DB, $USER;
    if ($options->commentarea != 'submission_comments' && $options->commentarea != 'submission_comments_upgrade') {
        throw new comment_exception('invalidcommentarea');
    }
    if (!($submission = $DB->get_record('assign_submission', array('id' => $options->itemid)))) {
        throw new comment_exception('invalidcommentitemid');
    }
    $context = $options->context;
    $cm = $options->cm;
    $course = $options->courseid;
    require_once $CFG->dirroot . '/mod/assign/locallib.php';
    $assignment = new assign($context, $cm, $course);
    if ($assignment->get_instance()->id != $submission->assignment) {
        throw new comment_exception('invalidcontext');
    }
    if ($assignment->is_blind_marking() && !empty($comments)) {
        // Blind marking is being used, may need to map unique anonymous ids to the comments.
        $usermappings = array();
        $hiddenuserstr = trim(get_string('hiddenuser', 'assign'));
        $guestuser = guest_user();
        foreach ($comments as $comment) {
            // Anonymize the comments.
            if (empty($usermappings[$comment->userid])) {
                // The blind-marking information for this commenter has not been generated; do so now.
                $anonid = $assignment->get_uniqueid_for_user($comment->userid);
                $commenter = new stdClass();
                $commenter->firstname = $hiddenuserstr;
                $commenter->lastname = $anonid;
                $commenter->picture = 0;
                $commenter->id = $guestuser->id;
                $commenter->email = $guestuser->email;
                $commenter->imagealt = $guestuser->imagealt;
                // Temporarily store blind-marking information for use in later comments if necessary.
                $usermappings[$comment->userid]->fullname = fullname($commenter);
                $usermappings[$comment->userid]->avatar = $assignment->get_renderer()->user_picture($commenter, array('size' => 18, 'link' => false));
            }
            // Set blind-marking information for this comment.
            $comment->fullname = $usermappings[$comment->userid]->fullname;
            $comment->avatar = $usermappings[$comment->userid]->avatar;
            $comment->profileurl = null;
        }
    }
    return $comments;
}
开发者ID:pzhu2004,项目名称:moodle,代码行数:54,代码来源:lib.php

示例7: test_reveal_identities

 /**
  * Test reveal_identities
  */
 public function test_reveal_identities()
 {
     global $DB, $USER;
     $this->resetAfterTest(true);
     // Create a course and assignment and users.
     $course = self::getDataGenerator()->create_course();
     $teacher = self::getDataGenerator()->create_user();
     $teacherrole = $DB->get_record('role', array('shortname' => 'teacher'));
     $this->getDataGenerator()->enrol_user($teacher->id, $course->id, $teacherrole->id);
     $this->setUser($teacher);
     $generator = $this->getDataGenerator()->get_plugin_generator('mod_assign');
     $params['course'] = $course->id;
     $params['submissiondrafts'] = 1;
     $params['sendnotifications'] = 0;
     $params['blindmarking'] = 1;
     $instance = $generator->create_instance($params);
     $cm = get_coursemodule_from_instance('assign', $instance->id);
     $context = context_module::instance($cm->id);
     $assign = new assign($context, $cm, $course);
     $student1 = self::getDataGenerator()->create_user();
     $studentrole = $DB->get_record('role', array('shortname' => 'student'));
     $this->getDataGenerator()->enrol_user($student1->id, $course->id, $studentrole->id);
     $this->setUser($student1);
     $this->setExpectedException('required_capability_exception');
     $result = mod_assign_external::reveal_identities($instance->id);
     $result = external_api::clean_returnvalue(mod_assign_external::reveal_identities_returns(), $result);
     $this->assertEquals(1, count($result));
     $this->assertEquals(true, $assign->is_blind_marking());
     $this->setUser($teacher);
     $result = mod_assign_external::reveal_identities($instance->id);
     $result = external_api::clean_returnvalue(mod_assign_external::reveal_identities_returns(), $result);
     $this->assertEquals(0, count($result));
     $this->assertEquals(false, $assign->is_blind_marking());
     $generator = $this->getDataGenerator()->get_plugin_generator('mod_assign');
     $params['course'] = $course->id;
     $params['submissiondrafts'] = 1;
     $params['sendnotifications'] = 0;
     $params['blindmarking'] = 0;
     $instance = $generator->create_instance($params);
     $cm = get_coursemodule_from_instance('assign', $instance->id);
     $context = context_module::instance($cm->id);
     $assign = new assign($context, $cm, $course);
     $result = mod_assign_external::reveal_identities($instance->id);
     $result = external_api::clean_returnvalue(mod_assign_external::reveal_identities_returns(), $result);
     $this->assertEquals(1, count($result));
     $this->assertEquals(false, $assign->is_blind_marking());
 }
开发者ID:jackdaniels79,项目名称:moodle,代码行数:50,代码来源:externallib_test.php

示例8: __construct


//.........这里部分代码省略.........
        list($userwhere, $userparams) = $DB->get_in_or_equal($users, SQL_PARAMS_NAMED, 'user');
        $where = 'u.id ' . $userwhere;
        $params = array_merge($params, $userparams);

        if ($filter == ASSIGN_FILTER_SUBMITTED) {
            $where .= ' AND s.timecreated > 0 ';
        }
        if ($filter == ASSIGN_FILTER_REQUIRE_GRADING) {
            $where .= ' AND (s.timemodified > g.timemodified OR (s.timemodified IS NOT NULL AND g.timemodified IS NULL))';
        }
        if (strpos($filter, ASSIGN_FILTER_SINGLE_USER) === 0) {
            $userfilter = (int) array_pop(explode('=', $filter));
            $where .= ' AND (u.id = :userid)';
            $params['userid'] = $userfilter;
        }
        $this->set_sql($fields, $from, $where, $params);

        if ($downloadfilename) {
            $this->is_downloading('csv', $downloadfilename);
        }

        $columns = array();
        $headers = array();

        // Select.
        if (!$this->is_downloading()) {
            $columns[] = 'select';
            $headers[] = get_string('select') .
                    '<div class="selectall"><label class="accesshide" for="selectall">' . get_string('selectall') . '</label>
                    <input type="checkbox" id="selectall" name="selectall" title="' . get_string('selectall') . '"/></div>';
        }

        // User picture.
        if (!$this->assignment->is_blind_marking()) {
            if (!$this->is_downloading()) {
                $columns[] = 'picture';
                $headers[] = get_string('pictureofuser');
            } else {
                $columns[] = 'recordid';
                $headers[] = get_string('recordid', 'assign');
            }

            // Fullname.
            $columns[] = 'fullname';
            $headers[] = get_string('fullname');
        } else {
            // Record ID.
            $columns[] = 'recordid';
            $headers[] = get_string('recordid', 'assign');
        }

        // Submission status
        if ($assignment->is_any_submission_plugin_enabled()) {
            $columns[] = 'status';
            $headers[] = get_string('status');
        }

        // Team submission columns
        if ($assignment->get_instance()->teamsubmission) {
            $columns[] = 'team';
            $headers[] = get_string('submissionteam', 'assign');

            $columns[] = 'teamstatus';
            $headers[] = get_string('teamsubmissionstatus', 'assign');
        }
开发者ID:numbas,项目名称:moodle,代码行数:66,代码来源:gradingtable.php

示例9: get_participant

 /**
  * Get the user participating in the given assignment. An error with code 'usernotincourse'
  * is thrown is the user isn't a participant of the given assignment.
  *
  * @param int $assignid the assign instance id
  * @param int $userid the user id
  * @param bool $embeduser return user details (only applicable if not blind marking)
  * @return array of warnings and status result
  * @since Moodle 3.1
  * @throws moodle_exception
  */
 public static function get_participant($assignid, $userid, $embeduser)
 {
     global $DB, $CFG;
     require_once $CFG->dirroot . "/mod/assign/locallib.php";
     require_once $CFG->dirroot . "/user/lib.php";
     $params = self::validate_parameters(self::get_participant_parameters(), array('assignid' => $assignid, 'userid' => $userid, 'embeduser' => $embeduser));
     // Request and permission validation.
     $assign = $DB->get_record('assign', array('id' => $params['assignid']), 'id', MUST_EXIST);
     list($course, $cm) = get_course_and_cm_from_instance($assign, 'assign');
     $context = context_module::instance($cm->id);
     self::validate_context($context);
     $assign = new assign($context, null, null);
     $assign->require_view_grades();
     $participant = $assign->get_participant($params['userid']);
     if (!$participant) {
         // No participant found so we can return early.
         throw new moodle_exception('usernotincourse');
     }
     $return = array('id' => $participant->id, 'fullname' => $participant->fullname, 'submitted' => $participant->submitted, 'requiregrading' => $participant->requiregrading, 'blindmarking' => $assign->is_blind_marking());
     if (!empty($participant->groupid)) {
         $return['groupid'] = $participant->groupid;
     }
     if (!empty($participant->groupname)) {
         $return['groupname'] = $participant->groupname;
     }
     // Skip the expensive lookup of user detail if we're blind marking or the caller
     // hasn't asked for user details to be embedded.
     if (!$assign->is_blind_marking() && $embeduser) {
         $return['user'] = user_get_user_details($participant, $course);
     }
     return $return;
 }
开发者ID:jackdaniels79,项目名称:moodle,代码行数:43,代码来源:externallib.php


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