Working on a new text editor to tag student assignments errors with different css

Working on a new text editor to tag student assignments errors with different css

by Zabelle Motte -
Number of replies: 6
Picture of Particularly helpful Moodlers

Hello,

We begin with the project to develop a new evaluation method for assignments.
The idea is to tag the online text of the student with error tags through specific styles.
This plugin should be linked to a report presenting the evolution of the types and number of errors of each student.

And my question now : what is the best approach to develop a customized text editor for tagging the errors ?
Is it possible to use a kind of child version of Atto, without duplicating the Atto code ?
Or is there a recommanded jquery library to build such editor, that is already integrated in Moodle and that would not cause any conflict ?

Thanks in advance for the Atto developpers advices.

;-*

Zabelle

Average of ratings: -
In reply to Zabelle Motte

Re: Working on a new text editor to tag student assignments errors with different css

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Zabelle,

In principle it should work. But the Atto editor can strip tags and attributes that it does not like. So I suggest you try it first without any coding and see if your model works. To try it you can just drop into source mode in the Atto editor, and add style and class and other attributes to the html there. Save the feedback and then reopen it. If the tag/attribute/classes you added survived, yay. If not, try something else.

Once it seems to be working, document your model (on paper) and after that build a plugin that implements your model. You do not need to make a child of Atto or anything like that. Atto has a very nice plugin API, so with a little bit of sweat I think you can achieve your goal.

A good example to use might be the Atto Snippet plugin which allows you create custom snippets of HTML that can be inserted via Atto. Actually that might be helpful for testing your model and for prototyping too. (NB Its my plugin, so totally biassed)

 

Average of ratings: Useful (1)
In reply to Justin Hunt

Re: Working on a new text editor to tag student assignments errors with different css

by Zabelle Motte -
Picture of Particularly helpful Moodlers

Thanks for answer Justin.

I had a look at the Atto Snippet plugin. Il looks like the Generico Atto plugin that is linked to Generico filter. We use Generico to integrate content from our local podcasting tool.

I saw you developed these 3 plugins, so let me first of all thank you for all this ;-*

In our new project, the idea is to have a specific configuration for the Atto used to evaluate the assignments. It looks like an Atto having only 6 buttons like the Atto Snipped, but without any other text formating option nor media integration button.

Would it be possible to have 2 Atto presets configured in one Moodle ?
Any resource to help us on how to do that is welcome.

Great thank for your help.


Zabelle


In reply to Zabelle Motte

Re: Working on a new text editor to tag student assignments errors with different css

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thats a good question. I am pretty sure you can do this, though it never occurred to me before. 

In lib/editor/atto/lib.php I found this:


So it looks like when you load the editor, if you pass in a custom set of toolbar options you can show a specific set of icons only. I am not sure where you would call this from, but it looks possible.


Average of ratings: Useful (1)
In reply to Justin Hunt

Re: Working on a new text editor to tag student assignments errors with different css

by Zabelle Motte -
Picture of Particularly helpful Moodlers

Many thanks for this track, Justin, I will have a try from there.


Zabelle

In reply to Zabelle Motte

Re: Working on a new text editor to tag student assignments errors with different css

by Zabelle Motte -
Picture of Particularly helpful Moodlers

Hello,

Here are the news from my plugin development : I was able to produce a copy of the assignment online text feedback with a customized version of the Atto editor.

I found the solution here :
https://moodle.org/mod/forum/discuss.php?d=380163
I also added a simple command line to put the assignment text as default text in the comment field in get_form_elements_for_user function in locallib.php line 318.

$editor_toolbar = <<<EOT
collapse = collapse
style1 = writeup,html
EOT;

$usertext = $this->convert_submission_text_to_feedback($submission, $data);

$mform->addElement('editor', 'assignfeedbackwriteup_editor', $this->get_name(), null, array('atto:toolbar' => $editor_toolbar, 'autosave' => true))->setValue( array('text' => "$usertext") );

And I will finally derive this Atto plugin that does a big part of the job :
https://moodle.org/plugins/atto_corrections

I had some modifications on this plugin that seems to use YUI but I do not find how to proceed to generate the build files based on changes in src. Do I have to use Grunt as suggested here ?
https://docs.moodle.org/dev/Grunt

Great thanks for help.

Zabelle


In reply to Zabelle Motte

Re: Working on a new text editor to tag student assignments errors with different css

by Zabelle Motte -
Picture of Particularly helpful Moodlers

I had a try with Grunt commands and it works !

Everything is fine !