From 9d58dae33b5e71943cf977bcc549426732b89d20 Mon Sep 17 00:00:00 2001
From: Tim Hunt <T.J.Hunt@open.ac.uk>
Date: Fri, 20 Apr 2012 11:34:56 +0100
Subject: [PATCH] MDL-32322 quiz reports: fix PHPdoc comments. Thanks Smurf.

---
 mod/quiz/report/attemptsreport.php            |  3 +-
 mod/quiz/report/attemptsreport_options.php    |  8 ++-
 mod/quiz/report/attemptsreport_table.php      | 69 ++++++++++++++++++-
 mod/quiz/report/overview/overview_table.php   | 11 +++
 mod/quiz/report/responses/responses_table.php | 11 +++
 5 files changed, 98 insertions(+), 4 deletions(-)

diff --git a/mod/quiz/report/attemptsreport.php b/mod/quiz/report/attemptsreport.php
index 0786d4c023a..b509acc8bde 100644
--- a/mod/quiz/report/attemptsreport.php
+++ b/mod/quiz/report/attemptsreport.php
@@ -91,7 +91,8 @@ abstract class quiz_attempts_report extends quiz_default_report {
     }
 
     /**
-     * @return moodle_url the base URL for this report.
+     * Get the base URL for this report.
+     * @return moodle_url the URL.
      */
     protected function get_base_url() {
         return new moodle_url('/mod/quiz/report.php',
diff --git a/mod/quiz/report/attemptsreport_options.php b/mod/quiz/report/attemptsreport_options.php
index c9d9953f4a1..17c0b95c094 100644
--- a/mod/quiz/report/attemptsreport_options.php
+++ b/mod/quiz/report/attemptsreport_options.php
@@ -74,8 +74,10 @@ class mod_quiz_attempts_report_options {
 
     /**
      * Constructor.
+     * @param string $mode which report these options are for.
      * @param object $quiz the settings for the quiz being reported on.
      * @param object $cm the course module objects for the quiz being reported on.
+     * @param object $coures the course settings for the coures this quiz is in.
      */
     public function __construct($mode, $quiz, $cm, $course) {
         $this->mode   = $mode;
@@ -87,7 +89,8 @@ class mod_quiz_attempts_report_options {
     }
 
     /**
-     * @return array the URL parameters required to show the report with these options.
+     * Get the URL parameters required to show the report with these options.
+     * @return array URL parameter name => value.
      */
     protected function get_url_params() {
         return array(
@@ -99,7 +102,8 @@ class mod_quiz_attempts_report_options {
     }
 
     /**
-     * @return moodle_url the URL to show the report with these options.
+     * Get the URL to show the report with these options.
+     * @return moodle_url the URL.
      */
     public function get_url() {
         return new moodle_url('/mod/quiz/report.php', $this->get_url_params());
diff --git a/mod/quiz/report/attemptsreport_table.php b/mod/quiz/report/attemptsreport_table.php
index 59c5bf38d4f..8d5cdfe8a6e 100755
--- a/mod/quiz/report/attemptsreport_table.php
+++ b/mod/quiz/report/attemptsreport_table.php
@@ -49,17 +49,48 @@ abstract class quiz_attempts_report_table extends table_sql {
      */
     protected $lateststeps = null;
 
+    /** @var object the quiz settings for the quiz we are reporting on. */
     protected $quiz;
+
+    /** @var context the quiz context. */
     protected $context;
+
+    /** @var string HTML fragment to select the first/best/last attempt, if appropriate. */
     protected $qmsubselect;
+
+    /** @var object mod_quiz_attempts_report_options the options affecting this report. */
     protected $options;
+
+    /** @var bool whether to only display the first/best/last attempt for each student. */
     protected $qmfilter;
+
+    /** @var int which attempts/students to include in the report.. */
     protected $attemptsmode;
+
+    /** @var object the ids of the students in the currently selected group, if applicable. */
     protected $groupstudents;
+
+    /** @var object the ids of the students in the course. */
     protected $students;
+
+    /** @var object the questions that comprise this quiz.. */
     protected $questions;
+
+    /** @var bool whether to include the column with checkboxes to select each attempt. */
     protected $includecheckboxes;
 
+    /**
+     * Constructor
+     * @param string $uniqueid
+     * @param object $quiz
+     * @param context $context
+     * @param string $qmsubselect
+     * @param mod_quiz_attempts_report_options $options
+     * @param array $groupstudents
+     * @param array $students
+     * @param array $questions
+     * @param moodle_url $reporturl
+     */
     public function __construct($uniqueid, $quiz, $context, $qmsubselect,
             mod_quiz_attempts_report_options $options, $groupstudents, $students,
             $questions, $reporturl) {
@@ -77,6 +108,11 @@ abstract class quiz_attempts_report_table extends table_sql {
         $this->options = $options;
     }
 
+    /**
+     * Generate the display of the checkbox column.
+     * @param object $attempt the table row being output.
+     * @return string HTML content to go inside the td.
+     */
     public function col_checkbox($attempt) {
         if ($attempt->attempt) {
             return '<input type="checkbox" name="attemptid[]" value="'.$attempt->attempt.'" />';
@@ -85,6 +121,11 @@ abstract class quiz_attempts_report_table extends table_sql {
         }
     }
 
+    /**
+     * Generate the display of the user's picture column.
+     * @param object $attempt the table row being output.
+     * @return string HTML content to go inside the td.
+     */
     public function col_picture($attempt) {
         global $OUTPUT;
         $user = new stdClass();
@@ -97,6 +138,11 @@ abstract class quiz_attempts_report_table extends table_sql {
         return $OUTPUT->user_picture($user);
     }
 
+    /**
+     * Generate the display of the user's full name column.
+     * @param object $attempt the table row being output.
+     * @return string HTML content to go inside the td.
+     */
     public function col_fullname($attempt) {
         $html = parent::col_fullname($attempt);
         if ($this->is_downloading()) {
@@ -108,6 +154,11 @@ abstract class quiz_attempts_report_table extends table_sql {
                 get_string('reviewattempt', 'quiz'), array('class' => 'reviewlink'));
     }
 
+    /**
+     * Generate the display of the start time column.
+     * @param object $attempt the table row being output.
+     * @return string HTML content to go inside the td.
+     */
     public function col_timestart($attempt) {
         if ($attempt->attempt) {
             return userdate($attempt->timestart, $this->strtimeformat);
@@ -116,6 +167,11 @@ abstract class quiz_attempts_report_table extends table_sql {
         }
     }
 
+    /**
+     * Generate the display of the finish time column.
+     * @param object $attempt the table row being output.
+     * @return string HTML content to go inside the td.
+     */
     public function col_timefinish($attempt) {
         if ($attempt->attempt && $attempt->timefinish) {
             return userdate($attempt->timefinish, $this->strtimeformat);
@@ -124,6 +180,11 @@ abstract class quiz_attempts_report_table extends table_sql {
         }
     }
 
+    /**
+     * Generate the display of the time taken column.
+     * @param object $attempt the table row being output.
+     * @return string HTML content to go inside the td.
+     */
     public function col_duration($attempt) {
         if ($attempt->timefinish) {
             return format_time($attempt->timefinish - $attempt->timestart);
@@ -134,6 +195,11 @@ abstract class quiz_attempts_report_table extends table_sql {
         }
     }
 
+    /**
+     * Generate the display of the feedback column.
+     * @param object $attempt the table row being output.
+     * @return string HTML content to go inside the td.
+     */
     public function col_feedbacktext($attempt) {
         if (!$attempt->timefinish) {
             return '-';
@@ -224,7 +290,6 @@ abstract class quiz_attempts_report_table extends table_sql {
      *
      * @param qubaid_condition $qubaids used to restrict which usages are included
      * in the query. See {@link qubaid_condition}.
-     * @param array $slots A list of slots for the questions you want to konw about.
      * @return array of records. See the SQL in this function to see the fields available.
      */
     protected function load_question_latest_steps(qubaid_condition $qubaids) {
@@ -241,6 +306,8 @@ abstract class quiz_attempts_report_table extends table_sql {
     }
 
     /**
+     * Does this report require the detailed information for each question from the
+     * question_attempts_steps table?
      * @return bool should {@link query_db()} call {@link load_question_latest_steps}?
      */
     protected function requires_latest_steps_loaded() {
diff --git a/mod/quiz/report/overview/overview_table.php b/mod/quiz/report/overview/overview_table.php
index 8a7909245d1..2aa63e2ce05 100644
--- a/mod/quiz/report/overview/overview_table.php
+++ b/mod/quiz/report/overview/overview_table.php
@@ -38,6 +38,17 @@ class quiz_overview_table extends quiz_attempts_report_table {
 
     protected $regradedqs = array();
 
+    /**
+     * Constructor
+     * @param object $quiz
+     * @param context $context
+     * @param string $qmsubselect
+     * @param quiz_overview_options $options
+     * @param array $groupstudents
+     * @param array $students
+     * @param array $questions
+     * @param moodle_url $reporturl
+     */
     public function __construct($quiz, $context, $qmsubselect,
             quiz_overview_options $options, $groupstudents, $students, $questions, $reporturl) {
         parent::__construct('mod-quiz-report-overview-report', $quiz , $context,
diff --git a/mod/quiz/report/responses/responses_table.php b/mod/quiz/report/responses/responses_table.php
index 9da4b1aabaf..efe33ee500b 100644
--- a/mod/quiz/report/responses/responses_table.php
+++ b/mod/quiz/report/responses/responses_table.php
@@ -36,6 +36,17 @@ require_once($CFG->dirroot . '/mod/quiz/report/attemptsreport_table.php');
  */
 class quiz_responses_table extends quiz_attempts_report_table {
 
+    /**
+     * Constructor
+     * @param object $quiz
+     * @param context $context
+     * @param string $qmsubselect
+     * @param quiz_responses_options $options
+     * @param array $groupstudents
+     * @param array $students
+     * @param array $questions
+     * @param moodle_url $reporturl
+     */
     public function __construct($quiz, $context, $qmsubselect, quiz_responses_options $options,
             $groupstudents, $students, $questions, $reporturl) {
         parent::__construct('mod-quiz-report-responses-report', $quiz, $context,