Syxton / moodle-tiny_sketch

3 stars 7 forks source link

Moodle 4.2.3: No sketch availabe in test for Essay question type #8

Closed BearsBeetsBattlestarGalactica closed 2 months ago

BearsBeetsBattlestarGalactica commented 11 months ago

Hello,

first of all, thank you for this useful plugin.

We noticed that there is no option to add a sketch when being in the TinyMCE Editor of an essay question: image

A lot of our users might be confronted with a "Please explain or sketch" type of a question in an exam setting.

Is it possible to add the possibility of inserting a sketch for this question type? I know that there is an additional Sketch question type but since we want to give students the possibility to add sketches to their essay questions this is not exactly what we are looking for.

Thank you already,

Dominic

slakky commented 10 months ago

Seems to be related/caused by MDL-77812. A bug since Moodle 4.0 not allowing to upload media to the Response template field of the question/essay, no matter of setting the Response format within the Response options to HTML editor with file picker of question/essay or not, making the following condition become false: https://github.com/Syxton/moodle-tiny_sketch/blob/fb7e816b948bf0d337552ba0e929a8053090c43a/classes/plugininfo.php#L63

This line also causes tiny_sketch not being loaded by tiny within an essay question while attempting (not creating a Response template for) it. I did some investigation: Forcing this line to evaluate always to true (making the plugin always available in every WYSIWYG/tiny context) and creating a sketch within an attempt and storing the answer works; still fails within a Response template storing (as said, related to MDL-77812).

slakky commented 10 months ago

Forcing this line to evaluate always to true (making the plugin always available in every WYSIWYG/tiny context)

Submitted https://github.com/Syxton/moodle-tiny_sketch/pull/9 with a proper evaluation. With the current patch from MDL-77812 being merged this issue should be fixed.

Syxton commented 2 months ago

Fixed via #9 Thank you @slakky