Gitlab CSE Unil

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

ajout menu aide pour enseignant lors de la correction

parent 3331e78b
......@@ -127,12 +127,6 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base {
$body = '';
/* $tooglenavigation = html_writer::tag("button", '<span class="navbar-toggler-icon"></span>', array(self::HTMLCLASS => 'navbar-toggler',
'type' => self::HTMLTYPEBUTTON,
'data-toggle' => "collapse",
'data-target' => "#navbarSupportedContent",
'aria-expanded' => "Toggle navigation")); */
// Create the page navigation.
$navigation = '';
// Pick the correct arrow icons for right to left mode.
......@@ -196,12 +190,13 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base {
$statuschoice = $this->render_toolbar(html_writer::select($axis, 'axisselection', 0, FALSE), "mr-0");
$toolbarAxis = $statuschoice;
// Toolbar pour lien creation palette
// Toolbar pour lien creation palette et aide
$courseid = $this->page->course->id;
$lienAdmin = new moodle_url('/mod/assign/feedback/editpdfplus/view_admin.php', array('id' => $courseid));
$toolbarAdmin = $this->render_toolbar_button_html($this->render_toolbar_button_icon("fa-wrench"), array(
self::HTMLCLASS => 'btn btn-info',
self::HTMLCLASS => 'btn btn-outline-info',
'onclick' => "document.location='" . $lienAdmin->out() . "';"));
$toolbarAdmin .= $this->render_toolbar_button_html($this->render_toolbar_button_icon("fa-question-circle"), array(self::HTMLCLASS => 'btn btn-outline-info helpmessage'));
$toolbarAdminBlock = $this->render_toolbar($toolbarAdmin, "mr-3");
} else {
//readonly view
......@@ -238,8 +233,8 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base {
'aria-valuemax' => 100));
$progressbarlabel = html_writer::div(get_string('generatingpdf', self::PLUGIN_NAME), 'progressbarlabel');
$loading = html_writer::div($progressbar . $progressbarlabel, 'loading');
$canvas = html_writer::div(html_writer::div($loading, 'drawingcanvas'), 'drawingregion');
$changesmessage = html_writer::tag('div', get_string('draftchangessaved', self::PLUGIN_NAME), array(
self::HTMLCLASS => 'assignfeedback_editpdfplus_unsavedchanges warning label label-info'
));
......@@ -252,6 +247,13 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base {
$changesmessage2Div = html_writer::div($changesmessage2, 'unsaved-changes');
$canvas .= $changesmessage2Div;
//help message
$helpmessageTitle = html_writer::div(get_string('help_title', self::PLUGIN_NAME), null, array('id' => 'afppHelpmessageTitle'));
$helpmessagecontent=$this->render_from_template('assignfeedback_editpdfplus/help_workspace', array());
$helpmessageBody = html_writer::div($helpmessagecontent, null, array('id' => 'afppHelpmessageBody'));
$helpmessageDiv = html_writer::div($helpmessageTitle . $helpmessageBody, 'helpmessage');
$canvas .= $helpmessageDiv;
$body .= $canvas;
$footer = '';
......
......@@ -176,3 +176,10 @@ $string['adminplugin_cartridge_x'] = 'Horizontal relative offset';
$string['adminplugin_cartridge_x_desc'] = 'Horizontal relative offset of the cartridge relative to the annotation in px';
$string['adminplugin_cartridge_y'] = 'Vertical relative offset';
$string['adminplugin_cartridge_y_desc'] = 'Vertical relative offset of the cartridge relative to the annotation in px';
$string['help_title'] = 'Help';
$string['help_table_titlevisu'] = 'Visual';
$string['help_table_titletype'] = 'Type';
$string['help_table_titleuse'] = 'Use';
$string['help_highlight'] = 'Highlight an item in the document';
$string['help_verticalline'] = 'Click drag a vertical line in the document';
$string['help_stamp'] = 'Click where to place the stamp';
\ No newline at end of file
......@@ -176,5 +176,10 @@ $string['adminplugin_cartridge_x'] = 'Décalage relatif horizontal';
$string['adminplugin_cartridge_x_desc'] = 'Décalage relatif horizontal du cartouche par rapport à l\'annotation en px';
$string['adminplugin_cartridge_y'] = 'Décalage relatif vertical';
$string['adminplugin_cartridge_y_desc'] = 'Décalage relatif vertical du cartouche par rapport à l\'annotation en px';
$string['help_title'] = 'Aide';
$string['help_table_titlevisu'] = 'Visuel';
$string['help_table_titletype'] = 'Type';
$string['help_table_titleuse'] = 'Utilisation';
$string['help_highlight'] = 'Surligner un élément dans le document';
$string['help_verticalline'] = 'Cliquer glisser une ligne verticale dans le document';
$string['help_stamp'] = 'Cliquer à l\'endroit où placer le tampon';
{{!
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/>.
}}
{{!
@template assignfeedback_editpdfplus/help_workspace
Help template to teacher in its correction view. Descibe tools
}}
<table class="table table-striped">
<thead>
<tr>
<th>{{# str }} help_table_titlevisu, assignfeedback_editpdfplus {{/ str }}</th>
<th>{{# str }} help_table_titletype, assignfeedback_editpdfplus {{/ str }}</th>
<th>{{# str }} help_table_titleuse, assignfeedback_editpdfplus {{/ str }}</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;"><button type="button" class="btn"><span style="text-decoration: underline;">TOOL</span></button></td>
<td>{{# str }} typetool_highlightplus, assignfeedback_editpdfplus {{/ str }}</td>
<td>{{# str }} help_highlight, assignfeedback_editpdfplus {{/ str }}</td>
</tr>
<tr>
<td style="text-align: center;"><button type="button" class="btn"><span style="text-decoration: underline;">|TOOL|</span></button></td>
<td>{{# str }} typetool_frame, assignfeedback_editpdfplus {{/ str }}</td>
<td>{{# str }} help_highlight, assignfeedback_editpdfplus {{/ str }}</td>
</tr>
<tr>
<td style="text-align: center;"><button type="button" class="btn">|TOOL</button></td>
<td>{{# str }} typetool_verticalline, assignfeedback_editpdfplus {{/ str }}</td>
<td>{{# str }} help_verticalline, assignfeedback_editpdfplus {{/ str }}</td>
</tr>
<tr>
<td style="text-align: center;"><button type="button" class="btn">TOOL</button></td>
<td>
{{# str }} typetool_stampplus, assignfeedback_editpdfplus {{/ str }}<br/>
{{# str }} typetool_stampcomment, assignfeedback_editpdfplus {{/ str }}<br/>
{{# str }} typetool_commentplus, assignfeedback_editpdfplus {{/ str }}
</td>
<td>{{# str }} help_stamp, assignfeedback_editpdfplus {{/ str }}</td>
</tr>
</tbody>
</table>
\ No newline at end of file
......@@ -39,12 +39,15 @@ var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdfplus/ajax.php',
UNSAVEDCHANGESDIV: '.assignfeedback_editpdfplus_unsavedchanges',
UNSAVEDCHANGESINPUT: 'input[name="assignfeedback_editpdfplus_haschanges"]',
UNSAVEDCHANGESDIVEDIT: '.assignfeedback_editpdfplus_unsavedchanges_edit',
HELPMESSAGETITLE: '#afppHelpmessageTitle',
HELPMESSAGE: '#afppHelpmessageBody',
DIALOGUE: '.' + CSS.DIALOGUE,
CUSTOMTOOLBARID: '#toolbaraxis',
CUSTOMTOOLBARS: '.customtoolbar',
AXISCUSTOMTOOLBAR: '.menuaxisselection',
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton',
GENERICTOOLBARBUTTONS: '.generictoolbarbutton',
HELPBTNCLASS: '.helpmessage',
STATUTSELECTOR: '#menustatutselection',
QUESTIONSELECTOR: '#menuquestionselection',
STUDENTVALIDATION: '#student_valide_button'
......@@ -5597,6 +5600,12 @@ EDITOR.prototype = {
},
context: this
});
//help part
var helpbutton = this.get_dialogue_element(SELECTOR.HELPBTNCLASS);
if (helpbutton) {
helpbutton.on('click', this.display_help_message, this);
}
},
/**
* Re-create new PDF from all fresh data
......@@ -6428,6 +6437,26 @@ EDITOR.prototype = {
for (i = 0; i < this.drawables.length; i++) {
this.drawables[i].scroll_update(x, y);
}
},
/**
* Display a help popup in order to explain tools usability
* @protected
* @method display_help_message
*/
display_help_message: function (event) {
event.preventDefault();
var helptitle = this.get_dialogue_element(SELECTOR.HELPMESSAGETITLE);
var helpbody = this.get_dialogue_element(SELECTOR.HELPMESSAGE);
var helpopup = new M.core.dialogue({
headerContent: helptitle.get('innerHTML'),
bodyContent: helpbody.get('innerHTML'),
modal: true,
width: '840px',
visible: false,
draggable: true});
helpopup.centerDialogue();
helpopup.show();
}
};
......
......@@ -39,12 +39,15 @@ var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdfplus/ajax.php',
UNSAVEDCHANGESDIV: '.assignfeedback_editpdfplus_unsavedchanges',
UNSAVEDCHANGESINPUT: 'input[name="assignfeedback_editpdfplus_haschanges"]',
UNSAVEDCHANGESDIVEDIT: '.assignfeedback_editpdfplus_unsavedchanges_edit',
HELPMESSAGETITLE: '#afppHelpmessageTitle',
HELPMESSAGE: '#afppHelpmessageBody',
DIALOGUE: '.' + CSS.DIALOGUE,
CUSTOMTOOLBARID: '#toolbaraxis',
CUSTOMTOOLBARS: '.customtoolbar',
AXISCUSTOMTOOLBAR: '.menuaxisselection',
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton',
GENERICTOOLBARBUTTONS: '.generictoolbarbutton',
HELPBTNCLASS: '.helpmessage',
STATUTSELECTOR: '#menustatutselection',
QUESTIONSELECTOR: '#menuquestionselection',
STUDENTVALIDATION: '#student_valide_button'
......@@ -5597,6 +5600,12 @@ EDITOR.prototype = {
},
context: this
});
//help part
var helpbutton = this.get_dialogue_element(SELECTOR.HELPBTNCLASS);
if (helpbutton) {
helpbutton.on('click', this.display_help_message, this);
}
},
/**
* Re-create new PDF from all fresh data
......@@ -6428,6 +6437,26 @@ EDITOR.prototype = {
for (i = 0; i < this.drawables.length; i++) {
this.drawables[i].scroll_update(x, y);
}
},
/**
* Display a help popup in order to explain tools usability
* @protected
* @method display_help_message
*/
display_help_message: function (event) {
event.preventDefault();
var helptitle = this.get_dialogue_element(SELECTOR.HELPMESSAGETITLE);
var helpbody = this.get_dialogue_element(SELECTOR.HELPMESSAGE);
var helpopup = new M.core.dialogue({
headerContent: helptitle.get('innerHTML'),
bodyContent: helpbody.get('innerHTML'),
modal: true,
width: '840px',
visible: false,
draggable: true});
helpopup.centerDialogue();
helpopup.show();
}
};
......
......@@ -818,6 +818,12 @@ EDITOR.prototype = {
},
context: this
});
//help part
var helpbutton = this.get_dialogue_element(SELECTOR.HELPBTNCLASS);
if (helpbutton) {
helpbutton.on('click', this.display_help_message, this);
}
},
/**
* Re-create new PDF from all fresh data
......@@ -1649,6 +1655,26 @@ EDITOR.prototype = {
for (i = 0; i < this.drawables.length; i++) {
this.drawables[i].scroll_update(x, y);
}
},
/**
* Display a help popup in order to explain tools usability
* @protected
* @method display_help_message
*/
display_help_message: function (event) {
event.preventDefault();
var helptitle = this.get_dialogue_element(SELECTOR.HELPMESSAGETITLE);
var helpbody = this.get_dialogue_element(SELECTOR.HELPMESSAGE);
var helpopup = new M.core.dialogue({
headerContent: helptitle.get('innerHTML'),
bodyContent: helpbody.get('innerHTML'),
modal: true,
width: '840px',
visible: false,
draggable: true});
helpopup.centerDialogue();
helpopup.show();
}
};
......
......@@ -37,12 +37,15 @@ var AJAXBASE = M.cfg.wwwroot + '/mod/assign/feedback/editpdfplus/ajax.php',
UNSAVEDCHANGESDIV: '.assignfeedback_editpdfplus_unsavedchanges',
UNSAVEDCHANGESINPUT: 'input[name="assignfeedback_editpdfplus_haschanges"]',
UNSAVEDCHANGESDIVEDIT: '.assignfeedback_editpdfplus_unsavedchanges_edit',
HELPMESSAGETITLE: '#afppHelpmessageTitle',
HELPMESSAGE: '#afppHelpmessageBody',
DIALOGUE: '.' + CSS.DIALOGUE,
CUSTOMTOOLBARID: '#toolbaraxis',
CUSTOMTOOLBARS: '.customtoolbar',
AXISCUSTOMTOOLBAR: '.menuaxisselection',
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton',
GENERICTOOLBARBUTTONS: '.generictoolbarbutton',
HELPBTNCLASS: '.helpmessage',
STATUTSELECTOR: '#menustatutselection',
QUESTIONSELECTOR: '#menuquestionselection',
STUDENTVALIDATION: '#student_valide_button'
......
Supports Markdown
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