Gitlab CSE Unil

Commit 2059f0c2 authored by M. Chardon's avatar M. Chardon
Browse files

filtre question dans interface étudiant

parent da51fa54
......@@ -147,9 +147,13 @@ if ($action == 'loadallpages') {
if ($refresh) {
$teachers = get_users_by_capability($context, 'mod/assign:grade');
$body = "La correction du devoir a été mise à jour. Vous pouvez accéder au document en suivant ce lien : " . $response->url . "\n\nCeci est un mail automatique.";
$body = "La correction du devoir a été mise à jour. Vous pouvez accéder au document en suivant ce lien : "
. $response->url
. "\n\nCeci est un mail automatique.";
$bodyhtml = "<html><b>Information Moodle</b><br/>"
. "<p>La correction du devoir a été mise à jour. Vous pouvez accéder au document en suivant ce <a href='" . $response->url . "'>lien</a></p>"
. "<p>La correction du devoir a été mise à jour. Vous pouvez accéder au document en suivant ce <a href='"
. $response->url
. "'>lien</a></p>"
. "<i>Ceci est un mail automatique.</i></html>";
foreach ($teachers as $teacher) {
$res = email_to_user($teacher, $USER, "[Moodle] Mise à jour devoir", $body, $bodyhtml);
......
......@@ -257,11 +257,12 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base {
$toolbaraxis .= "</div><div style='display:inline;margin-left:5px;text-align:left;'>";
}
$toolbaraxis .= "</div></div>";
$axischoice = html_writer::select(["Tous", "Non traité", "OK", "non OK"], 'statutselection', 0, FALSE);
//$toolbaraxis .= $axischoice;
$validatebutton = html_writer::tag('button', 'Valider feedback', array('class' => 'button', 'id' => 'student_valide_button'));
$questionchoice = html_writer::select(["Question", "Sans", "Avec"], 'questionselection', 0, FALSE);
$axischoice = html_writer::select(["Statut", "Non traité", "OK", "non OK"], 'statutselection', 0, FALSE);
$validatebutton = html_writer::tag('button', 'Envoyer', array('class' => 'button', 'id' => 'student_valide_button'));
$toolbaraxis .= html_writer::div($validatebutton, 'toolbar ', array('role' => 'toolbar'));
$toolbaraxis .= html_writer::div($axischoice, 'toolbar ', array('role' => 'toolbar'));
$toolbaraxis .= html_writer::div($questionchoice, 'toolbar ', array('role' => 'toolbar'));
}
// Toobars written in reverse order because they are floated right.
......@@ -270,7 +271,7 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base {
$toolbaraxis .
$toolbarCostumdiv .
$toolbar001 .
$clearfix, 'pageheader');
$clearfix, 'pageheader', array('style' => 'padding:0'));
$body .= $pageheader;
......
......@@ -106,7 +106,7 @@
-webkit-appearance: none;
-moz-appearance: menulist-text;
background-color: #fff;
padding: 0px 10px;
padding: 0px 2px;
}
.assignfeedback_editpdfplus_widget .pageheader select::-ms-expand {
display: none;
......
......@@ -51,6 +51,7 @@ SELECTOR = {
AXISCUSTOMTOOLBAR: '.menuaxisselection',
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton',
STATUTSELECTOR: '#menustatutselection',
QUESTIONSELECTOR: '#menuquestionselection',
STUDENTVALIDATION: '#student_valide_button'
},
SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)',
......@@ -5616,6 +5617,7 @@ EDITOR.prototype = {
editingcomment: false,
annotationsparent: [],
studentstatut: -1,
questionstatut: -1,
currentannotationreview: null,
/**
* Called during the initialisation process of the object.
......@@ -6033,6 +6035,9 @@ EDITOR.prototype = {
axe.on('click', this.handle_axis_button, this, axis, axe);
}
var questionselector = this.get_dialogue_element(SELECTOR.QUESTIONSELECTOR);
questionselector.on('change', this.update_visu_annotation_q, this);
var statutselector = this.get_dialogue_element(SELECTOR.STATUTSELECTOR);
statutselector.on('change', this.update_visu_annotation, this);
......@@ -6085,6 +6090,12 @@ EDITOR.prototype = {
update_student_feedback: function () {
this.refresh_pdf();
},
update_visu_annotation_q: function () {
var questionselector = this.get_dialogue_element(SELECTOR.QUESTIONSELECTOR + ' option:checked');
var questionid = parseInt(questionselector.get('value')) - 1;
this.questionstatut = questionid;
this.redraw();
},
update_visu_annotation: function () {
var statusselector = this.get_dialogue_element(SELECTOR.STATUTSELECTOR + ' option:checked');
var statusid = parseInt(statusselector.get('value')) - 1;
......@@ -6744,7 +6755,12 @@ EDITOR.prototype = {
for (i = 0; i < page.annotations.length; i++) {
var annot = page.annotations[i];
var tool = annot.tooltype;
if (this.get('readonly') && tool.axis && this.axis[tool.axis] && this.axis[tool.axis].visibility && (this.studentstatut < 0 || this.studentstatut == annot.studentstatus)
if (this.get('readonly')
&& tool.axis
&& this.axis[tool.axis]
&& this.axis[tool.axis].visibility
&& (this.studentstatut < 0 || this.studentstatut === annot.studentstatus)
&& (this.questionstatut < 0 || this.questionstatut === annot.answerrequested)
|| !this.get('readonly')) {
this.drawables.push(annot.draw());
this.drawablesannotations.push(annot);
......
......@@ -51,6 +51,7 @@ SELECTOR = {
AXISCUSTOMTOOLBAR: '.menuaxisselection',
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton',
STATUTSELECTOR: '#menustatutselection',
QUESTIONSELECTOR: '#menuquestionselection',
STUDENTVALIDATION: '#student_valide_button'
},
SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)',
......@@ -5612,6 +5613,7 @@ EDITOR.prototype = {
editingcomment: false,
annotationsparent: [],
studentstatut: -1,
questionstatut: -1,
currentannotationreview: null,
/**
* Called during the initialisation process of the object.
......@@ -6027,6 +6029,9 @@ EDITOR.prototype = {
axe.on('click', this.handle_axis_button, this, axis, axe);
}
var questionselector = this.get_dialogue_element(SELECTOR.QUESTIONSELECTOR);
questionselector.on('change', this.update_visu_annotation_q, this);
var statutselector = this.get_dialogue_element(SELECTOR.STATUTSELECTOR);
statutselector.on('change', this.update_visu_annotation, this);
......@@ -6079,6 +6084,12 @@ EDITOR.prototype = {
update_student_feedback: function () {
this.refresh_pdf();
},
update_visu_annotation_q: function () {
var questionselector = this.get_dialogue_element(SELECTOR.QUESTIONSELECTOR + ' option:checked');
var questionid = parseInt(questionselector.get('value')) - 1;
this.questionstatut = questionid;
this.redraw();
},
update_visu_annotation: function () {
var statusselector = this.get_dialogue_element(SELECTOR.STATUTSELECTOR + ' option:checked');
var statusid = parseInt(statusselector.get('value')) - 1;
......@@ -6735,7 +6746,12 @@ EDITOR.prototype = {
for (i = 0; i < page.annotations.length; i++) {
var annot = page.annotations[i];
var tool = annot.tooltype;
if (this.get('readonly') && tool.axis && this.axis[tool.axis] && this.axis[tool.axis].visibility && (this.studentstatut < 0 || this.studentstatut == annot.studentstatus)
if (this.get('readonly')
&& tool.axis
&& this.axis[tool.axis]
&& this.axis[tool.axis].visibility
&& (this.studentstatut < 0 || this.studentstatut === annot.studentstatus)
&& (this.questionstatut < 0 || this.questionstatut === annot.answerrequested)
|| !this.get('readonly')) {
this.drawables.push(annot.draw());
this.drawablesannotations.push(annot);
......
......@@ -188,6 +188,7 @@ EDITOR.prototype = {
editingcomment: false,
annotationsparent: [],
studentstatut: -1,
questionstatut: -1,
currentannotationreview: null,
/**
* Called during the initialisation process of the object.
......@@ -605,6 +606,9 @@ EDITOR.prototype = {
axe.on('click', this.handle_axis_button, this, axis, axe);
}
var questionselector = this.get_dialogue_element(SELECTOR.QUESTIONSELECTOR);
questionselector.on('change', this.update_visu_annotation_q, this);
var statutselector = this.get_dialogue_element(SELECTOR.STATUTSELECTOR);
statutselector.on('change', this.update_visu_annotation, this);
......@@ -657,6 +661,12 @@ EDITOR.prototype = {
update_student_feedback: function () {
this.refresh_pdf();
},
update_visu_annotation_q: function () {
var questionselector = this.get_dialogue_element(SELECTOR.QUESTIONSELECTOR + ' option:checked');
var questionid = parseInt(questionselector.get('value')) - 1;
this.questionstatut = questionid;
this.redraw();
},
update_visu_annotation: function () {
var statusselector = this.get_dialogue_element(SELECTOR.STATUTSELECTOR + ' option:checked');
var statusid = parseInt(statusselector.get('value')) - 1;
......@@ -1316,7 +1326,12 @@ EDITOR.prototype = {
for (i = 0; i < page.annotations.length; i++) {
var annot = page.annotations[i];
var tool = annot.tooltype;
if (this.get('readonly') && tool.axis && this.axis[tool.axis] && this.axis[tool.axis].visibility && (this.studentstatut < 0 || this.studentstatut == annot.studentstatus)
if (this.get('readonly')
&& tool.axis
&& this.axis[tool.axis]
&& this.axis[tool.axis].visibility
&& (this.studentstatut < 0 || this.studentstatut === annot.studentstatus)
&& (this.questionstatut < 0 || this.questionstatut === annot.answerrequested)
|| !this.get('readonly')) {
this.drawables.push(annot.draw());
this.drawablesannotations.push(annot);
......
......@@ -49,6 +49,7 @@ SELECTOR = {
AXISCUSTOMTOOLBAR: '.menuaxisselection',
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton',
STATUTSELECTOR: '#menustatutselection',
QUESTIONSELECTOR: '#menuquestionselection',
STUDENTVALIDATION: '#student_valide_button'
},
SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)',
......
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