Little problem with JMatch

Little problem with JMatch

by Glenys Hanson -
Number of replies: 5
Hello Gordon, In this JMatch exercise "Module 7 - Exercise 2: Jill Conner Browne's life" on the page (the enrollment key is: Rennes ) I have chosen to "Fix" now. This works correctly when I upload the exercise to Moodle as a resource but not as a HP quiz. Do you know why? Not a big problem but ... Cheers, Glenys
Average of ratings: -
In reply to Glenys Hanson

Re: Little problem with JMatch

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Glenys,

I found the HotPot activitiy version of the JMatch exercise:
http://crmte.univ-fcomte.fr/moodle/mod/hotpot/view.php?id=8275

but I have a few questions
  • are you using the html file or the jmt file as the source of the quiz?
  • where can I look at the resource version of the quiz?
  • what do you mean by "works correctly". Do you mean some or all of the items on the right should always start in the same place?
  • could you send me the jmt file, so I can investigate?
thanks
Gordon
In reply to Gordon Bateson

Re: Little problem with JMatch

by Glenys Hanson -
Hello Gordon,

Sorry I forgot to put the URL in my previous message! Didn't intend to waste your time by making you search for it.

To answer your questions:
  • I'd used the jmt file as the source of the quiz (because it's the beginning of a chain and I'd understood that I should use the jmt file in this case)
  • I've now changed it for the html file and it works correctly here <http://crmte.univ-fcomte.fr/moodle/mod/hotpot/view.php?id=8823>
  • By "works correctly" I mean that "Now" places itself automatically next to "2004".
  • I've had a number of other problems with the first exercises of chains which I've resolved in the same way (after making the chain replacing the first exercise like this). Just didn't occur to me in this case.
  • I've attached the jmt file.

But I'm still confused. When I want to make a chain should I start with the Hot Potatoes file or the html file?

It's all a mystery to me how the Hot Potatoes file can correctly generate the html file on Moodle when it no longer has access to the source files (and in my case, always modified source files not the standard ones). Is this explained anywhere?

Also I don't know how a file is recognised as "next" in a chain? Because I linked to that way in my original HP navigation though on Moodle it's Moodle navigation that is used.

If you're busy, take no notice of the last three paragraphs - I can live in ignorance a while longer smile

All the best,
Glenys
In reply to Glenys Hanson

Re: Little problem with JMatch

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Glenys,
thanks for the jmt file. Probably the code in the HotPot module which generates "fixed" items needs to be changed, but I will investigate and report back.

By the way, the first Hot Potatoes quiz in a chain can be an html file or a HP XML file (jcl, jcr, jmt, jmx jqz). The quizzes in the "tail" of the chain have to be the html files, because the "Next" links in a quiz always point to an html file. It's probably easiest to always use an html file as the "head" ofthe chain too.

> It's all a mystery to me how the Hot Potatoes file can correctly generate the html file on Moodle when it no longer has access to the source files.

Perhaps you are confused because you are wondering "if I use the jmt file as the source file, where is the html file"? The answer is that there is no actual html file. It is generated "on-the-fly" by Moodle as it is sent to the browser. The browser accepts the html as if it were a static html file from the server's hard drive, but actually there is no such file.

> I don't know how a file is recognised as "next" in a chain

Basically the HotPot module looks for file specified in the "Next" button, which is set from the "Next exercise URL" on the Config - Options page within Hot Potatoes. 

When adding a chain, the HotPot module uses a function called "hotpot_get_titles_and_next_ex" in "mod/hotpot/lib.php". This function first checks to see if the source file is an html file or an HP XML file. If the source file is an html file, the function looks for the last <BUTTON> in the first <DIV> called "NavButtonBar" and extracts the name of the "Next" file from there. If the source file is an HP XML file, the function looks for the "next-ex-url" setting and uses that as the name of the next file in the chain.

best regards
Gordon

In reply to Gordon Bateson

Re: Little problem with JMatch

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hello again,
I checked the code and confirmed that fixed items in right-hand side of JMatch quizzes were not being displayed correctly, when the quiz was generated from a jmt file.

I corrected the problem in Moodle 1.6 and 1.8. I am just trying to work out how to modifiy 1.7 too, but no doubt that will get done later today.

The updated script, "mod/hotpot/templates/v6.php" should be available from the Moodle CVS and downloads page within 24 hours.

best regards
Gordon
In reply to Gordon Bateson

Re: Little problem with JMatch

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
> I've had a number of other problems with the first exercises of chains

If you pass on the details, I'll do my best to investigate
Gordon