當前位置: 首頁>>代碼示例>>PHP>>正文


PHP workshop::get_assessments_of_submission方法代碼示例

本文整理匯總了PHP中workshop::get_assessments_of_submission方法的典型用法代碼示例。如果您正苦於以下問題:PHP workshop::get_assessments_of_submission方法的具體用法?PHP workshop::get_assessments_of_submission怎麽用?PHP workshop::get_assessments_of_submission使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在workshop的用法示例。


在下文中一共展示了workshop::get_assessments_of_submission方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

        }
    }
    if ($canoverride) {
        $assessment->add_action($workshop->assess_url($assessment->id), get_string('assessmentsettings', 'workshop'));
    }
    echo $output->render($assessment);
    if ($workshop->phase == workshop::PHASE_CLOSED) {
        if (strlen(trim($userassessment->feedbackreviewer)) > 0) {
            echo $output->render(new workshop_feedback_reviewer($userassessment));
        }
    }
}
if (has_capability('mod/workshop:viewallassessments', $workshop->context) or $ownsubmission and $workshop->assessments_available()) {
    // other assessments
    $strategy = $workshop->grading_strategy_instance();
    $assessments = $workshop->get_assessments_of_submission($submission->id);
    $showreviewer = has_capability('mod/workshop:viewreviewernames', $workshop->context);
    foreach ($assessments as $assessment) {
        if ($assessment->reviewerid == $USER->id) {
            // own assessment has been displayed already
            continue;
        }
        if (is_null($assessment->grade) and !has_capability('mod/workshop:viewallassessments', $workshop->context)) {
            // students do not see peer-assessment that are not graded yet
            continue;
        }
        $mform = $strategy->get_assessment_form($PAGE->url, 'assessment', $assessment, false);
        $options = array('showreviewer' => $showreviewer, 'showauthor' => $showauthor, 'showform' => !is_null($assessment->grade), 'showweight' => true);
        $displayassessment = $workshop->prepare_assessment($assessment, $mform, $options);
        if ($canoverride) {
            $displayassessment->add_action($workshop->assess_url($assessment->id), get_string('assessmentsettings', 'workshop'));
開發者ID:alanaipe2015,項目名稱:moodle,代碼行數:31,代碼來源:submission.php

示例2: foreach

    }
}
if ($editable and $workshop->useexamples and $workshop->examplesmode == workshop::EXAMPLES_BEFORE_SUBMISSION and !has_capability('mod/workshop:manageexamples', $workshop->context)) {
    // check that all required examples have been assessed by the user
    $examples = $workshop->get_examples_for_reviewer($USER->id);
    foreach ($examples as $exampleid => $example) {
        if (is_null($example->grade)) {
            $editable = false;
            break;
        }
    }
}
$edit = ($editable and $edit);
if (!$candeleteall and $ownsubmission and $editable) {
    // Only allow the student to delete their own submission if it's still editable and hasn't been assessed.
    if (count($workshop->get_assessments_of_submission($submission->id)) > 0) {
        $deletable = false;
    } else {
        $deletable = true;
    }
}
if ($submission->id and $delete and $confirm and $deletable) {
    require_sesskey();
    $workshop->delete_submission($submission);
    // Event information.
    $params = array('context' => $workshop->context, 'courseid' => $workshop->course->id, 'relateduserid' => $submission->authorid, 'other' => array('submissiontitle' => $submission->title));
    $params['objectid'] = $submission->id;
    $event = \mod_workshop\event\submission_deleted::create($params);
    $event->add_record_snapshot('workshop', $workshoprecord);
    $event->trigger();
    redirect($workshop->view_url());
開發者ID:jackdaniels79,項目名稱:moodle,代碼行數:31,代碼來源:submission.php


注:本文中的workshop::get_assessments_of_submission方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。