Length of gaps in Jcloze

Length of gaps in Jcloze

by Josep M. Fontana -
Number of replies: 8
I've noticed that when I generate an html file from a Jcloze quiz in Hot Potatoes, the length of the gaps is more or less that of the text that has to be filled in.

However, when I upload an exercise in the hot potatoes native format with the hotpot module, the gaps are all shortened even if the text to be filled in is long.

Josep M.
Average of ratings: -
In reply to Josep M. Fontana

Re: Length of gaps in Jcloze

by Josep M. Fontana -
Is there a way to fix this by modifying some code in one of the HotPot module files? I don't mind that all of the gaps have the same size the problem is that as they are now they are too short for the types of exercises I'm constructing.

I guess I can always upload the HTML file for cloze exercises but if there is another way to fix this problem, it would be a more elegant solution.

Josep M.
In reply to Josep M. Fontana

Re: Length of gaps in Jcloze

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

For a quick bludge you could try the following:

  1. download "mod/hotpot/template/v6.php" to your PC and open it with a text editor
  2. locate the following line (around line 879):
    $gap .= '<input type="text" id="Gap'.$q.'" onfocus="TrackFocus('.$q.')" onblur="LeaveGap()" class="GapBox" size="6"></input>';
  3. change the "size" attribute to whatever you want, i.e.:
    $gap .= '<input type="text" id="Gap'.$q.'" onfocus="TrackFocus('.$q.')" onblur="LeaveGap()" class="GapBox" size="20"></input>';
  4. save the modified script and upload it to your Moodle site

Sometime soon, I will work out how to set the size depending on the length of the expected answer.

all the best
Gordon

Average of ratings: Useful (1)
In reply to Gordon Bateson

Re: Length of gaps in Jcloze

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Here's a modified "mod/hotpot/template/v6.php" which will automatically set the gap size to the lenght of the longest expected answer for that gap

best regards
Gordon
In reply to Gordon Bateson

Re: Length of gaps in Jcloze

by Thomas Robb -
There are times when the length should be set to the longest expected answer for the whole activity, since there are times where the instructor might not want the length of a particular gap to be a clue to the word to be filled in.

For example, if the activity were one on prepositions and the blank were short, if the student was considering both "to" and "until" as possibilities, the longer version could be ruled out by the length of the box.  This is particularly true if the student can observe that the length of the box correlates perfectly with the length of the correct answer.


In reply to Thomas Robb

Re: Length of gaps in Jcloze

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
I see what you mean Tom, but at present the JCloze application seems to set the length of the gap to either the length of the longest answer or six, whichever is greater. I have changed the HotPot module to behave in a similar way.

It would be possible to add a setting for gaps, so that on the "Edit a HotPot activity" page, the teacher could specify whether to use a standard length or the length of the longest answer. Shall we add this to the HotPot module wishlist?
In reply to Gordon Bateson

Re: Length of gaps in Jcloze

by Josep M. Fontana -
I think both of you are actually saying the same, aren't you? The length of the gap should be (and will be, after the patch Gordon has developed) equivalent to the length of the longest answer. I'm perfectly happy with that. I think that is the most reasonable alternative for the reasons Thomas mentions. I guess I didn't express myself well, but that's exactly what I was looking for smile. Thanks again!

Josep M.
In reply to Josep M. Fontana

Re: Length of gaps in Jcloze

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Josep,
after re-reading my earlier post, I realize I was far from clear, so I would like to try again ...

Firstly, I would like to say that the patch to "mod/hotpot/template/v6.php" has already been implemented and you can download it from the Moodle downloads page.

Secondly, I feel I should explain that the size of a gap is set to the length of the longest possible answer for that gap. For example, if a gap had the following possible answers, "America", "the States", "the USA", "the United States of America", then the size of that gap would be set to "28" - the length of the longest answer.

However, this means that the gaps in a JCloze can be different lengths. I think Tom was saying this was not good because it gives a hint about the answer that is expected. So Tom was suggesting that all gaps in the JCloze should be the same length, and that length should be the length of the longest answer used in any gap in the whole cloze activity.

This makes good sense I think, but it would be a departure from the way that JCloze currently works.
In reply to Gordon Bateson

Re: Length of gaps in Jcloze

by Josep M. Fontana -
No Gordon, you were not far from clear. You were perfectly clear smile. Rereading your earlier post, I realize that I had just not read it properly. The problem is mine, not yours (Napoleon used to tell his assistants: "Go slowly and carefully because I'm in a hurry).

OK, so you mean with your modification, the gap is as long as the longest possible answer for THAT particular question.

So, yes, I was thinking exactly along the lines of what Tom said: this is not desirable because for Cloze type exercises many times there is only one answer possible and as Tom says, the length is very often a give away.

What I don't understand, though, is why you say that doing it the way Tom suggests would be a departure from the way that JCloze currently works. If I'm not mistaken (and given the history of my previous postings, I probably am smile) Hot Potatoes JCloze already generates gaps that are longer than the correct answers for a particular question. As I said in my initial posting, when I generatate an HTML file from HP JCloze, the gaps ARE most of the time longer than the correct answers (I asssumed that they were as long as the longest answer for the whole exercise). It was only when I uploaded the files in the HP format that I saw that the gaps were short.

Josep M.