Skip to content

Commit

Permalink
Fix PHPDoc Checker error
Browse files Browse the repository at this point in the history
  • Loading branch information
andstor committed Dec 15, 2021
1 parent 1e79e6f commit ae99c87
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 21 deletions.
32 changes: 16 additions & 16 deletions block_qtracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* 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 <andr3.storhaug@gmail.com>
Expand All @@ -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 <andr3.storhaug@gmail.com>
* @copyright 2021 NTNU
Expand All @@ -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) {
Expand All @@ -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'));
}
Expand All @@ -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');
Expand All @@ -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':
Expand Down
10 changes: 5 additions & 5 deletions classes/base_qtracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
8 changes: 8 additions & 0 deletions edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,20 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Form for editing Question Tracker block instances.
* @package block_qtracker
* @author André Storhaug <andr3.storhaug@gmail.com>
* @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 <andr3.storhaug@gmail.com>
* @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) {
Expand Down
2 changes: 2 additions & 0 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Version details.
*
* @package block_qtracker
* @author André Storhaug <andr3.storhaug@gmail.com>
* @copyright 2020 NTNU
Expand Down

0 comments on commit ae99c87

Please sign in to comment.