From 3b88db986a4a58eb31894a70e436e4ac65397aa8 Mon Sep 17 00:00:00 2001 From: Friederike Schwager <schwager@cil.rwth-aachen.de> Date: Thu, 26 Sep 2019 10:09:27 +0200 Subject: [PATCH] add/correct some documentation. Correct order in upgrade.php --- classes/output/answermenu.php | 14 ++++++++++--- classes/output/comment.php | 12 ++++++++--- classes/output/questionmenu.php | 10 ++++++--- classes/output/reportmenu.php | 13 +++++++++--- classes/output/statistics.php | 9 +++++++++ db/upgrade.php | 36 ++++++++++++++++----------------- 6 files changed, 64 insertions(+), 30 deletions(-) diff --git a/classes/output/answermenu.php b/classes/output/answermenu.php index 72b3c04..b84d9e1 100644 --- a/classes/output/answermenu.php +++ b/classes/output/answermenu.php @@ -15,9 +15,7 @@ // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** - * The purpose of this script is to collect the output data for the statistic template and - * make it available to the renderer. The data is collected via the statistic model and then processed. - * Therefore, class statistic can be seen as a view controller. + * Dropdown menu in answerstable on overview tab. * * @package mod_pdfannotator * @copyright 2018 RWTH Aachen (see README.md) @@ -33,6 +31,16 @@ class answermenu implements \renderable, \templatable { private $label; private $buttonclass; + /** + * Constructor of renderable for dropdown menu in answerstable. + * @global type $CFG + * @param int $annotationid Id of the annotation the answer belongs to + * @param bool $issubscribed Is the user subscribed to the question? + * @param int $cmid Course module id + * @param int $currentpage Page of the table on overviewpage + * @param int $itemsperpage Number of entries on every page in the table + * @param int $answerfilter Value of the filter for the answerstable + */ public function __construct($annotationid, $issubscribed, $cmid, $currentpage, $itemsperpage, $answerfilter) { global $CFG; diff --git a/classes/output/comment.php b/classes/output/comment.php index d90da9c..42cd44d 100644 --- a/classes/output/comment.php +++ b/classes/output/comment.php @@ -15,9 +15,7 @@ // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** - * The purpose of this script is to collect the output data for the statistic template and - * make it available to the renderer. The data is collected via the statistic model and then processed. - * Therefore, class statistic can be seen as a view controller. + * Renderable for comments. * * @package mod_pdfannotator * @copyright 2018 RWTH Aachen (see README.md) @@ -30,6 +28,14 @@ class comment implements \renderable, \templatable { private $comments = []; + /** + * Constructor of renderable for comments. + * + * @param object $data Comment or array of comments + * @param object $cm Course module + * @param object $context Context + * @return type + */ public function __construct($data, $cm, $context) { global $USER; diff --git a/classes/output/questionmenu.php b/classes/output/questionmenu.php index 4171436..6969172 100644 --- a/classes/output/questionmenu.php +++ b/classes/output/questionmenu.php @@ -15,9 +15,7 @@ // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** - * The purpose of this script is to collect the output data for the statistic template and - * make it available to the renderer. The data is collected via the statistic model and then processed. - * Therefore, class statistic can be seen as a view controller. + * Dropdown menu in questionstable on overview tab. * * @package mod_pdfannotator * @copyright 2018 RWTH Aachen (see README.md) @@ -33,6 +31,12 @@ class questionmenu implements \renderable, \templatable { private $label; private $buttonclass; + /** + * Constructor of renderable for dropdown menu in questionstable. + * + * @param int $commentid Id of the question + * @param array $urlparams Parameters for the link + */ public function __construct($commentid, $urlparams) { global $CFG; diff --git a/classes/output/reportmenu.php b/classes/output/reportmenu.php index 16aaa1c..0933c6b 100644 --- a/classes/output/reportmenu.php +++ b/classes/output/reportmenu.php @@ -15,9 +15,7 @@ // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** - * The purpose of this script is to collect the output data for the statistic template and - * make it available to the renderer. The data is collected via the statistic model and then processed. - * Therefore, class statistic can be seen as a view controller. + * Dropdown menu in reportstable on overview tab. * * @package mod_pdfannotator * @copyright 2018 RWTH Aachen (see README.md) @@ -32,6 +30,15 @@ class reportmenu implements \renderable, \templatable { private $iconclass; private $label; + /** + * Constructor of renderable for dropdown menu in reportstable. + * @global type $CFG + * @param object $report Report object + * @param int $cmid Course module id + * @param int $currentpage Page of the table on overviewpage + * @param int $itemsperpage Number of entries on every page in the table + * @param int $reportfilter Value of the filter for the answerstable + */ public function __construct($report, $cmid, $currentpage, $itemsperpage, $reportfilter) { global $CFG; if ($report->seen == 0) { diff --git a/classes/output/statistics.php b/classes/output/statistics.php index da505d8..d8b9983 100644 --- a/classes/output/statistics.php +++ b/classes/output/statistics.php @@ -35,6 +35,15 @@ class statistics implements \renderable, \templatable { private $isteacher; private $tabledata; + /** + * Constructor of renderable for statistics tab. + * @global type $USER + * @global type $PAGE + * @param int $annotatorid Id of the annotator + * @param int $courseid ID of the course + * @param object $capabilities Some of the capabilities the user has- + * @param int $id Course module id + */ public function __construct($annotatorid, $courseid, $capabilities, $id) { global $USER, $PAGE; $userid = $USER->id; diff --git a/db/upgrade.php b/db/upgrade.php index 52e8ab7..fef5393 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -440,7 +440,7 @@ function xmldb_pdfannotator_upgrade($oldversion) { } // Pdfannotator savepoint reached. - upgrade_mod_savepoint(true, 2018111602, 'pdfannotator'); + upgrade_mod_savepoint(true, 2018092400, 'pdfannotator'); } if ($oldversion < 2018103000) { @@ -455,21 +455,6 @@ function xmldb_pdfannotator_upgrade($oldversion) { upgrade_mod_savepoint(true, 2018103000, 'pdfannotator'); } - if ($oldversion < 2018112203) { - - // Define field solved to be added to pdfannotator_comments. - $table = new xmldb_table('pdfannotator_comments'); - $field = new xmldb_field('solved', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'seen'); - - // Conditionally launch add field solved. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Pdfannotator savepoint reached. - upgrade_mod_savepoint(true, 2018112203, 'pdfannotator'); - } - if ($oldversion < 2018111901) { // Changing the default of field useprint on table pdfannotator to 0. @@ -485,6 +470,21 @@ function xmldb_pdfannotator_upgrade($oldversion) { upgrade_mod_savepoint(true, 2018111901, 'pdfannotator'); } + if ($oldversion < 2018112203) { + + // Define field solved to be added to pdfannotator_comments. + $table = new xmldb_table('pdfannotator_comments'); + $field = new xmldb_field('solved', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'seen'); + + // Conditionally launch add field solved. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Pdfannotator savepoint reached. + upgrade_mod_savepoint(true, 2018112203, 'pdfannotator'); + } + if ($oldversion < 2018112100) { // Define field modifiedby to be added to pdfannotator_annotations. @@ -559,8 +559,8 @@ function xmldb_pdfannotator_upgrade($oldversion) { // Pdfannotator savepoint reached. upgrade_mod_savepoint(true, 2019060300, 'pdfannotator'); } - - if ($oldversion < 2019070100) { + + if ($oldversion < 2019070100) { // Define field useprintcomments to be added to pdfannotator. $table = new xmldb_table('pdfannotator'); -- GitLab