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 {
} else {
$toolbaraxis = "<div class='navigation' style='padding-left:10px;margin-left:10px;'><div style='display:inline;margin-right:5px;text-align:left;'>";
$axis = $widget->axis;
$compteur = 0;
foreach ($axis as $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>";
$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.
......
......@@ -49,7 +49,8 @@ SELECTOR = {
CUSTOMTOOLBARID: '#toolbaraxis',
CUSTOMTOOLBARS: '.customtoolbar',
AXISCUSTOMTOOLBAR: '.menuaxisselection',
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton'
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton',
STATUTSELECTOR: '#menustatutselection'
},
SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)',
SELECTEDFILLCOLOUR = 'rgba(200, 200, 255, 0.5)',
......@@ -5560,6 +5561,7 @@ EDITOR.prototype = {
*/
editingcomment: false,
annotationsparent: [],
studentstatut: -1,
/**
* Called during the initialisation process of the object.
* @method initializer
......@@ -5974,6 +5976,10 @@ EDITOR.prototype = {
axe.set('checked', 'true');
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;
}
......@@ -6017,6 +6023,12 @@ EDITOR.prototype = {
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 () {
Y.all(SELECTOR.CUSTOMTOOLBARS).each(function (toolbar) {
toolbar.hide();
......@@ -6097,7 +6109,7 @@ EDITOR.prototype = {
return Y.JSON.stringify(page);
},
stringify_current_page_edited: function (){
stringify_current_page_edited: function () {
var annotations = [],
page,
i = 0;
......@@ -6525,7 +6537,7 @@ EDITOR.prototype = {
Y.io(ajaxurl, config);
},
save_current_page_edited: function (e){
save_current_page_edited: function (e) {
var ajaxurl = AJAXBASE,
config;
......@@ -6623,7 +6635,8 @@ 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.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.drawablesannotations.push(annot);
}
......
......@@ -49,7 +49,8 @@ SELECTOR = {
CUSTOMTOOLBARID: '#toolbaraxis',
CUSTOMTOOLBARS: '.customtoolbar',
AXISCUSTOMTOOLBAR: '.menuaxisselection',
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton'
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton',
STATUTSELECTOR: '#menustatutselection'
},
SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)',
SELECTEDFILLCOLOUR = 'rgba(200, 200, 255, 0.5)',
......@@ -5557,6 +5558,7 @@ EDITOR.prototype = {
*/
editingcomment: false,
annotationsparent: [],
studentstatut: -1,
/**
* Called during the initialisation process of the object.
* @method initializer
......@@ -5970,6 +5972,10 @@ EDITOR.prototype = {
axe.set('checked', 'true');
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;
}
......@@ -6013,6 +6019,12 @@ EDITOR.prototype = {
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 () {
Y.all(SELECTOR.CUSTOMTOOLBARS).each(function (toolbar) {
toolbar.hide();
......@@ -6092,7 +6104,7 @@ EDITOR.prototype = {
return Y.JSON.stringify(page);
},
stringify_current_page_edited: function (){
stringify_current_page_edited: function () {
var annotations = [],
page,
i = 0;
......@@ -6518,7 +6530,7 @@ EDITOR.prototype = {
Y.io(ajaxurl, config);
},
save_current_page_edited: function (e){
save_current_page_edited: function (e) {
var ajaxurl = AJAXBASE,
config;
......@@ -6616,7 +6628,8 @@ 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.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.drawablesannotations.push(annot);
}
......
......@@ -187,6 +187,7 @@ EDITOR.prototype = {
*/
editingcomment: false,
annotationsparent: [],
studentstatut: -1,
/**
* Called during the initialisation process of the object.
* @method initializer
......@@ -601,6 +602,10 @@ EDITOR.prototype = {
axe.set('checked', 'true');
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;
}
......@@ -644,6 +649,12 @@ EDITOR.prototype = {
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 () {
Y.all(SELECTOR.CUSTOMTOOLBARS).each(function (toolbar) {
toolbar.hide();
......@@ -724,7 +735,7 @@ EDITOR.prototype = {
return Y.JSON.stringify(page);
},
stringify_current_page_edited: function (){
stringify_current_page_edited: function () {
var annotations = [],
page,
i = 0;
......@@ -1152,7 +1163,7 @@ EDITOR.prototype = {
Y.io(ajaxurl, config);
},
save_current_page_edited: function (e){
save_current_page_edited: function (e) {
var ajaxurl = AJAXBASE,
config;
......@@ -1250,7 +1261,8 @@ 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.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.drawablesannotations.push(annot);
}
......
......@@ -47,7 +47,8 @@ SELECTOR = {
CUSTOMTOOLBARID: '#toolbaraxis',
CUSTOMTOOLBARS: '.customtoolbar',
AXISCUSTOMTOOLBAR: '.menuaxisselection',
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton'
CUSTOMTOOLBARBUTTONS: '.costumtoolbarbutton',
STATUTSELECTOR: '#menustatutselection'
},
SELECTEDBORDERCOLOUR = 'rgba(200, 200, 255, 0.9)',
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