/** * Check a request for access to a file belonging to a hint. * @param question_attempt $qa the question attempt being displayed. * @param question_display_options $options the options that control display of the question. * @param array $args the remaining bits of the file path. * @return bool whether access to the file should be allowed. */ protected function check_hint_file_access($qa, $options, $args) { if (!$options->feedback) { return false; } $hint = $qa->get_applicable_hint(); $hintid = reset($args); // itemid is hint id. return $hintid == $hint->id; }