by Andrew C.
Hi Everyone,
Lecturers have asked if the built-in (not the plugin) Annotate/Upload PDF quicklist comments can be sorted by alphabetical order inside the Moodle assignments area under Annotate PDF.
I've made a few general changes (such as setting the comment boxes and font size to fit in default Word margins) but am struggling here since JavaScript is not one of my strong points.
I've looked in file moodle-assignfeedback_editpdf-editor-min.js
At section:
;this.load=function(){var
t=n,r;r={method:"get",context:this,sync:false,data:{sesskey:M.cfg.sesskey,action:"loadquicklist",userid:this.editor.get("userid"),attemptnumber:this.editor.get("attemptnumber"),assignmentid:this.editor.get("assignmentid")},on:{success:function(t,n){var
r;try{r=e.JSON.parse(n.responseText);if(r.error){return new
M.core.ajaxException(r)}else{e.each(r,function(e){var t=new
M.assignfeedback_editpdf.quickcomment(e.id,e.rawtext,e.width,e.colour); quickcomment.sort(function(a,b){return
b - a;});this.comments.push(t)},this)}}catch(i){return new
M.core.exception(i)}},failure:function(e,t){return
M.core.exception(t.responseText)}}};e.io(t,r)}};
and tried the following:
M.assignfeedback_editpdf.quickcomment.sort() to check to see if it was an array. No luck - it's an object.
"Object doesn't support property or method 'sort'"
Swapped e.id and e.rawtext. e.id is displayed indicating second property (text) is selected.
Any ideas?
Thanks,
Andrew (Moodle 2.6)