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


PHP workshop::prepare_example_assessment方法代碼示例

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


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

示例1: test_prepare_example_assessment

 public function test_prepare_example_assessment()
 {
     $this->resetAfterTest(true);
     // fixture setup
     $fakerawrecord = (object) array('id' => 42, 'submissionid' => 56, 'weight' => 0, 'timecreated' => time() - 10, 'timemodified' => time() - 5, 'grade' => null, 'gradinggrade' => null, 'gradinggradeover' => null, 'feedbackauthor' => null, 'feedbackauthorformat' => 0, 'feedbackauthorattachment' => 0);
     // excersise SUT
     $a = $this->workshop->prepare_example_assessment($fakerawrecord);
     // verify
     $this->assertTrue($a instanceof workshop_example_assessment);
     $this->assertTrue($a->url instanceof moodle_url);
     // modify setup
     $fakerawrecord->weight = 1;
     $this->expectException('coding_exception');
     // excersise SUT
     $a = $this->workshop->prepare_example_assessment($fakerawrecord);
 }
開發者ID:dg711,項目名稱:moodle,代碼行數:16,代碼來源:locallib_test.php

示例2: array

    $options = array(
        'showreviewer'  => false,
        'showauthor'    => false,
        'showform'      => true,
    );
    $assessment = $workshop->prepare_example_reference_assessment($assessment, $mform, $options);
    $assessment->title = get_string('assessmentreference', 'workshop');
    echo $output->render($assessment);

} else if ($isreviewer) {
    $options = array(
        'showreviewer'  => true,
        'showauthor'    => false,
        'showform'      => true,
    );
    $assessment = $workshop->prepare_example_assessment($assessment, $mform, $options);
    $assessment->title = get_string('assessmentbyyourself', 'workshop');
    echo $output->render($assessment);

} else if ($canmanage) {
    $options = array(
        'showreviewer'  => true,
        'showauthor'    => false,
        'showform'      => true,
        'showweight'    => false,
    );
    $assessment = $workshop->prepare_example_assessment($assessment, $mform, $options);
    echo $output->render($assessment);
}

echo $output->footer();
開發者ID:verbazend,項目名稱:AWFA,代碼行數:31,代碼來源:exassessment.php


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