Gitlab CSE Unil

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

visu étudiant filtre affichage par statut

parent d695f6bd
...@@ -252,12 +252,13 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base { ...@@ -252,12 +252,13 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base {
} else { } else {
$toolbaraxis = "<div class='navigation' style='padding-left:10px;margin-left:10px;'><div style='display:inline;margin-right:5px;text-align:left;'>"; $toolbaraxis = "<div class='navigation' style='padding-left:10px;margin-left:10px;'><div style='display:inline;margin-right:5px;text-align:left;'>";
$axis = $widget->axis; $axis = $widget->axis;
$compteur = 0;
foreach ($axis as $ax) { foreach ($axis as $ax) {
$toolbaraxis .= $this->render_toolbar_axis($ax); $toolbaraxis .= $this->render_toolbar_axis($ax);
$toolbaraxis .= "</div><div style='display:inline;margin-left:5px;margin-right:5px;text-align:left;'>"; $toolbaraxis .= "</div><div style='display:inline;margin-left:5px;margin-right:5px;text-align:left;'>";
} }
$toolbaraxis .= "</div></div>"; $toolbaraxis .= "</div></div>";
$axischoice = html_writer::div(html_writer::select(["Tous","Non traité", "OK","non OK"], 'statutselection', 0, FALSE), 'toolbar ', array('role' => 'toolbar'));
$toolbaraxis .= $axischoice;
} }
// Toobars written in reverse order because they are floated right. // Toobars written in reverse order because they are floated right.
......
...@@ -49,7 +49,8 @@ SELECTOR = { ...@@ -49,7 +49,8 @@ SELECTOR = {
CUSTOMTOOLBARID: '#toolbaraxis', CUSTOMTOOLBARID: '#toolbaraxis',
CUSTOMTOOLBARS: '.customtoolbar', CUSTOMTOOLBARS: '.customtoolbar',
AXISCUSTOMTOOLBAR: '.menuaxisselection', AXISCUSTOMTOOLBAR: '.menuaxisselection',
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton' CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton',
STATUTSELECTOR: '#menustatutselection'
}, },
SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)', SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)',
SELECTEDFILLCOLOUR = 'rgba(200, 200, 255, 0.5)', SELECTEDFILLCOLOUR = 'rgba(200, 200, 255, 0.5)',
...@@ -5560,6 +5561,7 @@ EDITOR.prototype = { ...@@ -5560,6 +5561,7 @@ EDITOR.prototype = {
*/ */
editingcomment: false, editingcomment: false,
annotationsparent: [], annotationsparent: [],
studentstatut: -1,
/** /**
* Called during the initialisation process of the object. * Called during the initialisation process of the object.
* @method initializer * @method initializer
...@@ -5974,6 +5976,10 @@ EDITOR.prototype = { ...@@ -5974,6 +5976,10 @@ EDITOR.prototype = {
axe.set('checked', 'true'); axe.set('checked', 'true');
axe.on('click', this.handle_axis_button, this, axis, axe); axe.on('click', this.handle_axis_button, this, axis, axe);
} }
var statutselector = this.get_dialogue_element(SELECTOR.STATUTSELECTOR);
statutselector.on('change', this.update_visu_annotation, this);
return; return;
} }
...@@ -6017,6 +6023,12 @@ EDITOR.prototype = { ...@@ -6017,6 +6023,12 @@ EDITOR.prototype = {
context: this context: this
}); });
}, },
update_visu_annotation: function () {
var statusselector = this.get_dialogue_element(SELECTOR.STATUTSELECTOR + ' option:checked');
var statusid = parseInt(statusselector.get('value')) - 1;
this.studentstatut = statusid;
this.redraw();
},
update_custom_toolbars: function () { update_custom_toolbars: function () {
Y.all(SELECTOR.CUSTOMTOOLBARS).each(function (toolbar) { Y.all(SELECTOR.CUSTOMTOOLBARS).each(function (toolbar) {
toolbar.hide(); toolbar.hide();
...@@ -6097,7 +6109,7 @@ EDITOR.prototype = { ...@@ -6097,7 +6109,7 @@ EDITOR.prototype = {
return Y.JSON.stringify(page); return Y.JSON.stringify(page);
}, },
stringify_current_page_edited: function (){ stringify_current_page_edited: function () {
var annotations = [], var annotations = [],
page, page,
i = 0; i = 0;
...@@ -6525,7 +6537,7 @@ EDITOR.prototype = { ...@@ -6525,7 +6537,7 @@ EDITOR.prototype = {
Y.io(ajaxurl, config); Y.io(ajaxurl, config);
}, },
save_current_page_edited: function (e){ save_current_page_edited: function (e) {
var ajaxurl = AJAXBASE, var ajaxurl = AJAXBASE,
config; config;
...@@ -6571,7 +6583,7 @@ EDITOR.prototype = { ...@@ -6571,7 +6583,7 @@ EDITOR.prototype = {
}; };
Y.io(ajaxurl, config); Y.io(ajaxurl, config);
}, },
/** /**
* Event handler to open the comment search interface. * Event handler to open the comment search interface.
...@@ -6623,7 +6635,8 @@ EDITOR.prototype = { ...@@ -6623,7 +6635,8 @@ EDITOR.prototype = {
for (i = 0; i < page.annotations.length; i++) { for (i = 0; i < page.annotations.length; i++) {
var annot = page.annotations[i]; var annot = page.annotations[i];
var tool = annot.tooltype; var tool = annot.tooltype;
if (this.get('readonly') && tool.axis && this.axis[tool.axis] && this.axis[tool.axis].visibility || !this.get('readonly')) { if (this.get('readonly') && tool.axis && this.axis[tool.axis] && this.axis[tool.axis].visibility && (this.studentstatut < 0 || this.studentstatut == annot.studentstatus)
|| !this.get('readonly')) {
this.drawables.push(annot.draw()); this.drawables.push(annot.draw());
this.drawablesannotations.push(annot); this.drawablesannotations.push(annot);
} }
......
...@@ -49,7 +49,8 @@ SELECTOR = { ...@@ -49,7 +49,8 @@ SELECTOR = {
CUSTOMTOOLBARID: '#toolbaraxis', CUSTOMTOOLBARID: '#toolbaraxis',
CUSTOMTOOLBARS: '.customtoolbar', CUSTOMTOOLBARS: '.customtoolbar',
AXISCUSTOMTOOLBAR: '.menuaxisselection', AXISCUSTOMTOOLBAR: '.menuaxisselection',
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton' CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton',
STATUTSELECTOR: '#menustatutselection'
}, },
SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)', SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)',
SELECTEDFILLCOLOUR = 'rgba(200, 200, 255, 0.5)', SELECTEDFILLCOLOUR = 'rgba(200, 200, 255, 0.5)',
...@@ -5557,6 +5558,7 @@ EDITOR.prototype = { ...@@ -5557,6 +5558,7 @@ EDITOR.prototype = {
*/ */
editingcomment: false, editingcomment: false,
annotationsparent: [], annotationsparent: [],
studentstatut: -1,
/** /**
* Called during the initialisation process of the object. * Called during the initialisation process of the object.
* @method initializer * @method initializer
...@@ -5970,6 +5972,10 @@ EDITOR.prototype = { ...@@ -5970,6 +5972,10 @@ EDITOR.prototype = {
axe.set('checked', 'true'); axe.set('checked', 'true');
axe.on('click', this.handle_axis_button, this, axis, axe); axe.on('click', this.handle_axis_button, this, axis, axe);
} }
var statutselector = this.get_dialogue_element(SELECTOR.STATUTSELECTOR);
statutselector.on('change', this.update_visu_annotation, this);
return; return;
} }
...@@ -6013,6 +6019,12 @@ EDITOR.prototype = { ...@@ -6013,6 +6019,12 @@ EDITOR.prototype = {
context: this context: this
}); });
}, },
update_visu_annotation: function () {
var statusselector = this.get_dialogue_element(SELECTOR.STATUTSELECTOR + ' option:checked');
var statusid = parseInt(statusselector.get('value')) - 1;
this.studentstatut = statusid;
this.redraw();
},
update_custom_toolbars: function () { update_custom_toolbars: function () {
Y.all(SELECTOR.CUSTOMTOOLBARS).each(function (toolbar) { Y.all(SELECTOR.CUSTOMTOOLBARS).each(function (toolbar) {
toolbar.hide(); toolbar.hide();
...@@ -6092,7 +6104,7 @@ EDITOR.prototype = { ...@@ -6092,7 +6104,7 @@ EDITOR.prototype = {
return Y.JSON.stringify(page); return Y.JSON.stringify(page);
}, },
stringify_current_page_edited: function (){ stringify_current_page_edited: function () {
var annotations = [], var annotations = [],
page, page,
i = 0; i = 0;
...@@ -6518,7 +6530,7 @@ EDITOR.prototype = { ...@@ -6518,7 +6530,7 @@ EDITOR.prototype = {
Y.io(ajaxurl, config); Y.io(ajaxurl, config);
}, },
save_current_page_edited: function (e){ save_current_page_edited: function (e) {
var ajaxurl = AJAXBASE, var ajaxurl = AJAXBASE,
config; config;
...@@ -6564,7 +6576,7 @@ EDITOR.prototype = { ...@@ -6564,7 +6576,7 @@ EDITOR.prototype = {
}; };
Y.io(ajaxurl, config); Y.io(ajaxurl, config);
}, },
/** /**
* Event handler to open the comment search interface. * Event handler to open the comment search interface.
...@@ -6616,7 +6628,8 @@ EDITOR.prototype = { ...@@ -6616,7 +6628,8 @@ EDITOR.prototype = {
for (i = 0; i < page.annotations.length; i++) { for (i = 0; i < page.annotations.length; i++) {
var annot = page.annotations[i]; var annot = page.annotations[i];
var tool = annot.tooltype; var tool = annot.tooltype;
if (this.get('readonly') && tool.axis && this.axis[tool.axis] && this.axis[tool.axis].visibility || !this.get('readonly')) { if (this.get('readonly') && tool.axis && this.axis[tool.axis] && this.axis[tool.axis].visibility && (this.studentstatut < 0 || this.studentstatut == annot.studentstatus)
|| !this.get('readonly')) {
this.drawables.push(annot.draw()); this.drawables.push(annot.draw());
this.drawablesannotations.push(annot); this.drawablesannotations.push(annot);
} }
......
...@@ -187,6 +187,7 @@ EDITOR.prototype = { ...@@ -187,6 +187,7 @@ EDITOR.prototype = {
*/ */
editingcomment: false, editingcomment: false,
annotationsparent: [], annotationsparent: [],
studentstatut: -1,
/** /**
* Called during the initialisation process of the object. * Called during the initialisation process of the object.
* @method initializer * @method initializer
...@@ -601,6 +602,10 @@ EDITOR.prototype = { ...@@ -601,6 +602,10 @@ EDITOR.prototype = {
axe.set('checked', 'true'); axe.set('checked', 'true');
axe.on('click', this.handle_axis_button, this, axis, axe); axe.on('click', this.handle_axis_button, this, axis, axe);
} }
var statutselector = this.get_dialogue_element(SELECTOR.STATUTSELECTOR);
statutselector.on('change', this.update_visu_annotation, this);
return; return;
} }
...@@ -644,6 +649,12 @@ EDITOR.prototype = { ...@@ -644,6 +649,12 @@ EDITOR.prototype = {
context: this context: this
}); });
}, },
update_visu_annotation: function () {
var statusselector = this.get_dialogue_element(SELECTOR.STATUTSELECTOR + ' option:checked');
var statusid = parseInt(statusselector.get('value')) - 1;
this.studentstatut = statusid;
this.redraw();
},
update_custom_toolbars: function () { update_custom_toolbars: function () {
Y.all(SELECTOR.CUSTOMTOOLBARS).each(function (toolbar) { Y.all(SELECTOR.CUSTOMTOOLBARS).each(function (toolbar) {
toolbar.hide(); toolbar.hide();
...@@ -724,7 +735,7 @@ EDITOR.prototype = { ...@@ -724,7 +735,7 @@ EDITOR.prototype = {
return Y.JSON.stringify(page); return Y.JSON.stringify(page);
}, },
stringify_current_page_edited: function (){ stringify_current_page_edited: function () {
var annotations = [], var annotations = [],
page, page,
i = 0; i = 0;
...@@ -1152,7 +1163,7 @@ EDITOR.prototype = { ...@@ -1152,7 +1163,7 @@ EDITOR.prototype = {
Y.io(ajaxurl, config); Y.io(ajaxurl, config);
}, },
save_current_page_edited: function (e){ save_current_page_edited: function (e) {
var ajaxurl = AJAXBASE, var ajaxurl = AJAXBASE,
config; config;
...@@ -1198,7 +1209,7 @@ EDITOR.prototype = { ...@@ -1198,7 +1209,7 @@ EDITOR.prototype = {
}; };
Y.io(ajaxurl, config); Y.io(ajaxurl, config);
}, },
/** /**
* Event handler to open the comment search interface. * Event handler to open the comment search interface.
...@@ -1250,7 +1261,8 @@ EDITOR.prototype = { ...@@ -1250,7 +1261,8 @@ EDITOR.prototype = {
for (i = 0; i < page.annotations.length; i++) { for (i = 0; i < page.annotations.length; i++) {
var annot = page.annotations[i]; var annot = page.annotations[i];
var tool = annot.tooltype; var tool = annot.tooltype;
if (this.get('readonly') && tool.axis && this.axis[tool.axis] && this.axis[tool.axis].visibility || !this.get('readonly')) { if (this.get('readonly') && tool.axis && this.axis[tool.axis] && this.axis[tool.axis].visibility && (this.studentstatut < 0 || this.studentstatut == annot.studentstatus)
|| !this.get('readonly')) {
this.drawables.push(annot.draw()); this.drawables.push(annot.draw());
this.drawablesannotations.push(annot); this.drawablesannotations.push(annot);
} }
......
...@@ -47,7 +47,8 @@ SELECTOR = { ...@@ -47,7 +47,8 @@ SELECTOR = {
CUSTOMTOOLBARID: '#toolbaraxis', CUSTOMTOOLBARID: '#toolbaraxis',
CUSTOMTOOLBARS: '.customtoolbar', CUSTOMTOOLBARS: '.customtoolbar',
AXISCUSTOMTOOLBAR: '.menuaxisselection', AXISCUSTOMTOOLBAR: '.menuaxisselection',
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton' CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton',
STATUTSELECTOR: '#menustatutselection'
}, },
SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)', SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)',
SELECTEDFILLCOLOUR = 'rgba(200, 200, 255, 0.5)', SELECTEDFILLCOLOUR = 'rgba(200, 200, 255, 0.5)',
......
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