From ae99c87bf15213fca3cbeac8af48f4101629a1f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Storhaug?= Date: Wed, 15 Dec 2021 21:20:19 +0100 Subject: [PATCH] Fix PHPDoc Checker error --- block_qtracker.php | 32 ++++++++++++++++---------------- classes/base_qtracker.php | 10 +++++----- edit_form.php | 8 ++++++++ version.php | 2 ++ 4 files changed, 31 insertions(+), 21 deletions(-) diff --git a/block_qtracker.php b/block_qtracker.php index 8bf3df3..a31e62b 100644 --- a/block_qtracker.php +++ b/block_qtracker.php @@ -15,8 +15,8 @@ // along with Moodle. If not, see . /** - * Main interface to Question Tracker - * Provides block for registering question issues for quiz module + * Question Tracker block definition + * Provides block for registering question issues for activity modules * * @package block_qtracker * @author André Storhaug @@ -30,8 +30,7 @@ defined('MOODLE_INTERNAL') || die(); /** - * Main interface to Question Tracker - * Provides block for registering question issues for quiz module + * Block for registering question issues for activity modules * * @author André Storhaug * @copyright 2021 NTNU @@ -46,11 +45,11 @@ public function applicable_formats() { return array('all' => false, 'mod-quiz' => true, 'mod-capquiz' => true); } - function has_config() { + public function has_config() { return true; } - function get_content() { + public function get_content() { global $COURSE; if ($this->content !== null) { @@ -68,16 +67,16 @@ function get_content() { $this->content->text = ''; $this->content->footer = ''; - $qtracker_type = $this->get_qtracker_type(); - if (is_null($qtracker_type)) { + $qtrackertype = $this->get_qtracker_type(); + if (is_null($qtrackertype)) { $this->content->text = get_string('not_supported_qtracker_type', 'block_qtracker'); return $this->content; } - $active_attempt = $qtracker_type->is_active_attempt(); - if (!$active_attempt) { - $can_view_issues = $qtracker_type->can_view_issues(); - if ($can_view_issues) { + $activeattempt = $qtrackertype->is_active_attempt(); + if (!$activeattempt) { + $canviewissues = $qtrackertype->can_view_issues(); + if ($canviewissues) { $url = new moodle_url('/local/qtracker/view.php', array('courseid' => $COURSE->id)); $this->content->text .= html_writer::link($url, get_string('view_issues', 'block_qtracker')); } @@ -99,9 +98,9 @@ function get_content() { $this->content->text = html_writer::tag('p', get_string('question_problem_details', 'block_qtracker')); } - $quba = $qtracker_type->get_quba(); - $slots = $qtracker_type->get_slots(); - $contextid = $qtracker_type->get_contextid(); + $quba = $qtrackertype->get_quba(); + $slots = $qtrackertype->get_slots(); + $contextid = $qtrackertype->get_contextid(); $templatable = new issue_registration_block($quba, $slots, $contextid); $renderer = $this->page->get_renderer('local_qtracker'); @@ -111,9 +110,10 @@ function get_content() { } /** + * Get the supported activity module type * @return base_qtracker */ - function get_qtracker_type() { + private function get_qtracker_type() { $modname = $this->page->cm->modname; switch ($modname) { case 'quiz': diff --git a/classes/base_qtracker.php b/classes/base_qtracker.php index 9363e86..e29706e 100644 --- a/classes/base_qtracker.php +++ b/classes/base_qtracker.php @@ -39,29 +39,29 @@ abstract class base_qtracker { * Returns the question_usage_by_activity. * @return \question_usage_by_activity */ - abstract function get_quba(); + abstract public function get_quba(); /** * Returns the slots. * @return array */ - abstract function get_slots(); + abstract public function get_slots(); /** * Returns the context id. * @return int */ - abstract function get_contextid(); + abstract public function get_contextid(); /** * Checks if the current user can view submitted issues. * @return bool */ - abstract function can_view_issues(); + abstract public function can_view_issues(); /** * Checks if the current page represents an active question attempt. * @return bool */ - abstract function is_active_attempt(); + abstract public function is_active_attempt(); } diff --git a/edit_form.php b/edit_form.php index 469dfc9..b03664c 100644 --- a/edit_form.php +++ b/edit_form.php @@ -15,12 +15,20 @@ // along with Moodle. If not, see . /** + * Form for editing Question Tracker block instances. * @package block_qtracker * @author André Storhaug * @copyright 2020 NTNU * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ + /** + * Form for editing Question Tracker block instances. + * + * @author André Storhaug + * @copyright 2021 NTNU + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ class block_qtracker_edit_form extends block_edit_form { protected function specific_definition($mform) { diff --git a/version.php b/version.php index 5a1615a..586b444 100755 --- a/version.php +++ b/version.php @@ -15,6 +15,8 @@ // along with Moodle. If not, see . /** + * Version details. + * * @package block_qtracker * @author André Storhaug * @copyright 2020 NTNU