JCloze display errors

JCloze display errors

Chad Sines發表於
Number of replies: 6
We have been using jcloze for a long time with no issues. This week we updated to Moodle 3.5 and the newest Hotpot plugin. For some reason all the blanks are now at the bottom of the cloze assignments instead of throughout the text as before. Does anyone know what might be causing this? I reopened the jcl files in hotpot and there are not errors and things show correctly there.


Chad


評比平均分數: -
In reply to Chad Sines

Re: JCloze display errors

Gordon Bateson發表於
Core developers的相片 Peer reviewers的相片 Plugin developers的相片

Hi Chad,
Please could you attach a sample JCloze file (jcl) to your next post to this forum.

Thanks,
Gordon

In reply to Gordon Bateson

Re: JCloze display errors

Chad Sines發表於

I have attached it. Please note this is a sample medical report for OBGYN, but not from an actual patient. it is for a medical class.

I believe this was created about 2 years ago and has not been changed since. The display only changes when we upgraded moodle and hotpot.

Thank you for any help.

In reply to Chad Sines

Re: JCloze display errors

Gordon Bateson發表於
Core developers的相片 Peer reviewers的相片 Plugin developers的相片

Ugh, the display on Moodle 3.5 is a terrible mess.

I'll investigate and let you know what I find out.

附件 chad.35.png
In reply to Gordon Bateson

Re: JCloze display errors

Gordon Bateson發表於
Core developers的相片 Peer reviewers的相片 Plugin developers的相片

Unfortunately, Moodle's XML parser, which is required to extract info from the Hot Potatoes files (a JCL file in this case) has changed in Moodle 3.5 and behaves differently from the XML parser in Moodle 3.4. Grrr!

Specifically, when XML tags, e.g. tags to define a "gap" in a JCloze exercise, occur embedded in open text, as they do in a JCL file, the snippets of open text, technically known as CDATA, get concatenated into one long chuck of text. Hence the result that you reported.

It'll take a while to sort out.

If you are able to hack the source code of your Moodle site, you can implement the following fix:

  1. open lib/xmlize.php with you favorite text editor
  2. locate the "characterdata" function (around line 159)
  3. change the following line of code (around line 170):
    • OLD: if (is_int(key($current[$level]))) {
    • NEW: if (false && is_int(key($current[$level]))) {
  4. save the modified file

That will fix your JCloze activities, but it may break something else, I don't recommend doing it. If you do decide to do it, do so at your own risk.

Thank you for you patience while I investigate a more long-term solution.

In reply to Gordon Bateson

Re: JCloze display errors

Gordon Bateson發表於
Core developers的相片 Peer reviewers的相片 Plugin developers的相片

Chad (and other users of Moodle 3.5),

This issue is now fixed in the latest version of the HotPot module, i.e. release: 2018-05-25 (16)

The issue also affect the TaskChain module, and the Hot Potatoes question import plugin. Those plugins have been fixed too.

Anyone using any of those plugins on Moodle 3.5, is encouraged to upgrade the plugins at the next convenient opportunity.

Thanks again for bringing this issue to my attention 滿意

Best regards,
Gordon