diff --git a/action.php b/action.php index f8c53c33b0fc1ccef005b11da81b4fd515fc243a..56aeab2b8955fa7a8da55792bdbef5fced7aaf55 100644 --- a/action.php +++ b/action.php @@ -27,7 +27,7 @@ * * @package mod_pdfannotator * @copyright 2018 RWTH Aachen (see README.md) - * @author Rabea de Groot, Anna Heynkes, Friederike Schwager + * @author Rabea de Groot, Anna Heynkes, Friederike Schwager * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -388,8 +388,6 @@ if ($action === 'getComments') { $comments = pdfannotator_comment::read($documentid, $annotationid, $context); - // require_once($CFG->dirroot . '/mod/pdfannotator/classes/output/comment.php'); - $myrenderer = $PAGE->get_renderer('mod_pdfannotator'); $templatable = new comment($comments, $cm, $context); @@ -455,7 +453,7 @@ if ($action === 'editComment') { $commentid = required_param('commentId', PARAM_INT); $content = required_param('content', PARAM_RAW); - + $data = pdfannotator_comment::update($commentid, $content, $editanypost); echo json_encode($data); } diff --git a/backup/moodle2/backup_pdfannotator_activity_task.class.php b/backup/moodle2/backup_pdfannotator_activity_task.class.php index 09d938efba17c6d0792f94126e823d1fdf1c0546..849257d5272ad69bc4280a7f9a4c9bb228227e97 100644 --- a/backup/moodle2/backup_pdfannotator_activity_task.class.php +++ b/backup/moodle2/backup_pdfannotator_activity_task.class.php @@ -75,7 +75,7 @@ class backup_pdfannotator_activity_task extends backup_activity_task { * @param string $content some HTML text that eventually contains URLs to the activity instance scripts * @return string the content with the URLs encoded */ - static public function encode_content_links($content) { + public static function encode_content_links($content) { global $CFG, $DB; diff --git a/backup/moodle2/backup_pdfannotator_stepslib.php b/backup/moodle2/backup_pdfannotator_stepslib.php index 48fd73bd1d8af62ad038afce1866eadf0c45dc39..05052412c8cb3615e17950be9480513c3d073284 100644 --- a/backup/moodle2/backup_pdfannotator_stepslib.php +++ b/backup/moodle2/backup_pdfannotator_stepslib.php @@ -54,23 +54,27 @@ class backup_pdfannotator_activity_structure_step extends backup_activity_struct // 2. Define each element separately. $pdfannotator = new backup_nested_element('pdfannotator', array('id'), array( - 'name', 'intro', 'introformat', 'usevotes', 'useprint', 'useprintcomments', 'use_studenttextbox', 'use_studentdrawing', 'useprivatecomments', 'useprotectedcomments', 'timecreated', 'timemodified')); + 'name', 'intro', 'introformat', 'usevotes', 'useprint', 'useprintcomments', 'use_studenttextbox', 'use_studentdrawing', + 'useprivatecomments', 'useprotectedcomments', 'timecreated', 'timemodified')); $annotations = new backup_nested_element('annotations'); - $annotation = new backup_nested_element('annotation', array('id'), array('page', 'userid', 'annotationtypeid', 'data', 'timecreated', 'timemodified', 'modifiedby')); + $annotation = new backup_nested_element('annotation', array('id'), array('page', 'userid', 'annotationtypeid', + 'data', 'timecreated', 'timemodified', 'modifiedby')); $subscriptions = new backup_nested_element('subscriptions'); $subscription = new backup_nested_element('subscription', array('id'), array('userid')); $comments = new backup_nested_element('comments'); - $c = array('pdfannotatorid', 'userid', 'content', 'timecreated', 'timemodified', 'modifiedby', 'visibility', 'isquestion', 'isdeleted', 'ishidden', 'solved'); + $c = array('pdfannotatorid', 'userid', 'content', 'timecreated', 'timemodified', 'modifiedby', 'visibility', + 'isquestion', 'isdeleted', 'ishidden', 'solved'); $comment = new backup_nested_element('comment', array('id'), $c); $votes = new backup_nested_element('votes'); $vote = new backup_nested_element('vote', array('id'), array('userid', 'annotationid')); $reports = new backup_nested_element('reports'); - $report = new backup_nested_element('report', array('id'), array('courseid', 'pdfannotatorid', 'message', 'userid', 'timecreated', 'seen')); + $report = new backup_nested_element('report', array('id'), array('courseid', 'pdfannotatorid', 'message', + 'userid', 'timecreated', 'seen')); // 3. Build the tree (mind the right order!) $pdfannotator->add_child($annotations); @@ -96,7 +100,8 @@ class backup_pdfannotator_activity_structure_step extends backup_activity_struct // Add all annotations specific to this annotator instance. $annotation->set_source_sql('SELECT a.* FROM {pdfannotator_annotations} a ' . 'JOIN {pdfannotator_comments} c ON a.id = c.annotationid ' - . "WHERE a.pdfannotatorid = ? AND c.isquestion = 1 AND (c.visibility = 'public' OR c.visibility = 'anonymous') ", + . "WHERE a.pdfannotatorid = ? AND c.isquestion = 1 AND " + . "(c.visibility = 'public' OR c.visibility = 'anonymous') ", array('pdfannotatorid' => backup::VAR_PARENTID)); // Add any subscriptions to this annotation. diff --git a/backup/moodle2/restore_pdfannotator_activity_task.class.php b/backup/moodle2/restore_pdfannotator_activity_task.class.php index 98728586c9209bf72288e6f678cb3aa0ab510e06..25ca6b9407f23f41ecdec89cc4ba68abbc4b792c 100644 --- a/backup/moodle2/restore_pdfannotator_activity_task.class.php +++ b/backup/moodle2/restore_pdfannotator_activity_task.class.php @@ -57,7 +57,7 @@ class restore_pdfannotator_activity_task extends restore_activity_task { * Define the contents in the activity that must be * processed by the link decoder. */ - static public function define_decode_contents() { + public static function define_decode_contents() { $contents = array(); $contents[] = new restore_decode_content('pdfannotator', array('intro'), 'pdfannotator'); @@ -69,7 +69,7 @@ class restore_pdfannotator_activity_task extends restore_activity_task { * Define the decoding rules for links belonging * to the activity to be executed by the link decoder */ - static public function define_decode_rules() { + public static function define_decode_rules() { $rules = array(); $rules[] = new restore_decode_rule('PDFANNOTATORVIEWBYID', '/mod/pdfannotator/view.php?id=$1', 'course_module'); @@ -85,7 +85,7 @@ class restore_pdfannotator_activity_task extends restore_activity_task { * pdfannotator logs. It must return one array * of {@see restore_log_rule} objects */ - static public function define_restore_log_rules() { + public static function define_restore_log_rules() { $rules = array(); $rules[] = new restore_log_rule('pdfannotator', 'add', 'view.php?id={course_module}', '{pdfannotator}'); @@ -105,7 +105,7 @@ class restore_pdfannotator_activity_task extends restore_activity_task { * by the restore final task, but are defined here at * activity level. All them are rules not linked to any module instance (cmid = 0) */ - static public function define_restore_log_rules_for_course() { + public static function define_restore_log_rules_for_course() { $rules = array(); $rules[] = new restore_log_rule('pdfannotator', 'view all', 'index.php?id={course}', null); diff --git a/classes/event/report_added.php b/classes/event/report_added.php index e0f3384f3409e2e94a607573f7f6561d1d717995..affbd351641b97633e23f613b6c56bf67e2deaee 100644 --- a/classes/event/report_added.php +++ b/classes/event/report_added.php @@ -54,4 +54,4 @@ class report_added extends \core\event\base { public function get_url() { return new \moodle_url('/mod/pdfannotator/view.php', array('id' => $this->other['cmid'], 'action' => 'overview')); } -} \ No newline at end of file +} diff --git a/classes/output/comment.php b/classes/output/comment.php index 65286e07cc8cd2f030c69ea1c432341ba3281a4f..b212b83635411e898cdcab1a53d01975d562ff31 100644 --- a/classes/output/comment.php +++ b/classes/output/comment.php @@ -17,6 +17,8 @@ namespace mod_pdfannotator\output; use moodle_url; +defined('MOODLE_INTERNAL') || die(); + /** * Renderable for comments. * @@ -25,8 +27,6 @@ use moodle_url; * @author Friederike Schwager * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -defined('MOODLE_INTERNAL') || die(); - class comment implements \renderable, \templatable { private $comments = []; diff --git a/classes/output/printview.php b/classes/output/printview.php index 5fa9b3f1055914a4d2b8292cecf833d7c940fdde..b6bbff029d0b20a8c123d1da2bb76f0d9347dbea 100644 --- a/classes/output/printview.php +++ b/classes/output/printview.php @@ -52,4 +52,4 @@ class printview implements \renderable, \templatable { return $data; } -} \ No newline at end of file +} diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index e85dea91b7236e5c5e782868f4715e4534187443..633817e73dd8f412674f2d7f378d5a5bac494075 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -440,4 +440,4 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l } } -} \ No newline at end of file +} diff --git a/constants.php b/constants.php index d633babd79585b3bfc1f56549f2461c690d6e79f..803c5a87859b86913d5450e7cdf97a06f0a37b49 100644 --- a/constants.php +++ b/constants.php @@ -16,7 +16,7 @@ /** * @package mod_pdfannotator * @copyright 2018 RWTH Aachen (see README.md) - * @author Rabea de Groot, Anna Heynkes, Friederike Schwager + * @author Rabea de Groot, Anna Heynkes, Friederike Schwager * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -36,6 +36,6 @@ define('LATEX_TO_PNG_GOOGLE_API', 1); /** - * Prefix needed for encode64 imaged + * Prefix needed for encode64 images */ -define('IMAGE_PREFIX', 'data:image/png;base64,'); \ No newline at end of file +define('IMAGE_PREFIX', 'data:image/png;base64,'); diff --git a/controller.php b/controller.php index 00f0b278a6d5da7979407b9eadf0941f2f8b007b..5830dccbbb13e128a712776362843719f9fa2285 100644 --- a/controller.php +++ b/controller.php @@ -17,7 +17,7 @@ /** * @package mod_pdfannotator * @copyright 2018 RWTH Aachen (see README.md) - * @author Anna Heynkes, Friederike Schwager + * @author Anna Heynkes, Friederike Schwager * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -570,4 +570,4 @@ if ($action === 'report') { $mform->display(); } return; -} \ No newline at end of file +} diff --git a/db/events.php b/db/events.php index 933baf50c79fb564badb324379b77c2c61f1abff..72330f6fe23adda944ee11903ff12b426fa2f0f8 100644 --- a/db/events.php +++ b/db/events.php @@ -14,4 +14,4 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. -defined('MOODLE_INTERNAL') || die(); \ No newline at end of file +defined('MOODLE_INTERNAL') || die(); diff --git a/db/messages.php b/db/messages.php index d9483ec833c6e9396706d919945abac4e07024bf..f9c94b8c88df720d194b23da360b7ddfa71f14b0 100644 --- a/db/messages.php +++ b/db/messages.php @@ -51,4 +51,4 @@ $messageproviders = array ( 'capability' => 'mod/pdfannotator:getforwardedquestions', // Teacher capability. ) -); \ No newline at end of file +); diff --git a/forward_form.php b/forward_form.php index 4941bcaf5b306a534473607a674f43507f6ab0cc..fd4a6ca666b54bed8da7c7da3979a63292656750 100644 --- a/forward_form.php +++ b/forward_form.php @@ -72,8 +72,8 @@ class pdfannotator_forward_form extends moodleform { $mform->addRule('recipients', get_string('recipientrequired', 'pdfannotator'), 'required', null, 'client'); // Textarea for message to the recipient. - $mform->addElement('textarea', 'message', get_string('messageforwardform', 'pdfannotator'), - wrap="virtual" rows="5" cols="109"'); + $mform->addElement('textarea', 'message', get_string('messageforwardform', 'pdfannotator'), + 'wrap="virtual" rows="5" cols="109"'); // Add submit and cancel buttons. $this->add_action_buttons($cancel = true, get_string('send', 'pdfannotator')); diff --git a/index.php b/index.php index 1cce2bca00dd316d411f56630a6c260e6bd8e404..250a547303b023e335de773a5c33e25919bd7cc8 100644 --- a/index.php +++ b/index.php @@ -146,4 +146,4 @@ foreach ($pdfannotators as $pdfannotator) { echo html_writer::table($table); -echo $OUTPUT->footer(); \ No newline at end of file +echo $OUTPUT->footer(); diff --git a/lang/en/pdfannotator.php b/lang/en/pdfannotator.php index 533a49d7ce44760a886c623805e4b0206623f107..f06bb514fe77b5479915be0bf6cb63b8a9c84e77 100644 --- a/lang/en/pdfannotator.php +++ b/lang/en/pdfannotator.php @@ -17,7 +17,7 @@ /** * @package mod_pdfannotator * @copyright 2018 RWTH Aachen (see README.md) - * @author Rabea de Groot, Anna Heynkes, Friederike Schwager + * @author Rabea de Groot, Anna Heynkes, Friederike Schwager * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * */ diff --git a/lib.php b/lib.php index 060c37a01efd10d604fabab58b39cb2e1cc95e4b..85b043354928d729c4780059063ae35b34b6ca71 100644 --- a/lib.php +++ b/lib.php @@ -16,7 +16,7 @@ /** * @package mod_pdfannotator * @copyright 2018 RWTH Aachen (see README.md) - * @author Ahmad Obeid, Rabea de Groot, Anna Heynkes + * @author Ahmad Obeid, Rabea de Groot, Anna Heynkes * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die; @@ -28,12 +28,18 @@ defined('MOODLE_INTERNAL') || die; */ function pdfannotator_supports($feature) { switch($feature) { - case FEATURE_GROUPS: return true; - case FEATURE_GROUPINGS: return true; - case FEATURE_MOD_INTRO: return true; - case FEATURE_COMPLETION_TRACKS_VIEWS: return true; - case FEATURE_BACKUP_MOODLE2: return true; - case FEATURE_SHOW_DESCRIPTION: return true; + case FEATURE_GROUPS: + return true; + case FEATURE_GROUPINGS: + return true; + case FEATURE_MOD_INTRO: + return true; + case FEATURE_COMPLETION_TRACKS_VIEWS: + return true; + case FEATURE_BACKUP_MOODLE2: + return true; + case FEATURE_SHOW_DESCRIPTION: + return true; default: return null; @@ -608,7 +614,7 @@ function pdfannotator_get_recent_mod_activity(&$activities, &$index, $timestart, $printposts = array(); $context = context_course::instance($courseid); foreach ($posts as $post) { - if(!pdfannotator_can_see_comment($post, $context)) { + if (!pdfannotator_can_see_comment($post, $context)) { continue; } $printposts[] = $post; diff --git a/locallib.php b/locallib.php index 6a31d5743e41fe67ce5dcec8aaa8ceeba1752bbd..e01ead40fbb9f04fb43f5ed0d45cbc418a404a2e 100644 --- a/locallib.php +++ b/locallib.php @@ -16,7 +16,7 @@ /** * @package mod_pdfannotator * @copyright 2018 RWTH Aachen (see README) - * @author Rabea de Groot, Anna Heynkes, Friederike Schwager + * @author Rabea de Groot, Anna Heynkes, Friederike Schwager * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -1805,4 +1805,4 @@ function pdfannotator_count_answers($annotationid, $context) { $count++; } return $count; -} \ No newline at end of file +} diff --git a/mod_form.php b/mod_form.php index 5a831b318577b6524d412e22d9aae1bf1b7af465..cf4f7fd94375fea90a074517ecb8c18cc40b93ec 100644 --- a/mod_form.php +++ b/mod_form.php @@ -65,7 +65,8 @@ class mod_pdfannotator_mod_form extends moodleform_mod { $filemanageroptions['maxfiles'] = 1; // Upload only one file. $filemanageroptions['mainfile'] = true; - $mform->addElement('filemanager', 'files', get_string('setting_fileupload', 'pdfannotator'), null, $filemanageroptions); // Params: 1. type of the element, 2. (html) elementname, 3. label. + $mform->addElement('filemanager', 'files', get_string('setting_fileupload', 'pdfannotator'), null, + $filemanageroptions); // Params: 1. type of the element, 2. (html) elementname, 3. label. $mform->addHelpButton('files', 'setting_fileupload', 'pdfannotator'); $mform->addElement('advcheckbox', 'usevotes', get_string('setting_usevotes', 'pdfannotator'), @@ -87,22 +88,26 @@ class mod_pdfannotator_mod_form extends moodleform_mod { $mform->addHelpButton('use_studentdrawing', 'setting_use_studentdrawing', 'pdfannotator'); // XXX second checkbox or change to select. - $mform->addElement('advcheckbox', 'useprint', get_string('setting_useprint_document', 'pdfannotator'), get_string('useprint', 'pdfannotator'), null, array(0, 1)); + $mform->addElement('advcheckbox', 'useprint', get_string('setting_useprint_document', 'pdfannotator'), + get_string('useprint', 'pdfannotator'), null, array(0, 1)); $mform->setType('useprint', PARAM_BOOL); $mform->setDefault('useprint', $config->useprint); $mform->addHelpButton('useprint', 'setting_useprint_document', 'pdfannotator'); - $mform->addElement('advcheckbox', 'useprintcomments', get_string('setting_useprint_comments', 'pdfannotator'), get_string('useprint_comments', 'pdfannotator'), null, array(0, 1)); + $mform->addElement('advcheckbox', 'useprintcomments', get_string('setting_useprint_comments', 'pdfannotator'), + get_string('useprint_comments', 'pdfannotator'), null, array(0, 1)); $mform->setType('useprintcomments', PARAM_BOOL); $mform->setDefault('useprintcomments', $config->useprintcomments); $mform->addHelpButton('useprintcomments', 'setting_useprint_comments', 'pdfannotator'); - $mform->addElement('advcheckbox', 'useprivatecomments', get_string('setting_use_private_comments', 'pdfannotator'), get_string('use_private_comments', 'pdfannotator'), null, array(0, 1)); + $mform->addElement('advcheckbox', 'useprivatecomments', get_string('setting_use_private_comments', 'pdfannotator'), + get_string('use_private_comments', 'pdfannotator'), null, array(0, 1)); $mform->setType('useprivatecomments', PARAM_BOOL); $mform->setDefault('useprivatecomments', $config->use_private_comments); $mform->addHelpButton('useprivatecomments', 'setting_use_private_comments', 'pdfannotator'); - $mform->addElement('advcheckbox', 'useprotectedcomments', get_string('setting_use_protected_comments', 'pdfannotator'), get_string('use_protected_comments', 'pdfannotator'), null, array(0, 1)); + $mform->addElement('advcheckbox', 'useprotectedcomments', get_string('setting_use_protected_comments', 'pdfannotator'), + get_string('use_protected_comments', 'pdfannotator'), null, array(0, 1)); $mform->setType('useprotectedcomments', PARAM_BOOL); $mform->setDefault('useprotectedcomments', $config->use_protected_comments); $mform->addHelpButton('useprotectedcomments', 'setting_use_protected_comments', 'pdfannotator'); diff --git a/model/annotation.class.php b/model/annotation.class.php index 0eebb9089d62cadf1061806bb5f5a3d47533cc4e..fb416f45a29c60556da8efd58ccc8b7b8acd9456 100644 --- a/model/annotation.class.php +++ b/model/annotation.class.php @@ -22,7 +22,7 @@ * * @package mod_pdfannotator * @copyright 2018 RWTH Aachen (see README.md) - * @author Rabea de Groot, Anna Heynkes and Friederike Schwager + * @author Rabea de Groot, Anna Heynkes and Friederike Schwager * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * */ @@ -163,7 +163,8 @@ class pdfannotator_annotation { } else if (($author !== $userid) || !$deleteown) { $result[] = false; $result[] = get_string('onlyDeleteOwnAnnotations', 'pdfannotator'); - } else if ($DB->record_exists_select('pdfannotator_comments', "annotationid = ? AND userid != ?", [$annotation->id, $userid])) { // Check whether other people have commented this annotation.) + } else if ($DB->record_exists_select('pdfannotator_comments', "annotationid = ? AND userid != ?", + [$annotation->id, $userid])) { // Check whether other people have commented this annotation. $result[] = false; $result[] = get_string('onlyDeleteUncommentedPosts', 'pdfannotator'); } else { @@ -191,7 +192,8 @@ class pdfannotator_annotation { } if (!$editownpost || $USER->id != self::get_author($annotationid)) { return false; - } else if ($DB->record_exists_select('pdfannotator_comments', "annotationid = ? AND userid != ?", array($annotationid, $USER->id))) { + } else if ($DB->record_exists_select('pdfannotator_comments', "annotationid = ? AND userid != ?", + array($annotationid, $USER->id))) { // Annotation was answered by other users. return false; } diff --git a/model/comment.class.php b/model/comment.class.php index df5dd1f1d3f396439e54a3e0769af4de314eafe3..b282c6b31cc66c444e17a36245b3fae0c7ba89c7 100644 --- a/model/comment.class.php +++ b/model/comment.class.php @@ -16,7 +16,7 @@ /** * @package mod_pdfannotator * @copyright 2018 RWTH Aachen (see README.md) - * @author Rabea de Groot, Anna Heynkes and Friederike Schwager + * @author Rabea de Groot, Anna Heynkes and Friederike Schwager * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * */ @@ -109,16 +109,19 @@ class pdfannotator_comment { '&annoid=' . $annotationid . '&commid=' . $commentuuid; $messagetext = new stdClass(); - $messagetext->text = pdfannotator_format_notification_message_text($course, $cm, $context, get_string('modulename', 'pdfannotator'), $modulename, $question, 'newquestion'); + $messagetext->text = pdfannotator_format_notification_message_text($course, $cm, $context, + get_string('modulename', 'pdfannotator'), $modulename, $question, 'newquestion'); $messagetext->url = $question->urltoanswer; foreach ($recipients as $recipient) { - if (!pdfannotator_can_see_comment($datarecord, $context) ){ + if (!pdfannotator_can_see_comment($datarecord, $context)) { continue; } if ($recipient->id == $USER->id) { continue; } - $messagetext->html = pdfannotator_format_notification_message_html($course, $cm, $context, get_string('modulename', 'pdfannotator'), $modulename, $question, 'newquestion', $recipient->id); + $messagetext->html = pdfannotator_format_notification_message_html($course, $cm, $context, + get_string('modulename', 'pdfannotator'), $modulename, $question, 'newquestion', + $recipient->id); $messageid = pdfannotator_notify_manager($recipient, $course, $cm, 'newquestion', $messagetext, $anonymous); } @@ -143,10 +146,12 @@ class pdfannotator_comment { global $DB, $USER; // Get the ids and text content of all comments attached to this annotation/highlight. - $sql = "SELECT c.id, c.content, c.userid, c.visibility, c.isquestion, c.isdeleted, c.ishidden, c.timecreated, c.timemodified, c.modifiedby, c.solved, c.annotationid, SUM(vote) AS votes " + $sql = "SELECT c.id, c.content, c.userid, c.visibility, c.isquestion, c.isdeleted, c.ishidden, c.timecreated, " + . "c.timemodified, c.modifiedby, c.solved, c.annotationid, SUM(vote) AS votes " . "FROM {pdfannotator_comments} c LEFT JOIN {pdfannotator_votes} v" . " ON c.id=v.commentid WHERE annotationid = ?" - . " GROUP BY c.id, c.content, c.userid, c.visibility, c.isquestion, c.isdeleted, c.ishidden, c.timecreated, c.timemodified, c.modifiedby, c.solved, c.annotationid" + . " GROUP BY c.id, c.content, c.userid, c.visibility, c.isquestion, c.isdeleted, c.ishidden, c.timecreated, " + . "c.timemodified, c.modifiedby, c.solved, c.annotationid" . " ORDER BY c.timecreated"; $a = array(); $a[] = $annotationid; @@ -466,7 +471,7 @@ class pdfannotator_comment { if ($DB->record_exists('pdfannotator_subscriptions', array('annotationid' => $annotationid, 'userid' => $USER->id))) { return false; } - + $comment = $DB->get_record('pdfannotator_comments', array('annotationid' => $annotationid, 'isquestion' => '1')); if (!pdfannotator_can_see_comment($comment, $context)) { return false; @@ -476,7 +481,6 @@ class pdfannotator_comment { $datarecord->annotationid = $annotationid; $datarecord->userid = $USER->id; - $subscriptionid = $DB->insert_record('pdfannotator_subscriptions', $datarecord, $returnid = true); return $subscriptionid; } diff --git a/renderer.php b/renderer.php index 113be11088b2f731f0c62d4bc8a30ae753d2a11c..4174c281282b3016a5630276d895561604e35c74 100644 --- a/renderer.php +++ b/renderer.php @@ -17,7 +17,7 @@ /** * @package mod_pdfannotator * @copyright 2018 RWTH Aachen (see README.md) - * @author Rabea de Groot and Anna Heynkes + * @author Rabea de Groot and Anna Heynkes * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * */ diff --git a/version.php b/version.php index 3b233a9e38179dae4029ede35208f838b30eded1..93bb2d721e31179fec6d3307cade2c3c8cb1c83a 100644 --- a/version.php +++ b/version.php @@ -13,6 +13,7 @@ // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. + /** * Version information for mod/pdfannotator * diff --git a/view.php b/view.php index 93409b6a5355927ca1289b20835160313103ddf8..d51af8fb53f39b935873a9d655f7e185b8ec472c 100644 --- a/view.php +++ b/view.php @@ -16,7 +16,7 @@ /** * @package mod_pdfannotator * @copyright 2018 RWTH Aachen (see README.md) - * @author Ahmad Obeid, Anna Heynkes + * @author Ahmad Obeid, Anna Heynkes * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require('../../config.php');