From 6c515b820b05b918d75c139966aee13be7b7a8b5 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Thu, 21 Oct 2021 12:27:11 +0800 Subject: [PATCH 01/14] MDL-72687 form: only add legend tag if a label is set --- lib/form/templates/element-group.mustache | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/form/templates/element-group.mustache b/lib/form/templates/element-group.mustache index af36dc0018c..67d7866eeed 100644 --- a/lib/form/templates/element-group.mustache +++ b/lib/form/templates/element-group.mustache @@ -8,7 +8,9 @@ {{/label}} {{$element}}
- {{label}} + {{#label}} + {{label}} + {{/label}}
{{#element.elements}} {{{separator}}} From 473c1cfc4917ddfc260f6a2032b2017fc2957c75 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Thu, 21 Oct 2021 12:36:03 +0800 Subject: [PATCH 02/14] MDL-72687 assign: add missing aria-label to prev/next arrows --- mod/assign/lang/en/assign.php | 2 ++ .../templates/grading_navigation_user_selector.mustache | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/assign/lang/en/assign.php b/mod/assign/lang/en/assign.php index 771c6fc0006..d8653a550ec 100644 --- a/mod/assign/lang/en/assign.php +++ b/mod/assign/lang/en/assign.php @@ -368,6 +368,7 @@ $string['moreusers'] = '{$a} more...'; $string['multipleteams'] = 'Member of more than one group'; $string['multipleteams_desc'] = 'The assignment requires submission in groups. You are a member of more than one group. To be able to submit you must be a member of only one group. Please contact your teacher to change your group membership.'; $string['multipleteamsgrader'] = 'Member of more than one group, so unable to make submissions.'; +$string['nextuser'] = "Next user"; $string['newsubmissions'] = 'Assignments submitted'; $string['noattempt'] = 'No attempt'; $string['noclose'] = 'No close date'; @@ -419,6 +420,7 @@ $string['preventsubmissionnotingroup_help'] = 'If enabled, users who are not mem $string['preventsubmissions'] = 'Prevent the user from making any more submissions to this assignment.'; $string['preventsubmissionsshort'] = 'Prevent submission changes'; $string['previous'] = 'Previous'; +$string['previoususer'] = 'Previous user'; $string['privacy:attemptpath'] = 'attempt {$a}'; $string['privacy:blindmarkingidentifier'] = 'The identifier used for anonymous submissions'; $string['privacy:gradepath'] = 'grade'; diff --git a/mod/assign/templates/grading_navigation_user_selector.mustache b/mod/assign/templates/grading_navigation_user_selector.mustache index f370b3b5c03..9ae4492812e 100644 --- a/mod/assign/templates/grading_navigation_user_selector.mustache +++ b/mod/assign/templates/grading_navigation_user_selector.mustache @@ -30,11 +30,11 @@ This template uses ajax functionality, so it cannot be shown in the template library. }} -{{{larrow}}} +{{{larrow}}} -{{{rarrow}}} +{{{rarrow}}}
From 8a307da41543067bc952020f09dd6b48e5142ad7 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Thu, 21 Oct 2021 15:58:09 +0800 Subject: [PATCH 03/14] MDL-72687 assign: display a more friendly link when not graded --- mod/assign/locallib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index b7e96b05929..ba225ec221f 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -7783,16 +7783,15 @@ class assign { } $capabilitylist = array('gradereport/grader:view', 'moodle/grade:viewall'); + $usergrade = get_string('notgraded', 'assign'); if (has_all_capabilities($capabilitylist, $this->get_course_context())) { $urlparams = array('id'=>$this->get_course()->id); $url = new moodle_url('/grade/report/grader/index.php', $urlparams); - $usergrade = '-'; - if (isset($gradinginfo->items[0]->grades[$userid]->str_grade)) { + if (isset($gradinginfo->items[0]->grades[$userid]->grade)) { $usergrade = $gradinginfo->items[0]->grades[$userid]->str_grade; } $gradestring = $this->get_renderer()->action_link($url, $usergrade); } else { - $usergrade = '-'; if (isset($gradinginfo->items[0]->grades[$userid]) && !$gradinginfo->items[0]->grades[$userid]->hidden) { $usergrade = $gradinginfo->items[0]->grades[$userid]->str_grade; From f1966bbb504265253b14583760250febd7ec2ccf Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Thu, 21 Oct 2021 16:21:46 +0800 Subject: [PATCH 04/14] MDL-72687 assign: add missing label to change user element --- .../templates/grading_navigation_user_selector.mustache | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mod/assign/templates/grading_navigation_user_selector.mustache b/mod/assign/templates/grading_navigation_user_selector.mustache index 9ae4492812e..2993dbf4b10 100644 --- a/mod/assign/templates/grading_navigation_user_selector.mustache +++ b/mod/assign/templates/grading_navigation_user_selector.mustache @@ -31,9 +31,10 @@ This template uses ajax functionality, so it cannot be shown in the template library. }} {{{larrow}}} - - - + + + + {{{rarrow}}}
From 9252b53b6e5019b4f7087090d966c96f13090c17 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Thu, 21 Oct 2021 16:27:44 +0800 Subject: [PATCH 05/14] MDL-72687 assign: use correct aria role for toolbar --- mod/assign/feedback/editpdf/classes/renderer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/assign/feedback/editpdf/classes/renderer.php b/mod/assign/feedback/editpdf/classes/renderer.php index 61fecbf992e..9581ee7cbad 100644 --- a/mod/assign/feedback/editpdf/classes/renderer.php +++ b/mod/assign/feedback/editpdf/classes/renderer.php @@ -203,7 +203,7 @@ class assignfeedback_editpdf_renderer extends plugin_renderer_base { // Add toolbars to toolbar_group in order of display, and float the toolbar_group right. $toolbars = $rotationtools . $toolbar1 . $toolbar2 . $toolbar3 . $toolbar4; - $toolbargroup = html_writer::div($toolbars, 'toolbar_group', array('role' => 'toolbar_group')); + $toolbargroup = html_writer::div($toolbars, 'toolbar_group', ['role' => 'toolbar']); } $pageheader = html_writer::div($navigation1 . From 62e5a4d19d309f83b7a70942da3e41b806dbde5a Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Mon, 25 Oct 2021 10:10:15 +0800 Subject: [PATCH 06/14] MDL-72687 assign: fix change filter element tab navigation --- .../grading_navigation_user_selector.mustache | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/mod/assign/templates/grading_navigation_user_selector.mustache b/mod/assign/templates/grading_navigation_user_selector.mustache index 2993dbf4b10..656441768ee 100644 --- a/mod/assign/templates/grading_navigation_user_selector.mustache +++ b/mod/assign/templates/grading_navigation_user_selector.mustache @@ -44,7 +44,17 @@ {{#str}}xofy, mod_assign, { "x": "{{index}}", "y": "{{count}}" }{{/str}} - +
@@ -83,15 +93,3 @@ {{/hasmarkingworkflow}}
- - From e1fdd3f701ae6ba46cfd2d51a574f193a4758af4 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Tue, 2 Nov 2021 10:44:25 +0800 Subject: [PATCH 07/14] MDL-72687 assign: fix stamp picker broken aria menu --- .../moodle-assignfeedback_editpdf-editor-debug.js | 2 ++ .../moodle-assignfeedback_editpdf-editor-min.js | 14 +++++++------- .../moodle-assignfeedback_editpdf-editor.js | 2 ++ .../editpdf/yui/src/editor/js/stamppicker.js | 2 ++ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js index 4d42b7ed68b..f06d6b3b7a1 100644 --- a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js +++ b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js @@ -1988,9 +1988,11 @@ Y.extend(STAMPPICKER, M.assignfeedback_editpdf.dropdown, { title = M.util.get_string('stamp', 'assignfeedback_editpdf'); button = Y.Node.create(''); button.setAttribute('data-stamp', stamp); + button.setAttribute('role', 'menuitem'); button.setStyle('backgroundImage', 'none'); listitem = Y.Node.create('
  • '); listitem.append(button); + listitem.setAttribute('role', 'none'); stamplist.append(listitem); }, this); diff --git a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js index 952f9173278..d94eae340d8 100644 --- a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js +++ b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js @@ -1,9 +1,9 @@ YUI.add("moodle-assignfeedback_editpdf-editor",function(u,t){var e,i,s,n,a,o,r,d,c,h,l,g,p,f,_,m,b,w,k,y,v,x,S,A,N=M.cfg.wwwroot+"/mod/assign/feedback/editpdf/ajax.php",D=M.cfg.wwwroot+"/mod/assign/feedback/editpdf/ajax_progress.php",T="assignfeedback_editpdf_widget",I=".navigate-previous-button",C=" .navigate-next-button",q=".searchcommentsbutton",z=".expcolcommentsbutton",E=".assignfeedback_editpdf_commentsearch input",Y=".assignfeedback_editpdf_commentsearch ul",R=".navigate-page-select",X=".loading",L=".progress-info.progress-striped",P=".drawingregion",j=".drawingcanvas",O=".commentcolourbutton",B=".annotationcolourbutton",H=".warningmessages",J=".infoicon",F='input[name="assignfeedback_editpdf_haschanges"]',V=".currentstampbutton",G='[data-region="user-info"]',K=".rotateleftbutton",W=".rotaterightbutton",U="rgba(200, 200, 255, 0.9)",$="rgba(200, 200, 255, 0.5)",Q="rgb(51, 51, 51)",Z={white:"rgb(255,255,255)",yellow:"rgb(255,236,174)",red:"rgb(249,181,179)",green:"rgb(214,234,178)",blue:"rgb(203,217,237)",clear:"rgba(255,255,255, 0)"},tt={white:"rgb(255,255,255)",yellow:"rgb(255,207,53)",red:"rgb(239,69,64)",green:"rgb(152,202,62)",blue:"rgb(125,159,211)",black:"rgb(51,51,51)"},et=300,it={comment:".commentbutton",pen:".penbutton",line:".linebutton",rectangle:".rectanglebutton",oval:".ovalbutton",stamp:".stampbutton",select:".selectbutton",drag:".dragbutton",highlight:".highlightbutton"},st=4,nt=function(t,e){this.x=parseInt(t,10),this.y=parseInt(e,10),this.clip=function(t){return this.xt.x+t.width&&(this.x=t.x+t.width),this.yt.y+t.height&&(this.y=t.y+t.height),this}};M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.point=nt,e=function(t,e,i,s){this.x=t,this.y=e,this.width=i,this.height=s,this.bound=function(t){var e,i=0,s=0,n=0,a=0,o=0;for(o=0;os||0===o)&&(s=e.x),(e.ya||0===o)&&(a=e.y);return this.x=i,this.y=n,this.width=s-i,this.height=a-n,this},this.has_min_width=function(){return 5<=this.width},this.has_min_height=function(){return 5<=this.height},this.set_min_width=function(){this.width=5},this.set_min_height=function(){this.height=5}},M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.rect=e,i=function(){this.start=!1,this.end=!1,this.starttime=0,this.annotationstart=!1,this.tool="drag",this.commentcolour="yellow",this.annotationcolour="red",this.stamp="",this.path=[]},M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.edit=i,s=function(t){this.editor=t,this.shapes=[],this.nodes=[],this.erase=function(){if(this.shapes)for(;0'),s=u.Node.create(''),i.setAttrs({alt:M.util.get_string("deleteannotation","assignfeedback_editpdf")}),i.setStyles({backgroundColor:"white"}),s.addClass("deleteannotationbutton"),s.append(i),n.append(s),s.setData("annotation",this),s.on("click",this.remove,this),s.on("key",this.remove,"space,enter",this),s.setX(a[0]+t.x+t.width-18),s.setY(a[1]+t.y+6),this.drawable.nodes.push(s)),this.drawable},draw:function(){return this.draw_highlight(),this.drawable},remove:function(t){var e,i;for(t.preventDefault(),e=this.editor.pages[this.editor.currentpage].annotations,i=0;i")).addClass("annotation"),t.addClass("stamp"),t.setStyles({position:"absolute",display:"inline-block",backgroundImage:"url("+this.editor.get_stamp_image_url(this.path)+")",width:this.endx-this.x,height:this.endy-this.y,backgroundSize:"100% 100%"}),s.append(t),t.setX(e.x),t.setY(e.y),i.store_position(t,e.x,e.y),this.editor.get("readonly")||(t.on("gesturemovestart",this.editor.edit_start,null,this.editor),t.on("gesturemove",this.editor.edit_move,null,this.editor),t.on("gesturemoveend",this.editor.edit_end,null,this.editor)),i.nodes.push(t),this.drawable=i,h.superclass.draw.apply(this)},draw_current_edit:function(t){var e,i,s=new M.assignfeedback_editpdf.rect,n=new M.assignfeedback_editpdf.drawable(this.editor),a=this.editor.get_dialogue_element(P);return s.bound([t.start,t.end]),i=this.editor.get_window_coordinates(new M.assignfeedback_editpdf.point(s.x,s.y)),(e=u.Node.create("
    ")).addClass("annotation"),e.addClass("stamp"),e.setStyles({position:"absolute",display:"inline-block",backgroundImage:"url("+this.editor.get_stamp_image_url(t.stamp)+")",width:s.width,height:s.height,backgroundSize:"100% 100%"}),a.append(e),e.setX(i.x),e.setY(i.y),n.store_position(e,i.x,i.y),n.nodes.push(e),n},init_from_edit:function(t){var e=new M.assignfeedback_editpdf.rect;return e.bound([t.start,t.end]),e.width<40&&(e.width=40),e.height<40&&(e.height=40),this.gradeid=this.editor.get("gradeid"),this.pageno=this.editor.currentpage,this.x=e.x,this.y=e.y,this.endx=e.x+e.width,this.endy=e.y+e.height,this.colour=t.annotationcolour,this.path=t.stamp,!0},move:function(t,e){var i=t-this.x,s=e-this.y;this.x+=i,this.y+=s,this.endx+=i,this.endy+=s,this.drawable&&this.drawable.erase(),this.editor.drawables.push(this.draw())}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.annotationstamp=h,l="Dropdown menu",g=function(t){t.draggable=!1,t.centered=!1,t.width="auto",t.visible=!1,t.footerContent="",g.superclass.constructor.apply(this,[t])},u.extend(g,M.core.dialogue,{initializer:function(t){var e,i,s;g.superclass.initializer.call(this,t),this.get("boundingBox").addClass("assignfeedback_editpdf_dropdown"),e=this.get("buttonNode"),i=this.bodyNode,(s=u.Node.create("

    ")).addClass("accesshide"),s.setHTML(this.get("headerText")),i.prepend(s),i.on("clickoutside",function(t){this.get("visible")&&t.target.get("id")!==e.get("id")&&t.target.ancestor().get("id")!==e.get("id")&&(t.preventDefault(),this.hide())},this),e.on("click",function(t){t.preventDefault(),this.show()},this),e.on("key",this.show,"enter,space",this)},show:function(){var t=this.get("buttonNode"),e=g.superclass.show.call(this);return this.align(t,[u.WidgetPositionAlign.TL,u.WidgetPositionAlign.BL]),e}},{NAME:l,ATTRS:{headerText:{value:""},buttonNode:{value:null}}}),u.Base.modifyAttrs(g,{modal:{getter:function(){return!1}}}),M.assignfeedback_editpdf=M.assignfeedback_editpdf||{},M.assignfeedback_editpdf.dropdown=g,p="Colourpicker",f=function(t){f.superclass.constructor.apply(this,[t])},u.extend(f,M.assignfeedback_editpdf.dropdown,{initializer:function(t){var e,r=u.Node.create('