示例#1
0
 /**
  * Returns example submissions to be assessed by the owner of the planner
  *
  * This is here to cache the DB query because the same list is needed later in view.php
  *
  * @see teamwork::get_examples_for_reviewer() for the format of returned value
  * @return array
  */
 public function get_examples()
 {
     if (is_null($this->examples)) {
         $this->examples = $this->teamwork->get_examples_for_reviewer($this->userid);
     }
     return $this->examples;
 }
示例#2
0
}
// check that all required examples have been assessed by the user
if ($assessmenteditable and $teamwork->useexamples and $teamwork->examplesmode == teamwork::EXAMPLES_BEFORE_ASSESSMENT and !has_capability('mod/teamwork:manageexamples', $teamwork->context)) {
    // the reviewer must have submitted their own submission
    $reviewersubmission = $teamwork->get_submission_by_author($assessment->reviewerid);
    $output = $PAGE->get_renderer('mod_teamwork');
    if (!$reviewersubmission) {
        // no money, no love
        $assessmenteditable = false;
        echo $output->header();
        echo $output->heading(format_string($teamwork->name));
        notice(get_string('exampleneedsubmission', 'teamwork'), new moodle_url('/mod/teamwork/view.php', array('id' => $cm->id)));
        echo $output->footer();
        exit;
    } else {
        $examples = $teamwork->get_examples_for_reviewer($assessment->reviewerid);
        foreach ($examples as $exampleid => $example) {
            if (is_null($example->grade)) {
                $assessmenteditable = false;
                echo $output->header();
                echo $output->heading(format_string($teamwork->name));
                notice(get_string('exampleneedassessed', 'teamwork'), new moodle_url('/mod/teamwork/view.php', array('id' => $cm->id)));
                echo $output->footer();
                exit;
            }
        }
    }
}
// load the grading strategy logic
$strategy = $teamwork->grading_strategy_instance();
if (is_null($assessment->grade) and !$assessmenteditable) {