public function check_examples_assessed_before_assessment($userid) {

        if ($this->useexamples and $this->examplesmode == self::EXAMPLES_BEFORE_ASSESSMENT
                and !has_capability('mod/workshop:manageexamples', $this->context)) {

            // The reviewer must have submitted their own submission.
            $reviewersubmission = $this->get_submission_by_author($userid);
            if (!$reviewersubmission) {
                // No money, no love.
                return array(false, 'exampleneedsubmission');
            } else {
                $examples = $this->get_examples_for_reviewer($userid);
                foreach ($examples as $exampleid => $example) {
                    if (is_null($example->grade)) {
                        return array(false, 'exampleneedassessed');
                    }
                }
            }
        }
        return array(true, null);
    }
public function check_examples_assessed_before_assessment($userid) {

        if ($this->useexamples and $this->examplesmode == self::EXAMPLES_BEFORE_ASSESSMENT
                and !has_capability('mod/workshop:manageexamples', $this->context)) {

            // The reviewer must have submitted their own submission.
            $reviewersubmission = $this->get_submission_by_author($userid);
            if (!$reviewersubmission) {
                // No money, no love.
                return array(false, 'exampleneedsubmission');
            } else {
                $examples = $this->get_examples_for_reviewer($userid);
                foreach ($examples as $exampleid => $example) {
                    if (is_null($example->grade)) {
                        return array(false, 'exampleneedassessed');
                    }
                }
            }
        }
        return array(true, null);
    }
public function check_examples_assessed_before_assessment ( $ userid ) { if ( $ this -> useexamples and $ this -> examplesmode == self :: EXAMPLES_BEFORE_ASSESSMENT and ! has_capability ( 'mod/workshop:manageexamples' , $ this -> context ) ) { // The reviewer must have submitted their own submission. $ reviewersubmission = $ this -> get_submission_by_author ( $ userid ) ; if ( ! $ reviewersubmission ) { // No money, no love. return array ( false , 'exampleneedsubmission' ) ; } else { $ examples = $ this -> get_examples_for_reviewer ( $ userid ) ; foreach ( $ examples as $ exampleid => $ example ) { if ( is_null ( $ example -> grade ) ) { return array ( false , 'exampleneedassessed' ) ; } } } } return array ( true , null ) ; }
Check that all required examples have been assessed by the given user.

@param  stdClass $userid     the user (reviewer) to check
@return mixed bool|state     false and notice code if there are examples missing assessment, true otherwise.
@since  Moodle 3.4
Check that all required examples have been assessed by the given user .