Gitlab CSE Unil

Commit fb969cff authored by M. Chardon's avatar M. Chardon
Browse files

ajout fonctionnalité pour ne pas écraser les modif des étudiants

parent e000eadd
...@@ -4,11 +4,11 @@ This plugin is a fork of assignfeedback_editpdf, and is developed and maintained ...@@ -4,11 +4,11 @@ This plugin is a fork of assignfeedback_editpdf, and is developed and maintained
Author: Marion Chardon, <marion.chardon@unil.ch> Author: Marion Chardon, <marion.chardon@unil.ch>
Compatible with Moodle versions: 3.3, 3.5, 3.7 Compatible with Moodle versions: 3.3, 3.5, 3.6, 3.7
Note: Note:
- for 3.3, please check tag "3.3", not master version. - for 3.3, please check tag "3.3", not master version.
- for 3.5, please check branch "mdl_3.5", not master version. - for 3.5/3.6, please check branch "mdl_3.5", not master version.
## Description ## Description
......
<?php <?php
// This file is part of Moodle - http://moodle.org/ // This file is part of Moodle - http://moodle.org/
// //
// Moodle is free software: you can redistribute it and/or modify // Moodle is free software: you can redistribute it and/or modify
...@@ -92,13 +93,19 @@ class annotation { ...@@ -92,13 +93,19 @@ class annotation {
/** @var string pdfdisplay */ /** @var string pdfdisplay */
public $pdfdisplay = "footnote"; public $pdfdisplay = "footnote";
/** @var int draft */
public $draft = 1;
/** @var int draft_id */
public $draft_id = null;
/** /**
* Convert a compatible stdClass into an instance of this class. * Convert a compatible stdClass into an instance of this class.
* @param stdClass $record * @param stdClass $record
*/ */
public function __construct(\stdClass $record = null) { public function __construct(\stdClass $record = null) {
if ($record) { if ($record) {
$intcols = array('endx', 'endy', 'x', 'y'); $intcols = array('endx', 'endy', 'x', 'y', 'draft_id');
foreach ($this as $key => $value) { foreach ($this as $key => $value) {
if (isset($record->$key)) { if (isset($record->$key)) {
if (in_array($key, $intcols)) { if (in_array($key, $intcols)) {
...@@ -120,4 +127,23 @@ class annotation { ...@@ -120,4 +127,23 @@ class annotation {
return $this->textannot && !$this->parent_annot; return $this->textannot && !$this->parent_annot;
} }
public function clone_teacher_annotation($annotationRef) {
$this->x = $annotationRef->x;
$this->endx = $annotationRef->endx;
$this->y = $annotationRef->y;
$this->endy = $annotationRef->endy;
$this->cartridgex = $annotationRef->cartridgex;
$this->cartridgey = $annotationRef->cartridgey;
$this->path = $annotationRef->path;
$this->toolid = $annotationRef->toolid;
$this->textannot = $annotationRef->textannot;
$this->colour = $annotationRef->colour;
$this->displaylock = $annotationRef->displaylock;
$this->displayrotation = $annotationRef->displayrotation;
$this->borderstyle = $annotationRef->borderstyle;
$this->parent_annot = $annotationRef->parent_annot;
$this->answerrequested = $annotationRef->answerrequested;
$this->pdfdisplay = $annotationRef->pdfdisplay;
}
} }
...@@ -250,39 +250,85 @@ class page_editor { ...@@ -250,39 +250,85 @@ class page_editor {
* @return int - the number of annotations. * @return int - the number of annotations.
*/ */
public static function set_annotations($gradeid, $pageno, $annotations) { public static function set_annotations($gradeid, $pageno, $annotations) {
global $DB; global $CFG, $DB;
$annotationsRelease = $DB->get_records(self::BDDTABLEANNOTATION, array(self::GRADEID => $gradeid, self::DRAFLIB => 1));
$DB->delete_records(self::BDDTABLEANNOTATION, array(self::GRADEID => $gradeid, 'pageno' => $pageno, self::DRAFLIB => 1));
$added = 0; $added = 0;
if (!$annotationsRelease || sizeof($annotationsRelease) == 0 || $CFG->preserve_student_on_update == 0) {
$DB->delete_records(self::BDDTABLEANNOTATION, array(self::GRADEID => $gradeid, 'pageno' => $pageno, self::DRAFLIB => 1));
$annotationdiv = array(); $annotationdiv = array();
foreach ($annotations as $record) { foreach ($annotations as $record) {
$currentdiv = $record->divcartridge; $currentdiv = $record->divcartridge;
if ($record->parent_annot_div != '') { $newid = self::create_annotation_for_draft($record, $annotationdiv, $gradeid, $pageno);
//on est dans le cas d'une annotation liee if ($newid) {
$idparent = $annotationdiv[$record->parent_annot_div]; if ($currentdiv != '') {
$record->parent_annot = intval($idparent); $annotationdiv[$currentdiv] = $newid;
} }
// Force these. $added++;
if (!($record instanceof annotation)) {
$annotation = new annotation($record);
} else {
$annotation = $record;
} }
$annotation->gradeid = $gradeid; }
$annotation->pageno = $pageno; } else {
$annotation->draft = 1; $draftid = [];
$newid = self::add_annotation($annotation); foreach ($annotations as $record) {
if (!$record->id) {
$currentdiv = $record->divcartridge;
$newid = self::create_annotation_for_draft($record, $annotationdiv, $gradeid, $pageno);
if ($newid) { if ($newid) {
if ($currentdiv != '') { if ($currentdiv != '') {
$annotationdiv[$currentdiv] = $newid; $annotationdiv[$currentdiv] = $newid;
} }
$added++; $added++;
} }
continue;
}
$annotationDraft = self::get_annotation($record->id);
//maj annotation
$annotationDraft->clone_teacher_annotation($record);
$DB->update_record(self::BDDTABLEANNOTATION, $annotationDraft);
$added++;
$draftid[] = $annotationDraft->id;
}
foreach ($annotationsRelease as $annotation) {
if (in_array($annotation->id, $draftid)) {
continue;
}
//need to be deleted
self::remove_annotation($annotation->id);
}
} }
return $added; return $added;
} }
/**
* create an annotation for a draft
* @param annotation|record $annotationRecord annotation to create
* @param array $annotationdiv array with parent's annotation's id
* @param type $gradeid grade id
* @param type $pageno page no
* @return int new annotation id
*/
private static function create_annotation_for_draft($annotationRecord, $annotationdiv, $gradeid, $pageno) {
if ($annotationRecord->parent_annot_div != '') {
//on est dans le cas d'une annotation liee
$idparent = $annotationdiv[$annotationRecord->parent_annot_div];
$annotationRecord->parent_annot = intval($idparent);
}
// Force these.
if (!($annotationRecord instanceof annotation)) {
$annotation = new annotation($annotationRecord);
} else {
$annotation = $annotationRecord;
}
$annotation->gradeid = $gradeid;
$annotation->pageno = $pageno;
$annotation->draft = 1;
return self::add_annotation($annotation);
}
/** /**
* Update a set of annotations to database * Update a set of annotations to database
* @global $DB * @global $DB
...@@ -328,7 +374,7 @@ class page_editor { ...@@ -328,7 +374,7 @@ class page_editor {
public static function unrelease_drafts($gradeid) { public static function unrelease_drafts($gradeid) {
global $DB; global $DB;
// Delete the non-draft annotations and comments. // Delete the non-draft annotations.
return $DB->delete_records(self::BDDTABLEANNOTATION, array(self::GRADEID => $gradeid, self::DRAFLIB => 0)); return $DB->delete_records(self::BDDTABLEANNOTATION, array(self::GRADEID => $gradeid, self::DRAFLIB => 0));
} }
...@@ -338,29 +384,79 @@ class page_editor { ...@@ -338,29 +384,79 @@ class page_editor {
* @return bool * @return bool
*/ */
public static function release_drafts($gradeid) { public static function release_drafts($gradeid) {
global $DB; global $CFG, $DB;
// Delete the previous non-draft annotations and comments. $annotationsRelease = $DB->get_records(self::BDDTABLEANNOTATION, array(self::GRADEID => $gradeid, self::DRAFLIB => 0));
$parentlink = [];
if (!$annotationsRelease || sizeof($annotationsRelease) == 0 || $CFG->preserve_student_on_update == 0) {
// Delete the previous non-draft annotations.
$DB->delete_records(self::BDDTABLEANNOTATION, array(self::GRADEID => $gradeid, self::DRAFLIB => 0)); $DB->delete_records(self::BDDTABLEANNOTATION, array(self::GRADEID => $gradeid, self::DRAFLIB => 0));
// Copy all the draft annotations and comments to non-drafts. // Copy all the draft annotations to non-drafts.
$parentlink = [];
$records = $DB->get_records(self::BDDTABLEANNOTATION, array(self::GRADEID => $gradeid, self::DRAFLIB => 1)); $records = $DB->get_records(self::BDDTABLEANNOTATION, array(self::GRADEID => $gradeid, self::DRAFLIB => 1));
foreach ($records as $record) { foreach ($records as $record) {
$oldid = $record->id; $newid = $this->create_annotation_for_release($record, $parentlink);
unset($record->id); $parentlink[$oldid] = $newid;
$record->draft = 0; }
$oldparentrecord = $record->parent_annot; } else {
if ($record->parent_annot > 0) { $records = $DB->get_records(self::BDDTABLEANNOTATION, array(self::GRADEID => $gradeid, self::DRAFLIB => 1));
$record->parent_annot = $parentlink[$record->parent_annot]; $draftid = [];
// update existing annotations
foreach ($annotationsRelease as $annotation) {
$annotationDraft = self::get_annotation($annotation->draft_id);
//if no result, annotation has been deleted
if (!$annotationDraft) {
self::remove_annotation($annotation->id);
continue;
}
//maj annotation
$annotation = new annotation($annotation);
$annotation->clone_teacher_annotation($annotationDraft);
$DB->update_record(self::BDDTABLEANNOTATION, $annotation);
$parentlink[$annotation->draft_id] = $annotation->id;
$draftid[] = $annotation->draft_id;
}
//create only new annotations
foreach ($records as $record) {
if (in_array($record->id, $draftid)) {
continue;
} }
$newid = $DB->insert_record(self::BDDTABLEANNOTATION, $record); //need to be created
$newid = self::create_annotation_for_release($record, $parentlink);
$parentlink[$oldid] = $newid; $parentlink[$oldid] = $newid;
} }
}
return true; return true;
} }
/**
* create an annotation for a release draft
* @param annotation|record $annotationRecord annotation to create
* @param array $parentlink array with parent's annotation's id
* @return int new annotation id
*/
private static function create_annotation_for_release($annotationRecord, $parentlink) {
$oldid = $annotationRecord->id;
unset($annotationRecord->id);
$annotationRecord->draft = 0;
$annotationRecord->draft_id = $oldid;
if ($annotationRecord->parent_annot > 0) {
$annotationRecord->parent_annot = $parentlink[$annotationRecord->parent_annot];
}
// Force these.
if (!($annotationRecord instanceof annotation)) {
$annotation = new annotation($annotationRecord);
} else {
$annotation = $annotationRecord;
}
return self::add_annotation($annotation);
}
/** /**
* Has annotations or comments. * Has annotations or comments.
* @param int $gradeid * @param int $gradeid
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<FIELD NAME="borderstyle" TYPE="char" LENGTH="20" NOTNULL="false" SEQUENCE="false"/> <FIELD NAME="borderstyle" TYPE="char" LENGTH="20" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="parent_annot" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/> <FIELD NAME="parent_annot" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="pdfdisplay" TYPE="char" LENGTH="20" NOTNULL="false"/> <FIELD NAME="pdfdisplay" TYPE="char" LENGTH="20" NOTNULL="false"/>
<FIELD NAME="draft_id" TYPE="int" LENGTH="10" NOTNULL="false"/>
</FIELDS> </FIELDS>
<KEYS> <KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/> <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
......
...@@ -370,5 +370,17 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) { ...@@ -370,5 +370,17 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2019061201, 'assignfeedback', 'editpdfplus'); upgrade_plugin_savepoint(true, 2019061201, 'assignfeedback', 'editpdfplus');
} }
if ($oldversion < 2019070100) {
/* annotation table */
$table = new xmldb_table('assignfeedback_editpp_annot');
$field = new xmldb_field('draft_id', XMLDB_TYPE_INTEGER, '10', null, false);
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// Editpdfplus savepoint reached.
upgrade_plugin_savepoint(true, 2019070100, 'assignfeedback', 'editpdfplus');
}
return true; return true;
} }
...@@ -205,3 +205,7 @@ $string['delete_model_question'] = 'Do you want to delete this model?'; ...@@ -205,3 +205,7 @@ $string['delete_model_question'] = 'Do you want to delete this model?';
$string['feedback_configuration'] = 'Feedback: configuration'; $string['feedback_configuration'] = 'Feedback: configuration';
$string['axis_label'] = 'Name'; $string['axis_label'] = 'Name';
$string['axis_add'] = 'Add a new axis'; $string['axis_add'] = 'Add a new axis';
$string['erase_student_annotation'] = 'Student\'s modifications';
$string['erase_student_annotation_desc'] = 'Student\'s modifications on annotations update';
$string['erase_student_on_update'] = 'Preserve student\'s modifications on annotations update';
$string['erase_student_on_update_desc'] = 'Preserve student\'s modifications on annotations update, default false';
\ No newline at end of file
...@@ -204,3 +204,5 @@ $string['delete_model_question'] = 'Êtes-vous sûr de vouloir supprimer ce mode ...@@ -204,3 +204,5 @@ $string['delete_model_question'] = 'Êtes-vous sûr de vouloir supprimer ce mode
$string['feedback_configuration'] = 'Feedback : configuration'; $string['feedback_configuration'] = 'Feedback : configuration';
$string['axis_label'] = 'Nom'; $string['axis_label'] = 'Nom';
$string['axis_add'] = 'Add a new axis'; $string['axis_add'] = 'Add a new axis';
$string['erase_student_on_update'] = 'Erase student\'s modifications on annotations update';
$string['erase_student_on_update_desc'] = 'Erase student\'s modifications on annotations update, default true';
<?php <?php
// This file is part of Moodle - http://moodle.org/ // This file is part of Moodle - http://moodle.org/
// //
// Moodle is free software: you can redistribute it and/or modify // Moodle is free software: you can redistribute it and/or modify
...@@ -22,7 +23,6 @@ ...@@ -22,7 +23,6 @@
* The code is based on mod/assign/feedback/editpdf/settings.php by Davo Smith. * The code is based on mod/assign/feedback/editpdf/settings.php by Davo Smith.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
// Enabled by default. // Enabled by default.
...@@ -44,41 +44,44 @@ $url = new moodle_url('/mod/assign/feedback/editpdfplus/testgs.php'); ...@@ -44,41 +44,44 @@ $url = new moodle_url('/mod/assign/feedback/editpdfplus/testgs.php');
$link = html_writer::link($url, get_string('testgs', 'assignfeedback_editpdfplus')); $link = html_writer::link($url, get_string('testgs', 'assignfeedback_editpdfplus'));
$settings->add(new admin_setting_heading('testgs', '', $link)); $settings->add(new admin_setting_heading('testgs', '', $link));
$settings->add(new admin_setting_heading('erase_student_annotation', get_string('erase_student_annotation', 'assignfeedback_editpdfplus'), get_string('erase_student_annotation_desc', 'assignfeedback_editpdfplus')));
$settings->add(new admin_setting_configcheckbox('preserve_student_on_update', get_string('erase_student_on_update', 'assignfeedback_editpdfplus'), get_string('erase_student_on_update_desc', 'assignfeedback_editpdfplus'), 0));
//$settings->add(new admin_setting_configtext("unsetting", "le nom ici", "description", 50, PARAM_INT, 20)); //$settings->add(new admin_setting_configtext("unsetting", "le nom ici", "description", 50, PARAM_INT, 20));
$settings->add(new admin_setting_heading('highlightplus',get_string('typetool_highlightplus','assignfeedback_editpdfplus'),get_string('typetool_highlightplus_desc','assignfeedback_editpdfplus'))); $settings->add(new admin_setting_heading('highlightplus', get_string('typetool_highlightplus', 'assignfeedback_editpdfplus'), get_string('typetool_highlightplus_desc', 'assignfeedback_editpdfplus')));
//$settings->add(new admin_setting_configcheckbox('highlightplus_configurable',get_string('is_not_configurable','assignfeedback_editpdfplus'),get_string('is_not_configurable_desc','assignfeedback_editpdfplus'),0)); //$settings->add(new admin_setting_configcheckbox('highlightplus_configurable',get_string('is_not_configurable','assignfeedback_editpdfplus'),get_string('is_not_configurable_desc','assignfeedback_editpdfplus'),0));
$settings->add(new admin_setting_configcolourpicker('highlightplus_color',get_string('adminplugin_color','assignfeedback_editpdfplus'),get_string('adminplugin_color_desc','assignfeedback_editpdfplus'),'#FFFF40')); $settings->add(new admin_setting_configcolourpicker('highlightplus_color', get_string('adminplugin_color', 'assignfeedback_editpdfplus'), get_string('adminplugin_color_desc', 'assignfeedback_editpdfplus'), '#FFFF40'));
$settings->add(new admin_setting_configcolourpicker('highlightplus_cartridge_color',get_string('adminplugin_cartridge_color','assignfeedback_editpdfplus'),get_string('adminplugin_cartridge_color_desc','assignfeedback_editpdfplus'),'#FF6F40')); $settings->add(new admin_setting_configcolourpicker('highlightplus_cartridge_color', get_string('adminplugin_cartridge_color', 'assignfeedback_editpdfplus'), get_string('adminplugin_cartridge_color_desc', 'assignfeedback_editpdfplus'), '#FF6F40'));
$settings->add(new admin_setting_configtext('highlightplus_cartridge_x',get_string('adminplugin_cartridge_x','assignfeedback_editpdfplus'),get_string('adminplugin_cartridge_x_desc','assignfeedback_editpdfplus'),0)); $settings->add(new admin_setting_configtext('highlightplus_cartridge_x', get_string('adminplugin_cartridge_x', 'assignfeedback_editpdfplus'), get_string('adminplugin_cartridge_x_desc', 'assignfeedback_editpdfplus'), 0));
$settings->add(new admin_setting_configtext('highlightplus_cartridge_y',get_string('adminplugin_cartridge_y','assignfeedback_editpdfplus'),get_string('adminplugin_cartridge_y_desc','assignfeedback_editpdfplus'),-24)); $settings->add(new admin_setting_configtext('highlightplus_cartridge_y', get_string('adminplugin_cartridge_y', 'assignfeedback_editpdfplus'), get_string('adminplugin_cartridge_y_desc', 'assignfeedback_editpdfplus'), -24));
$settings->add(new admin_setting_heading('stampplus',get_string('typetool_stampplus','assignfeedback_editpdfplus'),get_string('typetool_stampplus_desc','assignfeedback_editpdfplus'))); $settings->add(new admin_setting_heading('stampplus', get_string('typetool_stampplus', 'assignfeedback_editpdfplus'), get_string('typetool_stampplus_desc', 'assignfeedback_editpdfplus')));
//$settings->add(new admin_setting_configcheckbox('stampplus_configurable',get_string('is_not_configurable','assignfeedback_editpdfplus'),get_string('is_not_configurable_desc','assignfeedback_editpdfplus'),0)); //$settings->add(new admin_setting_configcheckbox('stampplus_configurable',get_string('is_not_configurable','assignfeedback_editpdfplus'),get_string('is_not_configurable_desc','assignfeedback_editpdfplus'),0));
$settings->add(new admin_setting_configcolourpicker('stampplus_color',get_string('adminplugin_color','assignfeedback_editpdfplus'),get_string('adminplugin_color_desc','assignfeedback_editpdfplus'),'#FF0000')); $settings->add(new admin_setting_configcolourpicker('stampplus_color', get_string('adminplugin_color', 'assignfeedback_editpdfplus'), get_string('adminplugin_color_desc', 'assignfeedback_editpdfplus'), '#FF0000'));
$settings->add(new admin_setting_heading('frame',get_string('typetool_frame','assignfeedback_editpdfplus'),get_string('typetool_frame_desc','assignfeedback_editpdfplus'))); $settings->add(new admin_setting_heading('frame', get_string('typetool_frame', 'assignfeedback_editpdfplus'), get_string('typetool_frame_desc', 'assignfeedback_editpdfplus')));
//$settings->add(new admin_setting_configcheckbox('frame_configurable',get_string('is_not_configurable','assignfeedback_editpdfplus'),get_string('is_not_configurable_desc','assignfeedback_editpdfplus'),0)); //$settings->add(new admin_setting_configcheckbox('frame_configurable',get_string('is_not_configurable','assignfeedback_editpdfplus'),get_string('is_not_configurable_desc','assignfeedback_editpdfplus'),0));
$settings->add(new admin_setting_configtext('frame_cartridge_x',get_string('adminplugin_cartridge_x','assignfeedback_editpdfplus'),get_string('adminplugin_cartridge_x_desc','assignfeedback_editpdfplus'),5)); $settings->add(new admin_setting_configtext('frame_cartridge_x', get_string('adminplugin_cartridge_x', 'assignfeedback_editpdfplus'), get_string('adminplugin_cartridge_x_desc', 'assignfeedback_editpdfplus'), 5));
$settings->add(new admin_setting_configtext('frame_cartridge_y',get_string('adminplugin_cartridge_y','assignfeedback_editpdfplus'),get_string('adminplugin_cartridge_y_desc','assignfeedback_editpdfplus'),-8)); $settings->add(new admin_setting_configtext('frame_cartridge_y', get_string('adminplugin_cartridge_y', 'assignfeedback_editpdfplus'), get_string('adminplugin_cartridge_y_desc', 'assignfeedback_editpdfplus'), -8));
$settings->add(new admin_setting_heading('verticalline',get_string('typetool_verticalline','assignfeedback_editpdfplus'),get_string('typetool_verticalline_desc','assignfeedback_editpdfplus'))); $settings->add(new admin_setting_heading('verticalline', get_string('typetool_verticalline', 'assignfeedback_editpdfplus'), get_string('typetool_verticalline_desc', 'assignfeedback_editpdfplus')));
//$settings->add(new admin_setting_configcheckbox('verticalline_configurable',get_string('is_not_configurable','assignfeedback_editpdfplus'),get_string('is_not_configurable_desc','assignfeedback_editpdfplus'),0)); //$settings->add(new admin_setting_configcheckbox('verticalline_configurable',get_string('is_not_configurable','assignfeedback_editpdfplus'),get_string('is_not_configurable_desc','assignfeedback_editpdfplus'),0));
$settings->add(new admin_setting_configcolourpicker('verticalline_color',get_string('adminplugin_color','assignfeedback_editpdfplus'),get_string('adminplugin_color_desc','assignfeedback_editpdfplus'),'#0000FF')); $settings->add(new admin_setting_configcolourpicker('verticalline_color', get_string('adminplugin_color', 'assignfeedback_editpdfplus'), get_string('adminplugin_color_desc', 'assignfeedback_editpdfplus'), '#0000FF'));
$settings->add(new admin_setting_configcolourpicker('verticalline_cartridge_color',get_string('adminplugin_cartridge_color','assignfeedback_editpdfplus'),get_string('adminplugin_cartridge_color_desc','assignfeedback_editpdfplus'),'#0000FF')); $settings->add(new admin_setting_configcolourpicker('verticalline_cartridge_color', get_string('adminplugin_cartridge_color', 'assignfeedback_editpdfplus'), get_string('adminplugin_cartridge_color_desc', 'assignfeedback_editpdfplus'), '#0000FF'));
$settings->add(new admin_setting_configtext('verticalline_cartridge_x',get_string('adminplugin_cartridge_x','assignfeedback_editpdfplus'),get_string('adminplugin_cartridge_x_desc','assignfeedback_editpdfplus'),5)); $settings->add(new admin_setting_configtext('verticalline_cartridge_x', get_string('adminplugin_cartridge_x', 'assignfeedback_editpdfplus'), get_string('adminplugin_cartridge_x_desc', 'assignfeedback_editpdfplus'), 5));
$settings->add(new admin_setting_configtext('verticalline_cartridge_y',get_string('adminplugin_cartridge_y','assignfeedback_editpdfplus'),get_string('adminplugin_cartridge_y_desc','assignfeedback_editpdfplus'),0)); $settings->add(new admin_setting_configtext('verticalline_cartridge_y', get_string('adminplugin_cartridge_y', 'assignfeedback_editpdfplus'), get_string('adminplugin_cartridge_y_desc', 'assignfeedback_editpdfplus'), 0));
$settings->add(new admin_setting_heading('stampcomment',get_string('typetool_stampcomment','assignfeedback_editpdfplus'),get_string('typetool_stampcomment_desc','assignfeedback_editpdfplus'))); $settings->add(new admin_setting_heading('stampcomment', get_string('typetool_stampcomment', 'assignfeedback_editpdfplus'), get_string('typetool_stampcomment_desc', 'assignfeedback_editpdfplus')));
//$settings->add(new admin_setting_configcheckbox('stampcomment_configurable',get_string('is_not_configurable','assignfeedback_editpdfplus'),get_string('is_not_configurable_desc','assignfeedback_editpdfplus'),0)); //$settings->add(new admin_setting_configcheckbox('stampcomment_configurable',get_string('is_not_configurable','assignfeedback_editpdfplus'),get_string('is_not_configurable_desc','assignfeedback_editpdfplus'),0));
//$settings->add(new admin_setting_configcolourpicker('stampcomment_color',get_string('adminplugin_color','assignfeedback_editpdfplus'),get_string('adminplugin_color_desc','assignfeedback_editpdfplus'),'#000099')); //$settings->add(new admin_setting_configcolourpicker('stampcomment_color',get_string('adminplugin_color','assignfeedback_editpdfplus'),get_string('adminplugin_color_desc','assignfeedback_editpdfplus'),'#000099'));
$settings->add(new admin_setting_configcolourpicker('stampcomment_cartridge_color',get_string('adminplugin_cartridge_color','assignfeedback_editpdfplus'),get_string('adminplugin_cartridge_color_desc','assignfeedback_editpdfplus'),'#000099')); $settings->add(new admin_setting_configcolourpicker('stampcomment_cartridge_color', get_string('adminplugin_cartridge_color', 'assignfeedback_editpdfplus'), get_string('adminplugin_cartridge_color_desc', 'assignfeedback_editpdfplus'), '#000099'));
$settings->add(new admin_setting_configtext('stampcomment_cartridge_x',get_string('adminplugin_cartridge_x','assignfeedback_editpdfplus'),get_string('adminplugin_cartridge_x_desc','assignfeedback_editpdfplus'),35)); $settings->add(new admin_setting_configtext('stampcomment_cartridge_x', get_string('adminplugin_cartridge_x', 'assignfeedback_editpdfplus'), get_string('adminplugin_cartridge_x_desc', 'assignfeedback_editpdfplus'), 35));
$settings->add(new admin_setting_configtext('stampcomment_cartridge_y',get_string('adminplugin_cartridge_y','assignfeedback_editpdfplus'),get_string('adminplugin_cartridge_y_desc','assignfeedback_editpdfplus'),6)); $settings->add(new admin_setting_configtext('stampcomment_cartridge_y', get_string('adminplugin_cartridge_y', 'assignfeedback_editpdfplus'), get_string('adminplugin_cartridge_y_desc', 'assignfeedback_editpdfplus'), 6));
$settings->add(new admin_setting_heading('commentplus',get_string('typetool_commentplus','assignfeedback_editpdfplus'),get_string('typetool_commentplus_desc','assignfeedback_editpdfplus'))); $settings->add(new admin_setting_heading('commentplus', get_string('typetool_commentplus', 'assignfeedback_editpdfplus'), get_string('typetool_commentplus_desc', 'assignfeedback_editpdfplus')));
//$settings->add(new admin_setting_configcheckbox('commentplus_configurable',get_string('is_not_configurable','assignfeedback_editpdfplus'),get_string('is_not_configurable_desc','assignfeedback_editpdfplus'),0)); //$settings->add(new admin_setting_configcheckbox('commentplus_configurable',get_string('is_not_configurable','assignfeedback_editpdfplus'),get_string('is_not_configurable_desc','assignfeedback_editpdfplus'),0));
$settings->add(new admin_setting_configcolourpicker('commentplus_cartridge_color',get_string('adminplugin_cartridge_color','assignfeedback_editpdfplus'),get_string('adminplugin_cartridge_color_desc','assignfeedback_editpdfplus'),'#000000')); $settings->add(new admin_setting_configcolourpicker('commentplus_cartridge_color', get_string('adminplugin_cartridge_color', 'assignfeedback_editpdfplus'), get_string('adminplugin_cartridge_color_desc', 'assignfeedback_editpdfplus'), '#000000'));
$settings->add(new admin_setting_configtext('commentplus_cartridge_x',get_string('adminplugin_cartridge_x','assignfeedback_editpdfplus'),get_string('adminplugin_cartridge_x_desc','assignfeedback_editpdfplus'),35)); $settings->add(new admin_setting_configtext('commentplus_cartridge_x', get_string('adminplugin_cartridge_x', 'assignfeedback_editpdfplus'), get_string('adminplugin_cartridge_x_desc', 'assignfeedback_editpdfplus'), 35));
$settings->add(new admin_setting_configtext('commentplus_cartridge_y',get_string('adminplugin_cartridge_y','assignfeedback_editpdfplus'),get_string('adminplugin_cartridge_y_desc','assignfeedback_editpdfplus'),6)); $settings->add(new admin_setting_configtext('commentplus_cartridge_y', get_string('adminplugin_cartridge_y', 'assignfeedback_editpdfplus'), get_string('adminplugin_cartridge_y_desc', 'assignfeedback_editpdfplus'), 6));
//get_config("ass:::", "unsetting") //get_config("ass:::", "unsetting")
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->version = 2019061203; $plugin->version = 2019070100;
$plugin->requires = 2019051100; // Moodle 3.7 $plugin->requires = 2019051100; // Moodle 3.7
$plugin->maturity = MATURITY_STABLE; $plugin->maturity = MATURITY_STABLE;
$plugin->release = "2.3.2 (Build: 2019061203)"; $plugin->release = "2.3.3 (Build: 2019070100)";
$plugin->component = 'assignfeedback_editpdfplus'; $plugin->component = 'assignfeedback_editpdfplus';
...@@ -834,6 +834,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -834,6 +834,7 @@ Y.extend(ANNOTATION, Y.Base, {
clean: function () { clean: function () {
if (this.parent_annot_element) { if (this.parent_annot_element) {
return { return {
id: this.id,
gradeid: this.gradeid, gradeid: this.gradeid,
x: parseInt(this.x, 10), x: parseInt(this.x, 10),
y: parseInt(this.y, 10), y: parseInt(this.y, 10),
...@@ -856,6 +857,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -856,6 +857,7 @@ Y.extend(ANNOTATION, Y.Base, {
}; };
} }
return { return {
id: this.id,
gradeid: this.gradeid, gradeid: this.gradeid,
x: parseInt(this.x, 10), x: parseInt(this.x, 10),
y: parseInt(this.y, 10), y: parseInt(this.y, 10),
......
...@@ -834,6 +834,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -834,6 +834,7 @@ Y.extend(ANNOTATION, Y.Base, {
clean: function () { clean: function () {
if (this.parent_annot_element) { if (this.parent_annot_element) {
return { return {
id: this.id,
gradeid: this.gradeid, gradeid: this.gradeid,
x: parseInt(this.x, 10), x: parseInt(this.x, 10),
y: parseInt(this.y, 10), y: parseInt(this.y, 10),
...@@ -856,6 +857,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -856,6 +857,7 @@ Y.extend(ANNOTATION, Y.Base, {
}; };
} }
return { return {
id: this.id,
gradeid: this.gradeid, gradeid: this.gradeid,
x: parseInt(this.x, 10), x: parseInt(this.x, 10),
y: parseInt(this.y, 10), y: parseInt(this.y, 10),
......
...@@ -302,6 +302,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -302,6 +302,7 @@ Y.extend(ANNOTATION, Y.Base, {
clean: function () { clean: function () {
if (this.parent_annot_element) { if (this.parent_annot_element) {
return { return {
id: this.id,
gradeid: this.gradeid, gradeid: this.gradeid,
x: parseInt(this.x, 10), x: parseInt(this.x, 10),
y: parseInt(this.y, 10), y: parseInt(this.y, 10),
...@@ -324,6 +325,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -324,6 +325,7 @@ Y.extend(ANNOTATION, Y.Base, {
}; };
} }
return { return {
id: this.id,
gradeid: this.gradeid, gradeid: this.gradeid,
x: parseInt(this.x, 10), x: parseInt(this.x, 10),
y: parseInt(this.y, 10),