Gitlab CSE Unil

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

- renommage editpdf -> editpdfplus

- correction copyright
parent cc3565d7
......@@ -17,6 +17,10 @@
/**
* This file contains the editor class for the assignfeedback_editpdfplus plugin
*
* This class performs crud operations on colors.
*
* No capability checks are done - they should be done by the calling class.
*
* @package assignfeedback_editpdfplus
* @copyright 2018 Université de Lausanne
......@@ -25,15 +29,6 @@
namespace assignfeedback_editpdfplus;
/**
* This class performs crud operations on colors.
*
* No capability checks are done - they should be done by the calling class.
*
* @package assignfeedback_editpdfplus
* @copyright 2018 Marion Chardon
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class utils_color {
const DEFAULTCOLOR = "default";
......
......@@ -17,6 +17,12 @@
/**
* This file contains the editor class for the assignfeedback_editpdfplus plugin
*
* This class performs crud operations on stamp using font FontAwesome.
*
* No capability checks are done - they should be done by the calling class.
*
* Inspired by https://github.com/exiang/php-font-awesome-to-png
*
* @package assignfeedback_editpdfplus
* @copyright 2018 Université de Lausanne
......@@ -27,17 +33,6 @@ namespace assignfeedback_editpdfplus;
use \assignfeedback_editpdfplus\utils_color;
/**
* This class performs crud operations on stamp using font FontAwesome.
*
* No capability checks are done - they should be done by the calling class.
*
* Inspired by https://github.com/exiang/php-font-awesome-to-png
*
* @package assignfeedback_editpdfplus
* @copyright 2018 Marion Chardon
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class utils_stamp {
/** Path of fontawesome font scss */
......
......@@ -17,20 +17,16 @@
/**
* This file contains the definition for the library class for edit PDF renderer.
*
* A custom renderer class that extends the plugin_renderer_base and is used by the editpdfplus feedback plugin.
*
* @package assignfeedback_editpdfplus
* @copyright 2016 Université de Lausanne
* The code is based on mod/assign/feedback/editpdf/classes/widget.php by Davo Smith.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* A custom renderer class that extends the plugin_renderer_base and is used by the editpdf feedback plugin.
*
* @package assignfeedback_editpdfplus
* @copyright 2013 Davo Smith
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class assignfeedback_editpdfplus_widget implements renderable {
/** @var int $assignment - Assignment instance id */
......
......@@ -15,11 +15,12 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* EditPDF event handler definition.
* EditPDFplus event handler definition.
*
* @package assignfeedback_editpdfplus
* @category event
* @copyright 2016 Damyon Wiese
* @copyright 2016 Université de Lausanne
* The code is based on mod/assign/feedback/editpdf/db/events.php by Damyon Wiese.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
......
......@@ -15,11 +15,12 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Definition of editpdf scheduled tasks.
* Definition of editpdfplus scheduled tasks.
*
* @package assignfeedback_editpdfplus
* @category task
* @copyright 2016 Damyon Wiese
* @copyright 2016 Université de Lausanne
* The code is based on mod/assign/feedback/editpdf/db/tasks.php by Damyon Wiese.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
......
......@@ -19,7 +19,8 @@
* Upgrade code for the feedback_editpdfplus module.
*
* @package assignfeedback_editpdfplus
* @copyright 2013 Jerome Mouneyrac
* @copyright 2016 Université de Lausanne
* The code is based on mod/assign/feedback/editpdf/db/upgrade.php by Jerome Mouneyrac.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
......@@ -28,7 +29,7 @@ defined('MOODLE_INTERNAL') || die();
use assignfeedback_editpdfplus\bdd\type_tool;
/**
* EditPDF upgrade code
* EditPDFplus upgrade code
* @param int $oldversion
* @return bool
*/
......@@ -56,7 +57,7 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
$dbman->create_table($table);
}
// Editpdf savepoint reached.
// Editpdfplus savepoint reached.
upgrade_plugin_savepoint(true, 2016021600, 'assignfeedback', 'editpdfplus');
}
......@@ -73,7 +74,7 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
$file->delete();
}
// Editpdf savepoint reached.
// Editpdfplus savepoint reached.
upgrade_plugin_savepoint(true, 2017022700, 'assignfeedback', 'editpdfplus');
}
......@@ -106,7 +107,7 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
$typeTool5->configurable = 0;
$DB->update_record('assignfeedback_editpp_typet', $typeTool5);
// Editpdf savepoint reached.
// Editpdfplus savepoint reached.
upgrade_plugin_savepoint(true, 2017071202, 'assignfeedback', 'editpdfplus');
}
......@@ -152,7 +153,7 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
// Execute DB update for assign instances.
$DB->execute($sql, $params);
// Editpdf savepoint reached.
// Editpdfplus savepoint reached.
upgrade_plugin_savepoint(true, 2017081306, 'assignfeedback', 'editpdfplus');
}
......@@ -210,7 +211,7 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
// Execute DB update for assign instances.
$DB->execute($sql, []);
// Editpdf savepoint reached.
// Editpdfplus savepoint reached.
upgrade_plugin_savepoint(true, 2017081601, 'assignfeedback', 'editpdfplus');
}
......
......@@ -19,6 +19,7 @@
*
* @package assignfeedback_editpdfplus
* @copyright 2016 Université de Lausanne
* The code is based on mod/assign/feedback/editpdf/lang/en/assignfeedback_editpdf.php by Davo Smith.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
......@@ -47,8 +48,8 @@ $string['downloadfeedback'] = 'Download feedback PDF';
$string['drag'] = 'Drag';
$string['errorgenerateimage'] = 'Error generating image with ghostscript, debugging info: {$a}';
$string['errorpdfpage'] = 'There was an error while generating this page.';
$string['editpdf'] = 'Annotate PDF advanced';
$string['editpdf_help'] = 'Annotate students submissions directly in the browser and produce an edited downloadable PDF.';
$string['editpdfplus'] = 'Annotate PDF advanced';
$string['editpdfplus_help'] = 'Annotate students submissions directly in the browser and produce an edited downloadable PDF.';
$string['enabled'] = 'Annotate PDF advanced';
$string['enabled_help'] = 'If enabled, the teacher will be able to create annotated PDF files when marking the assignments. This allows the teacher to add comments, drawing and stamps directly on top of the students work. The annotating is done in the browser and no extra software is required.';
$string['filter'] = 'Filter comments...';
......
......@@ -47,8 +47,8 @@ $string['downloadfeedback'] = 'Download feedback PDF';
$string['drag'] = 'Glisser';
$string['errorgenerateimage'] = 'Error generating image with ghostscript, debugging info: {$a}';
$string['errorpdfpage'] = 'Il y a eu une erreur pendant la génération de cette page.';
$string['editpdf'] = 'Annotation PDF avancé';
$string['editpdf_help'] = 'Annotate students submissions directly in the browser and produce an edited downloadable PDF.';
$string['editpdfplus'] = 'Annotation PDF avancé';
$string['editpdfplus_help'] = 'Annotate students submissions directly in the browser and produce an edited downloadable PDF.';
$string['enabled'] = 'Annotation PDF avancé';
$string['enabled_help'] = 'If enabled, the teacher will be able to create annotated PDF files when marking the assignments. This allows the teacher to add comments, drawing and stamps directly on top of the students work. The annotating is done in the browser and no extra software is required.';
$string['filter'] = 'Filter comments...';
......
......@@ -19,7 +19,8 @@
* This file contains the version information for the comments feedback plugin
*
* @package assignfeedback_editpdfplus
* @copyright 2012 Davo Smith
* @copyright 2016 Université de Lausanne
* The code is based on mod/assign/feedback/editpdf/lib.php by Davo Smith.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
......
......@@ -18,9 +18,11 @@
/**
* This file contains the definition for the library class for PDF feedback plugin
*
* library class for editpdfplus feedback plugin extending feedback plugin base class
*
* @package assignfeedback_editpdfplus
* @copyright 2016 Université de Lausanne
* The code is based on mod/assign/feedback/editpdf/locallib.php by Davo Smith.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
......@@ -28,13 +30,6 @@ defined('MOODLE_INTERNAL') || die();
use \assignfeedback_editpdfplus\document_services;
use \assignfeedback_editpdfplus\page_editor;
/**
* library class for editpdf feedback plugin extending feedback plugin base class
*
* @package assignfeedback_editpdfplus
* @copyright 2012 Davo Smith
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class assign_feedback_editpdfplus extends assign_feedback_plugin {
const AXISGENERIC = 0;
......@@ -161,11 +156,11 @@ class assign_feedback_editpdfplus extends assign_feedback_plugin {
$html .= '<style>.assignfeedback_editpdfplus_widget { display: none; }</style>';
}
$mform->addElement('static', 'editpdf', get_string('editpdf', 'assignfeedback_editpdfplus'), $html);
$mform->addHelpButton('editpdf', 'editpdf', 'assignfeedback_editpdfplus');
$mform->addElement('hidden', 'editpdf_source_userid', $userid);
$mform->setType('editpdf_source_userid', PARAM_INT);
$mform->setConstant('editpdf_source_userid', $userid);
$mform->addElement('static', 'editpdfplus', get_string('editpdfplus', 'assignfeedback_editpdfplus'), $html);
$mform->addHelpButton('editpdfplus', 'editpdfplus', 'assignfeedback_editpdfplus');
$mform->addElement('hidden', 'editpdfplus_source_userid', $userid);
$mform->setType('editpdfplus_source_userid', PARAM_INT);
$mform->setConstant('editpdfplus_source_userid', $userid);
}
/**
......@@ -180,8 +175,8 @@ class assign_feedback_editpdfplus extends assign_feedback_plugin {
// following users will have the same status. If it's only an individual annotation
// then only one user will come through this method.
// Source user id is only added to the form if there was a pdf.
if (!empty($data->editpdf_source_userid)) {
$sourceuserid = $data->editpdf_source_userid;
if (!empty($data->editpdfplus_source_userid)) {
$sourceuserid = $data->editpdfplus_source_userid;
// Retrieve the grade information for the source user.
$sourcegrade = $this->assignment->get_user_grade($sourceuserid, true, $grade->attemptnumber);
$pagenumbercount = document_services::page_number_for_attempt($this->assignment, $sourceuserid, $sourcegrade->attemptnumber);
......@@ -224,8 +219,8 @@ class assign_feedback_editpdfplus extends assign_feedback_plugin {
*/
public function save(stdClass $grade, stdClass $data) {
// Source user id is only added to the form if there was a pdf.
if (!empty($data->editpdf_source_userid)) {
$sourceuserid = $data->editpdf_source_userid;
if (!empty($data->editpdfplus_source_userid)) {
$sourceuserid = $data->editpdfplus_source_userid;
// Copy drafts annotations and comments if current user is different to sourceuserid.
if ($sourceuserid != $grade->userid) {
page_editor::copy_drafts_from_to($this->assignment, $grade, $sourceuserid);
......@@ -440,7 +435,7 @@ class assign_feedback_editpdfplus extends assign_feedback_plugin {
}
/**
* Automatically hide the setting for the editpdf feedback plugin.
* Automatically hide the setting for the editpdfplus feedback plugin.
*
* @return bool false
*/
......
......@@ -18,7 +18,8 @@
* Settings for assignfeedback PDF plugin
*
* @package assignfeedback_editpdfplus
* @copyright 2013 Davo Smith
* @copyright 2016 Université de Lausanne
* 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
*/
......
......@@ -18,7 +18,8 @@
* Test that ghostscript is configured correctly
*
* @package assignfeedback_editpdfplus
* @copyright 2013 Davo Smith
* @copyright 2016 Université de Lausanne
* The code is based on mod/assign/feedback/editpdf/testgs.php by Davo Smith.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
......
......@@ -16,25 +16,20 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Behat editpdf-related steps definitions.
* Behat editpdfplus-related steps definitions.
*
* Steps definitions related with the editpdfplus.
*
* @package assignfeedback_editpdfplus
* @category test
* @copyright 2013 Jerome Mouneyrac
* @copyright 2016 Université de Lausanne
* The code is based on mod/assign/feedback/editpdf/tests/behat/behat_assignfeedback_editpdf.php by Jerome Mouneyrac.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
require_once(__DIR__ . '/../../../../../../lib/behat/behat_base.php');
/**
* Steps definitions related with the editpdf.
*
* @package assignfeedback_editpdfplus
* @category test
* @copyright 2013 Jerome Mouneyrac
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_assignfeedback_editpdfplus extends behat_base {
/**
......
......@@ -19,7 +19,8 @@
*
* @package assignfeedback_editpdfplus
* @category phpunit
* @copyright 2013 Damyon Wiese
* @copyright 2016 Université de Lausanne
* The code is based on mod/assign/feedback/editpdf/tests/editpdfplus_test.php by Damyon Wiese.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
......@@ -33,12 +34,6 @@ use \assignfeedback_editpdfplus\bdd\annotation;
global $CFG;
require_once($CFG->dirroot . '/mod/assign/tests/generator.php');
/**
* Unit tests for assignfeedback_editpdfplus\comments_quick_list
*
* @copyright 2013 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class assignfeedback_editpdfplus_testcase extends mod_assign_base_testcase {
protected function setUp() {
......@@ -260,7 +255,7 @@ class assignfeedback_editpdfplus_testcase extends mod_assign_base_testcase {
$plugin = $assign->get_feedback_plugin_by_type('editpdf');
$data = new stdClass();
$data->editpdf_source_userid = $this->students[0]->id;
$data->editpdfplus_source_userid = $this->students[0]->id;
$this->assertTrue($plugin->is_feedback_modified($grade, $data));
$plugin->save($grade, $data);
......
......@@ -19,6 +19,7 @@
*
* @package assignfeedback_editpdfplus
* @copyright 2016 Université de Lausanne
* The code is based on mod/assign/feedback/editpdf/version.php by Davo Smith.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
......
......@@ -21,7 +21,7 @@
*/
/**
* Class representing a highlight.
* Class representing an annotation.
*
* @namespace M.assignfeedback_editpdfplus
* @class annotation
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment