From 7a7e3bb1be45f21326f2dd6d0a09d46799d8f734 Mon Sep 17 00:00:00 2001 From: David Watson <14983002+watson8@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:36:05 +0100 Subject: [PATCH] CTP-3563 require impl set_submission_data() --- classes/submission/assign.php | 2 +- classes/submission/hvp.php | 1 - classes/submission/quiz.php | 2 +- classes/submission/submission.php | 8 ++++++++ classes/submission/turnitintooltwo.php | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/classes/submission/assign.php b/classes/submission/assign.php index f14367d..a4c7ed2 100644 --- a/classes/submission/assign.php +++ b/classes/submission/assign.php @@ -61,7 +61,7 @@ protected function set_module_instance() { * @throws \dml_exception * @throws \moodle_exception */ - protected function set_submission_data() { + protected function set_submission_data(): void { $this->submissiondata = $this->get_assign_submission(); } diff --git a/classes/submission/hvp.php b/classes/submission/hvp.php index 0928243..13afa20 100644 --- a/classes/submission/hvp.php +++ b/classes/submission/hvp.php @@ -63,7 +63,6 @@ protected function set_module_instance() { * {@see \local_sitsgradepush\manager::push_submission_log_to_sits()} * We get the item time from the gradebook. (We don't have submissions stored in the mod_hvp local tables). * @return void - * @see */ protected function set_submission_data(): void { $grades = grade_get_grades( diff --git a/classes/submission/quiz.php b/classes/submission/quiz.php index cf5c133..bc317e4 100644 --- a/classes/submission/quiz.php +++ b/classes/submission/quiz.php @@ -63,7 +63,7 @@ protected function set_module_instance() { * @throws \dml_exception * @throws \moodle_exception */ - protected function set_submission_data() { + protected function set_submission_data(): void { $this->submissiondata = $this->get_best_attempt(); } diff --git a/classes/submission/submission.php b/classes/submission/submission.php index 6b1e730..f9cc1b7 100644 --- a/classes/submission/submission.php +++ b/classes/submission/submission.php @@ -166,6 +166,14 @@ public function get_submission_data() { return $this->submissiondata; } + /** + * Set submission data. + * The submission log transfer will be skipped without this data. + * {@see \local_sitsgradepush\manager::push_submission_log_to_sits()} + * @return void + */ + abstract protected function set_submission_data(): void; + /** * Get ISO 8601 format datetime. * diff --git a/classes/submission/turnitintooltwo.php b/classes/submission/turnitintooltwo.php index c9a4273..3afb6db 100644 --- a/classes/submission/turnitintooltwo.php +++ b/classes/submission/turnitintooltwo.php @@ -61,7 +61,7 @@ protected function set_module_instance() { * @throws \dml_exception * @throws \moodle_exception */ - protected function set_submission_data() { + protected function set_submission_data(): void { $this->submissiondata = $this->get_turnitintooltwo_submission(); }