Skip to content

Commit d202909

Browse files
danghieu1407AnupamaSarjoshi
authored andcommitted
Fix document for override function #869616
1 parent 0c85b18 commit d202909

15 files changed

+42
-230
lines changed

classes/event/attempt_created.php

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,39 +33,25 @@
3333
*/
3434
class attempt_created extends base_event {
3535

36-
/**
37-
* Init method.
38-
*/
36+
#[\Override]
3937
protected function init() {
4038
$this->data['crud'] = 'w';
4139
$this->data['edulevel'] = self::LEVEL_TEACHING;
4240
}
4341

44-
/**
45-
* Returns the name of the event.
46-
*
47-
* @return string The name.
48-
*/
42+
#[\Override]
4943
public static function get_name(): string {
5044
return get_string('event_attempt_created', 'quiz_answersheets');
5145
}
5246

53-
/**
54-
* Returns the description of the event.
55-
*
56-
* @return string The description.
57-
*/
47+
#[\Override]
5848
public function get_description() {
5949
return 'The user with id ' . $this->userid . ' has created the attempt with id ' . $this->other['attemptid'] .
6050
' for the user with id ' . $this->relateduserid . ' for the quiz with course module id ' .
6151
$this->contextinstanceid . '.';
6252
}
6353

64-
/**
65-
* Returns the URL where the event can be viewed.
66-
*
67-
* @return \moodle_url The URL.
68-
*/
54+
#[\Override]
6955
public function get_url(): \moodle_url {
7056
return new \moodle_url('/mod/quiz/report/answersheets/attemptsheet.php', ['attempt' => $this->other['attemptid']]);
7157
}

classes/event/attempt_printed.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,19 @@
3333
*/
3434
class attempt_printed extends base_event {
3535

36-
/**
37-
* Returns the name of the event.
38-
*
39-
* @return string The name.
40-
*/
36+
#[\Override]
4137
public static function get_name(): string {
4238
return get_string('event_attempt_printed', 'quiz_answersheets');
4339
}
4440

45-
/**
46-
* Returns the description of the event.
47-
*
48-
* @return string The description.
49-
*/
41+
#[\Override]
5042
public function get_description(): string {
5143
return 'The user with id ' . $this->userid . ' has printed the attempt sheet with id ' . $this->other['attemptid'] .
5244
' belonging to the user with id ' . $this->relateduserid . ' for the quiz with course module id ' .
5345
$this->contextinstanceid . '.';
5446
}
5547

56-
/**
57-
* Returns the URL where the event can be viewed.
58-
*
59-
* @return \moodle_url The URL.
60-
*/
48+
#[\Override]
6149
public function get_url(): \moodle_url {
6250
return new \moodle_url('/mod/quiz/report/answersheets/attemptsheet.php', ['attempt' => $this->other['attemptid']]);
6351
}

classes/event/attempt_viewed.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,19 @@
3333
*/
3434
class attempt_viewed extends base_event {
3535

36-
/**
37-
* Returns the name of the event.
38-
*
39-
* @return string The name.
40-
*/
36+
#[\Override]
4137
public static function get_name(): string {
4238
return get_string('event_attempt_viewed', 'quiz_answersheets');
4339
}
4440

45-
/**
46-
* Returns the description of the event.
47-
*
48-
* @return string The description.
49-
*/
41+
#[\Override]
5042
public function get_description(): string {
5143
return 'The user with id ' . $this->userid . ' has viewed the attempt sheet with id ' . $this->other['attemptid'] .
5244
' belonging to the user with id ' . $this->relateduserid . ' for the quiz with course module id ' .
5345
$this->contextinstanceid . '.';
5446
}
5547

56-
/**
57-
* Returns the URL where the event can be viewed.
58-
*
59-
* @return \moodle_url The URL.
60-
*/
48+
#[\Override]
6149
public function get_url(): \moodle_url {
6250
return new \moodle_url('/mod/quiz/report/answersheets/attemptsheet.php', ['attempt' => $this->other['attemptid']]);
6351
}

classes/event/base_event.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,13 @@
3333
*/
3434
class base_event extends \core\event\base {
3535

36-
/**
37-
* Init method.
38-
*/
36+
#[\Override]
3937
protected function init() {
4038
$this->data['crud'] = 'r';
4139
$this->data['edulevel'] = self::LEVEL_TEACHING;
4240
}
4341

44-
/**
45-
* Returns the context instance id.
46-
*/
42+
#[\Override]
4743
protected function validate_data() {
4844
parent::validate_data();
4945
if (!isset($this->relateduserid)) {
@@ -59,11 +55,7 @@ protected function validate_data() {
5955
}
6056
}
6157

62-
/**
63-
* Returns the context instance id.
64-
*
65-
* @return int The context instance id.
66-
*/
58+
#[\Override]
6759
public static function get_objectid_mapping(): int {
6860
return \core\event\base::NOT_MAPPED;
6961
}

classes/event/responses_submitted.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,19 @@
3333
*/
3434
class responses_submitted extends base_event {
3535

36-
/**
37-
* Returns the name of the event.
38-
*
39-
* @return string The name.
40-
*/
36+
#[\Override]
4137
public static function get_name(): string {
4238
return get_string('event_responses_submitted', 'quiz_answersheets');
4339
}
4440

45-
/**
46-
* Returns the description of the event.
47-
*
48-
* @return string The description.
49-
*/
41+
#[\Override]
5042
public function get_description(): string {
5143
return 'The user with id ' . $this->userid . ' has submitted the responses for the attempt sheet with id ' .
5244
$this->other['attemptid'] . ' on behalf of user with id ' . $this->relateduserid .
5345
' for the quiz with course module id ' . $this->contextinstanceid . '.';
5446
}
5547

56-
/**
57-
* Returns the URL where the event can be viewed.
58-
*
59-
* @return \moodle_url The URL.
60-
*/
48+
#[\Override]
6149
public function get_url(): \moodle_url {
6250
return new \moodle_url('/mod/quiz/report/answersheets/attemptsheet.php',
6351
['attempt' => $this->other['attemptid']]);

classes/event/right_answer_printed.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,19 @@
3333
*/
3434
class right_answer_printed extends base_event {
3535

36-
/**
37-
* Returns the name of the event.
38-
*
39-
* @return string The name.
40-
*/
36+
#[\Override]
4137
public static function get_name(): string {
4238
return get_string('event_right_answer_printed', 'quiz_answersheets');
4339
}
4440

45-
/**
46-
* Returns the description of the event.
47-
*
48-
* @return string The description.
49-
*/
41+
#[\Override]
5042
public function get_description(): string {
5143
return 'The user with id ' . $this->userid . ' has printed the right answer sheet with id ' . $this->other['attemptid'] .
5244
' belonging to the user with id ' . $this->relateduserid . ' for the quiz with course module id ' .
5345
$this->contextinstanceid . '.';
5446
}
5547

56-
/**
57-
* Returns the URL where the event can be viewed.
58-
*
59-
* @return \moodle_url The URL.
60-
*/
48+
#[\Override]
6149
public function get_url(): \moodle_url {
6250
return new \moodle_url('/mod/quiz/report/answersheets/attemptsheet.php',
6351
['attempt' => $this->other['attemptid'], 'rightanswer' => 1]);

classes/event/right_answer_viewed.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,19 @@
3333
*/
3434
class right_answer_viewed extends base_event {
3535

36-
/**
37-
* Returns the name of the event.
38-
*
39-
* @return string The name.
40-
*/
36+
#[\Override]
4137
public static function get_name(): string {
4238
return get_string('event_right_answer_viewed', 'quiz_answersheets');
4339
}
4440

45-
/**
46-
* Returns the description of the event.
47-
*
48-
* @return string The description.
49-
*/
41+
#[\Override]
5042
public function get_description(): string {
5143
return 'The user with id ' . $this->userid . ' has viewed the right answer sheet with id ' . $this->other['attemptid'] .
5244
' belonging to the user with id ' . $this->relateduserid . ' for the quiz with course module id ' .
5345
$this->contextinstanceid . '.';
5446
}
5547

56-
/**
57-
* Returns the URL where the event can be viewed.
58-
*
59-
* @return \moodle_url The URL.
60-
*/
48+
#[\Override]
6149
public function get_url(): \moodle_url {
6250
return new \moodle_url('/mod/quiz/report/answersheets/attemptsheet.php',
6351
['attempt' => $this->other['attemptid'], 'rightanswer' => 1]);

classes/output/gapselect/renderer.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,7 @@
4040
*/
4141
class qtype_gapselect_override_renderer extends \qtype_gapselect_renderer {
4242

43-
/**
44-
* Render the embedded element
45-
*
46-
* @param question_attempt $qa
47-
* @param $place
48-
* @param question_display_options $options
49-
* @return string
50-
*/
43+
#[\Override]
5144
protected function embedded_element(question_attempt $qa, $place, question_display_options $options) {
5245
if (utils::should_hide_inline_choice($this->page)) {
5346
return parent::embedded_element($qa, $place, $options);

classes/output/match/renderer.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,7 @@
4242
*/
4343
class qtype_match_override_renderer extends \qtype_match_renderer {
4444

45-
/**
46-
* The code was copied from question/type/match/renderer.php, with modifications.
47-
*
48-
* @param question_attempt $qa
49-
* @param question_display_options $options
50-
* @return string
51-
*/
45+
#[\Override]
5246
public function formulation_and_controls(question_attempt $qa, question_display_options $options) {
5347
if (utils::should_hide_inline_choice($this->page)) {
5448
return parent::formulation_and_controls($qa, $options);

classes/output/multichoice/renderer.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@
4141
*/
4242
class qtype_multichoice_override_renderer extends \qtype_multichoice_single_renderer {
4343

44-
/**
45-
* The code was copied from question/type/multichoice/renderer.php, with modifications.
46-
*
47-
* @param question_attempt $qa
48-
* @param question_display_options $options
49-
* @return string
50-
*/
44+
#[\Override]
5145
public function formulation_and_controls(question_attempt $qa, question_display_options $options) {
5246
$question = $qa->get_question();
5347
$response = $question->get_response($qa);

0 commit comments

Comments
 (0)