Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atto Multilang 2 Plugin Button breaks JavaScript in Quiz for role teacher and above #18

Open
lucaboesch opened this issue Aug 18, 2016 · 8 comments
Assignees
Labels

Comments

@lucaboesch
Copy link

In a Moodle instance having the atto multilang 2 plugin button:

  • Create a course
  • Inscribe yourself as teacher
  • Create a quiz in this course
  • Insert a essay question allowing attachments
  • View the quiz preview as teacher

The file picker won't load and inspector shows a JavaScript error
TypeError: r.match(...) is null
As student everything works out fine.

@eljulians eljulians added the bug label Aug 18, 2016
@eljulians eljulians self-assigned this Aug 18, 2016
@eljulians
Copy link
Owner

Many thanks @lucaboesch for notifying about the issue, is much appreciated.

Just in case, please, provide also the Moodle version this error is being generated for.

Thanks again and regards,
Julen

@lucaboesch
Copy link
Author

Thanks, Julen.
It's a 3.1.1 in which this is happening.

Best regards,
Luca

@eljulians
Copy link
Owner

Thanks Luca, I'll keep you informed.

@eljulians
Copy link
Owner

Possibly similar to #17. Check how it was fixed.

@lucaboesch
Copy link
Author

I'm using your newest release 'master - Release v1.6 (Build 2016052600) for Moodle 2.9, 3.0 and 3.1' so the supposedly fixing code is there...

@eljulians
Copy link
Owner

eljulians commented Aug 20, 2016

Don't worry @lucaboesch, it was an annotation to keep it mind, I use to express my thoughts in these issues, so if I'm using the imperative don't think that I'm ordering you hehe ;)

iarenaza added a commit to iarenaza/moodle-atto_multilang2 that referenced this issue Oct 6, 2017
The previous approach had some assumptions (e.g., it assumed there was
a singe instance of the editor on the same page) that lead to some
bugs and corner cases. Now the plugin hooks on the form submit event
and clean the highlighting <span> tags there. The cleaning doesn't use
any regexes any longer. Instead it uses DOM operations that are more
robust and potentially faster.

Also multilang tag highlighting <span>'s are now removed/added when
switching to/from HTML view, reducing clutter when editing the HTML code.

Some initial coding style cleanup work has been carried out. More to follow.

Tested in Firefox 56 and Chromium 61.0.3163.100.

Closes eljulians#2 eljulians#18 eljulians#21
@iarenaza
Copy link
Contributor

iarenaza commented Oct 8, 2017

Hi @lucaboesch

I have revamped the editor plugin and fixed the issue you are having (and also issues #21 and #18). I've tried to contact Julen about it, but have been unsuccessful so far. If you want to try my modified plugin, you can get it at https://github.com/iarenaza/moodle-atto_multilang2

@iarenaza
Copy link
Contributor

Hi Julen,

given that you have already merged the changes that fix this issue, you can close it now.

Best regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants