Add an extra button to a hot pot quiz

Add an extra button to a hot pot quiz

by Seth Dickens -
Number of replies: 13
Hi there all,

I'm working on getting some listening materials uploaded to our Moodle site. I'm going to do a set of Cloze type activities for each of exercise.

To cut down on teacher time, and to increase learner autonomy, I've decided for the time being not to write individual feedback for each (incorrectly answered) question, anyway it doesn't seem to be possible in Jcloze.

What I would like to do however (for learner autonomy) is to include a button in each quiz which opens a new window containing the tape script for what they are listening to. This way the students themselves can see why an answer is correct or incorrect.

What I'd like to ask you guys is: Do you know how can I include a button, which matches the standard look of Moodle / Hotpotatoes buttons, which will allow me to link to a .txt file or a web page?

Thanks again in advance for any ideas smile

Seth.
Average of ratings: -
In reply to Seth Dickens

Re: Add an extra button to a hot pot quiz

by Martin Holmes -
Hi there,

I would just use the Hot Potatoes reading text option (File / Add reading text) for this. Alternatively, you could use the JCloze clue button to add a specific clue for each gap. Add a clue in the gap editing screen, then make sure clue buttons are turned on in the configuration screen.

This will be much easier than adding a custom button (which is possible, but will involve editing HTML and JavaScript code).

Cheers,
Martin
Average of ratings: Useful (1)
In reply to Martin Holmes

Re: Add an extra button to a hot pot quiz

by Seth Dickens -
Hi Martin,

Thanks for the ideas, they're good ones big grin

I'd considered the reading text idea, but I don't want the students to read the text before trying the listening if possible. If the have a text from the beginning, it becomes a reading as opposed to a listening exercise.thoughtful

The clue button idea might work, but I'd have to put the whole listening script in every clue in the exercise, as I don't want to spend too much time finding the relevant part of the tape script for each question.

To be honest, I'd be perfectly happy to add a few lines of html code to the page if it meant being able to hide the text till after the students have attempted the listening once.approve

I was thinking of adding an extra button or link to the pop up box which says "Some answers are incorrect.." that comes up after students have checked their answers once. Have you any idea which snippet of code refers to the buttons Moodle or Hot potatoes use?

Thanks again and have a good Sunday big grin

Seth
In reply to Seth Dickens

Re: Add an extra button to a hot pot quiz

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Seth,
how about if you follow Martin's advice, but have the reading hidden until the student's click on a button?
  1. create the JCloze of the dialog
  2. add a reading (Ctrl-R)
  3. put the media player and sound file in the "Title" of the reading
  4. put the hidden transcript and a Show/Hide button in the body of the reading. e.g.
    <div id="transcript" style="display:none;">
    A: Hi, how are you doing?
    B: Pretty good thanks
    </div>
    <div style="text-align:center"><button class="FuncButton" onfocus="FuncBtnOver(this)" onmouseover="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseout="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="var t=document.getElementById('transcript'); if(t){ if(t.style.display=='none'){ t.style.display=''; this.innerHTML='Hide'; }else{ t.style.display='none'; this.innerHTML='Show';}}return false;">Show</button></div>
Of course, you should change the dialog to what you need, but leave the rest of the <div> and <button> tags as they are. It is important that the <button> tag goes all on one line, i.e. it should have no line breaks in it.

If you are confident working with Javascript, you could move the inline script I have given into a separate file and include it as an external javascript, so that you wouldn't need to put all that nasty looking code in all your readings.

However, the above example should give you something to start with anyway.

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

Re: Add an extra button to a hot pot quiz

by Seth Dickens -
Wow, fantastic Gordon!

Thank you ever so much for the help big grin This is perfectly, exactly what I'd like to do smile

I'll get down to it this afternoon and report back on how it works.

Personally speaking I'm not able to include an external javascript file at the moment, though if this works well, I'll definitely teach myself how to do it.

Once again many thanks!

Seth.
In reply to Seth Dickens

Re: Add an extra button to a hot pot quiz

by Seth Dickens -
Hi there again,

It works brilliantly! big grin

Thanks again Gordon and Martin!

In the end I decided to keep the exercise and the show/hide transcript button all on one page. I decided to do this because including a reading text that appeared / disappeared took up a lot of space on screen, which in theory the students might not even need to use (if they are fantastic and don't need to refer to the transcript.) This also left me more space to include a photo to brighten things up, or perhaps some film in future.

I also changed the text on your buttons Gordon to "Show Transcript" and "Hide Transcript" just to make things clearer to the students.

Anyhow.... absolutely great work I'm really pleased and will now become a listening test factory for the next few evenings THANK YOU big grin

Seth

P.S. If anyone is interested in seeing a working version, I've included the .jcl file and photo in the .zip here. Unfortunately you won't be able to hear the .MP3 listening file as it's huge and also subject to copyright. You should be able to get the basic idea of what it looks like anyway.
In reply to Seth Dickens

Re: Add an extra button to a hot pot quiz

by Martin Holmes -
I've just tried adding code for a link into the "Some answers are incorrect" message box in the configuration screen, and realized that there's a limit on the amount of text that can go in there. There's no reason for that limit, so I'll remove it in the next version. Once that's done, you should be able to press Control + Shift + K to insert a block of code in there which gives you a hidden div, and a link to click on which shows the div. That's a method I use to hide and show content in HotPot and Quandary exercises.

If I do a special build of JCloze with the limitation removed, will you test it out for me?

Cheers,
Martin
In reply to Martin Holmes

Re: Add an extra button to a hot pot quiz

by Seth Dickens -
Absolutely! No problems at all smile

I'd tried doing the same and found that the code got cut off half way through.

I'd sort of accepted that the transcript would have to go on the main page, but it'd be much better if I could get the students to try the exercise first, then have the option of the transcript.

Let me know how to get in contact and I'll happily try out the build.

Seth. big grin
In reply to Seth Dickens

Re: Add an extra button to a hot pot quiz

by Martin Holmes -
I'll post it on the HotPot site, and post the URL on the Moodle group.
That saves sending large attachments by email.

This has revealed a limitation in my code that shouldn't have been
there -- for which many thanks!

Cheers,
Martin
In reply to Martin Holmes

Re: Add an extra button to a hot pot quiz

by Seth Dickens -
Hi there guys!

I just thought I'd share another use of the "Show/Hide Transcript" button that Gordon wrote. I've been using it also in a Jquiz Multiple choice exercise, and it's coming along swimmingly!! big grin

I had a few problems at first trying to decide where to stick the code (in the exercise instructions / in a reading text / in the question text etc )but none were suitable as the button was displayed in an awkward or inappropriate place. i.e. it was displayed "too early" in the exercise, took up too much room, or it disrupted the questions and answers by appearing in between them. thoughtful

I tried posting the code in an empty question, but Hot Pots wasn't too keen on that and gave me an error message. I also tried mucking around with <div vertical-align> tags, but that was no good either.

In the end the solution (as always) was the most simple one!!! winkWhat comes last in the exercise? The last multiple choice answer option of course! I stuck the code in there and hey-presto a wonderful looking multiple choice listening with a hideable / showable transcript. Another round of applause to Gordon and Martin!smile

I've attached an example exercise for anyone who'd like to have a look.

Have a great week everyone,

Seth.


In reply to Seth Dickens

Re: Add an extra button to a hot pot quiz

by Martin Holmes -
Hi there,

In case you'd like to go back to doing this with JCloze, I've posted an update to the JCloze executable here:
http://hotpot.uvic.ca/JCloze.zip

It removes all the limits on the length of text in prompts and messages, so you can try putting the show/hide div inside the "Some of your answers are incorrect" message.

Cheers,
Martin
In reply to Martin Holmes

Re: Add an extra button to a hot pot quiz

by Seth Dickens -
Hooray! Nice one Martin.. but.... shy

It works great in that it does now allow you to put whatever length text in the "Some of your answers are incorrect" box... but unfortunately, the text that I wanted to include, and, Ithink, the code which Gordon has written contains hard returns, which are not allowed in the box.I have included the text of the code I'm trying to include in the box for you to try out. thoughtful

I'm definitely interested in including this "mod" in my exercises, so if you are able to allow hard returns, I'd be really interested in trying it out. Nice one for developing a re-coded version so quick anyway!smile

Seth

P.s. the second method I described above is in addition to the first method, not instead of it. Gordon's button seems to have more than one use!
In reply to Seth Dickens

Re: Add an extra button to a hot pot quiz

by Martin Holmes -
Hi Seth,

I don't see any code in your message above, I'm afraid. But in HTML there are no hard returns, so there's nothing to prevent you putting all your code on one line. That's all I can suggest, really, because the only alternative would be to change the single-line text box in the config screen into a multi-line edit control, which would necessitate laying out the screen again, re-doing all the screenshots, updating all the help, etc., and to be honest that's not something we can do in a situation where there's only one know user/usage of the feature we'd be providing.

So I'd suggest trying to remove all the hard returns from your code, and pasting the results into the single-line box to see what happens. If it doesn't work, we can try looking at your code to see what might be causing the problem.

Cheers,
Martin
In reply to Martin Holmes

Re: Add an extra button to a hot pot quiz

by Seth Dickens -
Hmm fair point! smile
I think it would be just a little too much to ask! big grin

I'll see if I can have a go at it tomorrow anyway and will let you know how I get on.

How do you post code like that Gordon did above anyway? I attached mine as a .txt file, but it'd be handy to.... ahh so much to learn... so much smile

Thanks again for all the great help so far.

Seth