original_string: protected function check_combined_feedback_file_access($qa, $options, $filearea, $args = null) {
          $state = $qa->get_state();
  
          if ($args === null) {
              debugging('You must pass $args as the fourth argument to check_combined_feedback_file_access.',
                      DEBUG_DEVELOPER);
              $args = array($this->id); // Fake it for now, so the rest of this method works.
          }
  
          if (!$state->is_finished()) {
              $response = $qa->get_last_qt_data();
              if (!$this->is_gradable_response($response)) {
                  return false;
              }
              list($notused, $state) = $this->grade_response($response);
          }
  
          return $options->feedback && $state->get_feedback_class() . 'feedback' == $filearea &&
                  $args[0] == $this->id;
      }
code: protected function check_combined_feedback_file_access($qa, $options, $filearea, $args = null) {
          $state = $qa->get_state();
  
          if ($args === null) {
              debugging('You must pass $args as the fourth argument to check_combined_feedback_file_access.',
                      DEBUG_DEVELOPER);
              $args = array($this->id); // Fake it for now, so the rest of this method works.
          }
  
          if (!$state->is_finished()) {
              $response = $qa->get_last_qt_data();
              if (!$this->is_gradable_response($response)) {
                  return false;
              }
              list($notused, $state) = $this->grade_response($response);
          }
  
          return $options->feedback && $state->get_feedback_class() . 'feedback' == $filearea &&
                  $args[0] == $this->id;
      }
code_tokens: protected function check_combined_feedback_file_access ( $ qa , $ options , $ filearea , $ args = null ) { $ state = $ qa -> get_state ( ) ; if ( $ args === null ) { debugging ( 'You must pass $args as the fourth argument to check_combined_feedback_file_access.' , DEBUG_DEVELOPER ) ; $ args = array ( $ this -> id ) ; // Fake it for now, so the rest of this method works. } if ( ! $ state -> is_finished ( ) ) { $ response = $ qa -> get_last_qt_data ( ) ; if ( ! $ this -> is_gradable_response ( $ response ) ) { return false ; } list ( $ notused , $ state ) = $ this -> grade_response ( $ response ) ; } return $ options -> feedback && $ state -> get_feedback_class ( ) . 'feedback' == $ filearea && $ args [ 0 ] == $ this -> id ; }
docstring: Check a request for access to a file belonging to a combined feedback field.
  @param question_attempt $qa the question attempt being displayed.
  @param question_display_options $options the options that control display of the question.
  @param string $filearea the name of the file area.
  @param array $args the remaining bits of the file path.
  @return bool whether access to the file should be allowed.
docstring_tokens: Check a request for access to a file belonging to a combined feedback field .