Gitlab CSE Unil

Commit 9e4edd46 authored by M. Chardon's avatar M. Chardon
Browse files

init

parents
pix/select.png

216 Bytes

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="-3 -0.4 16 16" preserveAspectRatio="xMinYMid meet" overflow="visible"><path d="M8.1 14.1l-2-4.5L9.4 9c.5-.1.6-.4.2-.8L.7.2C.3-.2 0 0 0 .5v11.9c0 .5.4.7.8.4l2.6-2 2 4.5c.1.3.4.4.7.3l1.8-.8c.2-.2.3-.5.2-.7z" fill="#999"/></svg>
\ No newline at end of file
pix/stamp.png

200 Bytes

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" preserveAspectRatio="xMinYMid meet" overflow="visible"><path d="M15 16H1v-1h14v1zm-1-6H9.2C9.1 9.2 9 8.4 9 7.9c0-1.8 2-3.5 2-4.9 0-1.7-1.3-3-3-3S5 1.3 5 3c0 1.4 1.9 3.2 2 4.9 0 .5 0 1.2-.1 2.1H2c-1.1 0-2 .9-2 2v2h16v-2c0-1.1-.9-2-2-2z" fill="#999"/></svg>
\ No newline at end of file
pix/trash.png

164 Bytes

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" preserveAspectRatio="xMinYMid meet" overflow="visible"><path d="M2 5v9c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V5H2zm3 8.5c0 .3-.2.5-.5.5s-.5-.2-.5-.5v-6c0-.3.2-.5.5-.5s.5.2.5.5v6zm3.5 0c0 .3-.2.5-.5.5s-.5-.2-.5-.5v-6c0-.3.2-.5.5-.5s.5.2.5.5v6zm3.5 0c0 .3-.2.5-.5.5s-.5-.2-.5-.5v-6c0-.3.2-.5.5-.5s.5.2.5.5v6zM0 4c0-1.1.9-2 2-2h4c0-1.1.9-2 2-2s2 .9 2 2h4c1.1 0 2 .9 2 2H0z" fill="#999"/></svg>
\ No newline at end of file
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Settings for assignfeedback PDF plugin
*
* @package assignfeedback_editpdfplus
* @copyright 2013 Davo Smith
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// Stamp files setting.
$name = 'assignfeedback_editpdfplus/stamps';
$title = get_string('stamps','assignfeedback_editpdfplus');
$description = get_string('stampsdesc', 'assignfeedback_editpdfplus');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'stamps', 0,
array('maxfiles' => 8, 'accepted_types' => array('image')));
$settings->add($setting);
// Ghostscript setting.
$systempathslink = new moodle_url('/admin/settings.php', array('section' => 'systempaths'));
$systempathlink = html_writer::link($systempathslink, get_string('systempaths', 'admin'));
$settings->add(new admin_setting_heading('pathtogs', get_string('pathtogs', 'admin'),
get_string('pathtogspathdesc', 'assignfeedback_editpdfplus', $systempathlink)));
$url = new moodle_url('/mod/assign/feedback/editpdfplus/testgs.php');
$link = html_writer::link($url, get_string('testgs', 'assignfeedback_editpdfplus'));
$settings->add(new admin_setting_heading('testgs', '', $link));
// Unoconv setting.
$systempathslink = new moodle_url('/admin/settings.php', array('section' => 'systempaths'));
$systempathlink = html_writer::link($systempathslink, get_string('systempaths', 'admin'));
$settings->add(new admin_setting_heading('pathtounoconv', get_string('pathtounoconv', 'admin'),
get_string('pathtounoconvpathdesc', 'assignfeedback_editpdfplus', $systempathlink)));
$url = new moodle_url('/mod/assign/feedback/editpdfplus/testunoconv.php');
$link = html_writer::link($url, get_string('test_unoconv', 'assignfeedback_editpdfplus'));
$settings->add(new admin_setting_heading('test_unoconv', '', $link));
\ No newline at end of file
.assignfeedback_editpdfplus_widget .toolbar ul {
display: none;
}
.assignfeedback_editpdfplus_widget .toolbar li {
list-style-type: none;
}
.assignfeedback_editpdfplus_widget .drawingcanvas {
position: relative;
min-width: 817px;
min-height: 400px;
cursor: crosshair;
background-repeat: no-repeat;
background-color: #ccc;
margin-left: auto;
margin-right: auto;
box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 20px rgba(0,0,0,.2);
}
.assignfeedback_editpdfplus_widget .moodle-dialogue-bd .drawingregion {
position: inherit;
}
.assignfeedback_editpdfplus_widget .drawingregion[data-currenttool=drag] .drawingcanvas {
cursor: move;
}
.assignfeedback_editpdfplus_widget .drawingregion[data-currenttool=select] .drawingcanvas {
cursor: pointer;
}
.assignfeedback_editpdfplus_widget .drawingregion {
border: 1px solid #ccc;
left: 1em;
right: 1em;
top: 52px;
bottom: 0px;
position: absolute;
overflow: auto;
background-color: #ccc;
}
.assignfeedback_editpdfplus_widget {
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
}
.assignfeedback_editpdfplus_widget .pageheader {
background-color: #ebebeb;
border-bottom: 1px solid #cccccc;
padding: 0px;
padding-left: 20px;
padding-right: 20px;
min-height: 50px;
height: 52px;
overflow: auto;
}
.moodle-dialogue-base .moodle-dialogue.assignfeedback_editpdfplus_widget .moodle-dialogue-bd {
padding: 0px;
}
.assignfeedback_editpdfplus_widget .assignfeedback_editpdfplus_unsavedchanges.haschanges{
display: inline-block;
}
.assignfeedback_editpdfplus_widget .assignfeedback_editpdfplus_unsavedchanges {
display: none;
position: absolute;
left: 20px;
top: 60px;
}
.dir-rtl .assignfeedback_editpdfplus_widget .assignfeedback_editpdfplus_unsavedchanges {
float: right;
}
.yui3-colourpicker-hidden,
.yui3-commentsearch-hidden,
.yui3-commentmenu-hidden {
display: none;
}
.assignfeedback_editpdfplus_widget .pageheader button img {
padding-top: 3px;
vertical-align: top;
}
.assignfeedback_editpdfplus_widget .pageheader button:active {
background-color: #ccc;
}
.assignfeedback_editpdfplus_widget .pageheader select,
.assignfeedback_editpdfplus_widget .pageheader button {
background: none;
padding: 4px 7px;
border: 0px;
border-radius: 0px;
margin: 0px;
height: 30px;
line-height: 30px;
vertical-align: top;
cursor: pointer;
}
.assignfeedback_editpdfplus_widget .pageheader select {
vertical-align: top;
-webkit-appearance: none;
-moz-appearance: menulist-text;
background-color: #fff;
padding: 0px 10px;
}
.assignfeedback_editpdfplus_widget .pageheader select::-ms-expand {
display: none;
}
.assignfeedback_editpdfplus_widget .pageheader .navigation button + button,
.assignfeedback_editpdfplus_widget .pageheader .toolbar button + button,
.assignfeedback_editpdfplus_widget .pageheader .navigation select + button,
.assignfeedback_editpdfplus_widget .pageheader .toolbar select + button {
border-left: 1px solid #cccccc;
border-right: 0px;
}
.assignfeedback_editpdfplus_widget .pageheader .navigation button {
border-right: 1px solid #cccccc;
}
.assignfeedback_editpdfplus_widget .pageheader .toolbar,
.assignfeedback_editpdfplus_widget .pageheader .navigation-search,
.assignfeedback_editpdfplus_widget .pageheader .navigation {
border: 1px solid #cccccc;
border-bottom-color: #b3b3b3;
border-radius: 4px;
margin: 10px 4px;
background-color: white;
height: 30px;
line-height: 30px;
padding: 0px;
}
.assignfeedback_editpdfplus_commentsearch ul {
max-height: 400px;
overflow-y: auto;
padding: 1em;
}
.assignfeedback_editpdfplus_commentsearch ul li pre {
background-color: #efefef;
}
.assignfeedback_editpdfplus_commentsearch ul li pre:hover {
background-color: #ddd;
}
.assignfeedback_editpdfplus_commentsearch ul li {
line-height: 0px;
margin: 2px;
}
.assignfeedback_editpdfplus_commentsearch a pre {
font-family: helvetica;
margin: 0px;
padding: 4px;
}
.assignfeedback_editpdfplus_widget .navigation-search,
.assignfeedback_editpdfplus_widget .navigation {
float: left;
}
.dir-rtl .assignfeedback_editpdfplus_widget .navigation-search,
.dir-rtl .assignfeedback_editpdfplus_widget .navigation {
float: right;
}
.assignfeedback_editpdfplus_widget .toolbar button {
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
}
.assignfeedback_editpdfplus_widget .toolbar {
float: right;
}
.dir-rtl .assignfeedback_editpdfplus_widget .toolbar {
float: left;
}
.assignfeedback_editpdfplus_widget .navigation,
.assignfeedback_editpdfplus_widget .navigation-search,
.assignfeedback_editpdfplus_widget .toolbar {
display: inline-block;
}
.assignfeedback_editpdfplus_colourpicker ul {
margin: 0px;
}
.assignfeedback_editpdfplus_commentmenu li.quicklist_comment {
width: 150px;
}
.assignfeedback_editpdfplus_commentmenu li.quicklist_comment a {
white-space: nowrap;
display: inline-block;
max-width: 130px;
overflow: hidden;
text-overflow: ellipsis;
}
.assignfeedback_editpdfplus_commentmenu a.delete_quicklist_comment {
float: right;
}
.dir-rtl .assignfeedback_editpdfplus_commentmenu a.delete_quicklist_comment {
float: left;
}
.assignfeedback_editpdfplus_dropdown button {
border: 0px;
background: none;
padding: 6px 7px;
border-radius: 0px;
border-top: 1px solid #cccccc;
}
.assignfeedback_editpdfplus_dropdown li:first-child button {
border-top: 0px;
}
.moodle-dialogue-base .moodle-dialogue.assignfeedback_editpdfplus_dropdown .moodle-dialogue-wrap {
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
border-radius: 4px;
}
.moodle-dialogue-base .moodle-dialogue.assignfeedback_editpdfplus_dropdown .moodle-dialogue-bd {
padding: 0px;
}
.assignfeedback_editpdfplus_dropdown .moodle-dialogue-hd,
.assignfeedback_editpdfplus_dropdown .moodle-dialogue-ft {
display: none;
}
.assignfeedback_editpdfplus_menu li hr {
margin: 0px;
}
.assignfeedback_editpdfplus_menu li a {
text-decoration: none;
color: #555;
margin: 10px;
}
.assignfeedback_editpdfplus_menu li:hover,
.assignfeedback_editpdfplus_menu li:hover a,
.assignfeedback_editpdfplus_menu li a:hover {
background-color: #ebebeb;
background-image: radial-gradient(ellipse at center, #ffffff 60%,#dfdfdf 100%);
}
ul.assignfeedback_editpdfplus_menu {
margin: 0px;
}
.assignfeedback_editpdfplus_menu li {
list-style-type: none;
margin: 0px;
border-radius: 4px;
}
.assignfeedback_editpdfplus_menu li img {
height: auto;
}
.assignfeedback_editpdfplus_menu li button {
margin: 0px;
background: none;
}
.assignfeedback_editpdfplus_widget .pageheader button:hover {
background-color: #ebebeb;
background-image: radial-gradient(ellipse at center, #ffffff 60%,#dfdfdf 100%);
}
.assignfeedback_editpdfplus_widget .pageheader button.assignfeedback_editpdfplus_selectedbutton:hover,
.assignfeedback_editpdfplus_widget .pageheader button.assignfeedback_editpdfplus_selectedbutton {
background-color: #dfdfdf;
background-image: radial-gradient(ellipse at center, #ffffff 40%,#dfdfdf 100%);
}
.assignfeedback_editpdfplus_widget .commentdrawable img {
padding: 1px;
}
.assignfeedback_editpdfplus_widget .commentdrawable a {
float: right;
position: relative;
left: -17px;
top: 2px;
height: 14px;
background-color: white;
border-left: 1px solid #ccc;
border-bottom: 1px solid #ccc;
line-height: 14px;
}
.dir-rtl .assignfeedback_editpdfplus_widget .commentdrawable a {
float: left;
left: none;
right: -17px;
border-left: 0px;
border-right: 1px solid #ccc;
}
.assignfeedback_editpdfplus_widget .commentdrawable textarea {
padding: 4px;
padding-right: 20px;
resize: none;
overflow: hidden;
color: black;
border: 2px solid #ccc;
border-radius: 4px;
font-size: 16px;
font-family: helvetica;
min-height: 1.2em;
}
.assignfeedback_editpdfplus_widget .commentdrawable {
display: inline-block;
}
.dir-rtl .assignfeedback_editpdfplus_widget .commentdrawable textarea {
padding-left: 20px;
padding-right: 4px;
}
.assignfeedback_editpdfplus_widget .drawingcanvas .loading .progressbarlabel {
text-align: center;
}
.hideoverflow {
overflow: hidden;
position: relative;
}
@media (max-width: 960px) {
.assignfeedback_editpdfplus_widget .pageheader {
height: 104px;
}
.assignfeedback_editpdfplus_widget .drawingregion {
top: 104px;
}
}
@media (max-width: 767px) {
.assignfeedback_editpdfplus_widget .drawingregion {
position: relative;
margin-bottom: 1em;
top: 0;
}
.assignfeedback_editpdfplus_widget .pageheader {
height: auto;
}
}
@media (max-width: 480px) {
.assignfeedback_editpdfplus_widget .pageheader {
padding-left: 5px;
padding-right: 5px;
}
}
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Test that ghostscript is configured correctly
*
* @package assignfeedback_editpdfplus
* @copyright 2013 Davo Smith
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require('../../../../config.php');
global $PAGE, $OUTPUT;
$PAGE->set_url(new moodle_url('/mod/assign/feedback/editpdfplus/testgs.php'));
$PAGE->set_context(context_system::instance());
require_login();
require_capability('moodle/site:config', context_system::instance());
$strheading = get_string('testgs', 'assignfeedback_editpdfplus');
$PAGE->navbar->add(get_string('administrationsite'));
$PAGE->navbar->add(get_string('plugins', 'admin'));
$PAGE->navbar->add(get_string('assignmentplugins', 'mod_assign'));
$PAGE->navbar->add(get_string('feedbackplugins', 'mod_assign'));
$PAGE->navbar->add(get_string('pluginname', 'assignfeedback_editpdfplus'), new moodle_url('/admin/settings.php?section=assignfeedback_editpdfplus'));
$PAGE->navbar->add($strheading);
$PAGE->set_heading($strheading);
$PAGE->set_title($strheading);
if (optional_param('sendimage', false, PARAM_BOOL)) {
// Serve the generated test image.
assignfeedback_editpdfplus\pdf::send_test_image();
die();
}
$result = assignfeedback_editpdfplus\pdf::test_gs_path();
switch ($result->status) {
case assignfeedback_editpdfplus\pdf::GSPATH_OK:
$msg = get_string('test_ok', 'assignfeedback_editpdfplus');
$msg .= html_writer::empty_tag('br');
$imgurl = new moodle_url($PAGE->url, array('sendimage' => 1));
$msg .= html_writer::empty_tag('img', array('src' => $imgurl, 'alt' => get_string('gsimage', 'assignfeedback_editpdfplus')));
break;
case assignfeedback_editpdfplus\pdf::GSPATH_ERROR:
$msg = $result->message;
break;
default:
$msg = get_string("test_{$result->status}", 'assignfeedback_editpdfplus');
break;
}
$returl = new moodle_url('/admin/settings.php', array('section' => 'assignfeedback_editpdfplus'));
$msg .= $OUTPUT->continue_button($returl);
echo $OUTPUT->header();
echo $OUTPUT->box($msg, 'generalbox ');
echo $OUTPUT->footer();
@mod @mod_assign @assignfeedback @assignfeedback_editpdfplus @_file_upload
Feature: In an assignment, teacher can annotate PDF files during grading
In order to provide visual report on a graded PDF
As a teacher
I need to use the PDF editor
@javascript
Scenario: Submit a PDF file as a student and annotate the PDF as a teacher
Given ghostscript is installed
And the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I navigate to "Annotate PDF" node in "Site administration > Plugins > Activity modules > Assignment > Feedback plugins"
And I upload "pix/help.png" file to "" filemanager
And I upload "pix/docs.png" file to "" filemanager
When I press "Save changes"
Then I should see "Changes saved"
And I follow "Test ghostscript path"
And I should see "The ghostscript path appears to be OK"
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Submit your PDF file |
| assignsubmission_file_enabled | 1 |
| Maximum number of uploaded files | 2 |
And I log out
And I log in as "student1"
And I follow "Course 1"
And I follow "Test assignment name"
And I press "Add submission"
And I upload "mod/assign/feedback/editpdfplus/tests/fixtures/submission.pdf" file to "File submissions" filemanager
And I upload "mod/assign/feedback/editpdfplus/tests/fixtures/testgs.pdf" file to "File submissions" filemanager
And I press "Save changes"
And I should see "Submitted for grading"
And I should see "submission.pdf"
And I should see "Not graded"
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "Edit" "link" in the "Submitted for grading" "table_row"
And I click on "Grade" "link" in the "Submitted for grading" "table_row"
And I should see "Page 1 of 3"
And I click on ".navigate-next-button" "css_element"
And I should see "Page 2 of 3"
And I click on ".stampbutton" "css_element"
And I click on ".linebutton" "css_element"
And I click on ".commentcolourbutton" "css_element"
And I click on "//img[@alt=\"Blue\"]/parent::button" "xpath_element"
And I wait until the page is ready
And I press "Save changes"
And I wait until the page is ready
And I should see "The changes to the grade and feedback were saved"
@javascript
Scenario: Submit a PDF file as a student in a team and annotate the PDF as a teacher
Given ghostscript is installed
And the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
| student3 | Student | 3 | student3@example.com |
| student4 | Student | 4 | student4@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
And the following "groups" exist:
| name | course | idnumber |
| G1 | C1 | G1 |
| G2 | C1 | G2 |
And the following "groupings" exist:
| name | course | idnumber |
| G1 | C1 | G1 |
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G1 |
| student3 | G2 |
| student4 | G2 |
And the following "grouping groups" exist:
| grouping | group |
| G1 | G1 |
| G1 | G2 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Submit your PDF file |
| assignsubmission_file_enabled | 1 |
| Maximum number of uploaded files | 2 |
| Students submit in groups | Yes |
| Grouping for student groups | G1 |
And I log out
When I log in as "student1"
And I follow "Course 1"
And I follow "Test assignment name"
And I press "Add submission"
And I upload "mod/assign/feedback/editpdfplus/tests/fixtures/submission.pdf" file to "File submissions" filemanager
And I press "Save changes"
Then I should see "Submitted for grading"
And I should see "submission.pdf"
And I should see "Not graded"
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment name"
And I follow "View all submissions"
And I click on "Edit" "link" in the "Student 2" "table_row"