original_string: public function check_can_be_edited() {
          if (!$this->can_be_edited()) {
              $reportlink = quiz_attempt_summary_link_to_reports($this->get_quiz(),
                      $this->quizobj->get_cm(), $this->quizobj->get_context());
              throw new \moodle_exception('cannoteditafterattempts', 'quiz',
                      new \moodle_url('/mod/quiz/edit.php', array('cmid' => $this->get_cmid())), $reportlink);
          }
      }
code: public function check_can_be_edited() {
          if (!$this->can_be_edited()) {
              $reportlink = quiz_attempt_summary_link_to_reports($this->get_quiz(),
                      $this->quizobj->get_cm(), $this->quizobj->get_context());
              throw new \moodle_exception('cannoteditafterattempts', 'quiz',
                      new \moodle_url('/mod/quiz/edit.php', array('cmid' => $this->get_cmid())), $reportlink);
          }
      }
code_tokens: public function check_can_be_edited ( ) { if ( ! $ this -> can_be_edited ( ) ) { $ reportlink = quiz_attempt_summary_link_to_reports ( $ this -> get_quiz ( ) , $ this -> quizobj -> get_cm ( ) , $ this -> quizobj -> get_context ( ) ) ; throw new \ moodle_exception ( 'cannoteditafterattempts' , 'quiz' , new \ moodle_url ( '/mod/quiz/edit.php' , array ( 'cmid' => $ this -> get_cmid ( ) ) ) , $ reportlink ) ; } }
docstring: This quiz can only be edited if they have not been attempted.
  Throw an exception if this is not the case.
docstring_tokens: This quiz can only be edited if they have not been attempted . Throw an exception if this is not the case .