Problems viewing Hot Potatoes results

Re: Problems viewing Hot Potatoes results

by Gordon Bateson -
Number of replies: 2
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Well done Eric! You were spot on approve

When I upgraded to PHP 5.1.2 (from 5.0.x) I got the same problem as you: JCross and JMatch would't work and the Overview report didn't show.

The reason was that apparently in PHP 5.1.2 you are not allowed to assign variables in calls to functions, so some of the HotPot code was not working. (a more detailed explanation is at the end of this message)

I have modified the relevant HotPot code now and tested it on my PHP 5.1.2 server and everything seems to be OK again. You can download the new module form the Moodle downloads page tomorrow. The new version number is HotPot v2.1.15 (or 2005090715)

many thanks!
Gordon

=======================================
assigning variables when calling a function
=======================================

Consider the following PHP function, which is intended to add one to a number:

function add_one(&$number) {
$number = $number + 1;
}

Now let's say the function is used as follows:

add_one ($n=1);
print $n;

In PHP 5.0 (and less) the print statment would print "2", but in PHP 5.1 the $n is unaffected by the function call and stays at 1. The solution is to assign the variable before the call to the function, as follows:

$n = 1;
add_one ($n);
print $n;

In reply to Gordon Bateson

Re: Problems viewing Hot Potatoes results

by Aidan McCanny -

I have recently upgraded Hot potatoes.  The version I had automatically included a hint [?] button beside each gap in the cloze quizzes I had set up even though I had cancelled this feature when I had set the quiz up.  Upgrading has resolved that problem.  However, every time I go to set up a new quiz in Moodle, I now get textsourcefile (with the double square brackets) for the name and similiar double squared bracket suggestions for the other options offered.  This still appears to work though when I now do the quiz, eg multiple choice, the results for a student come up as 'in progress' which then changes to 'abandoned'.  I am then unable to obtain any results from the students.  The same applies to the cloze quizzes.  When I check my answers I get the percentage I got right but when I click on the breadcrumbs to bring me back to the course, the results are not stored but instead the quiz comes up as abandoned.  The multiple choice quizzes were working great before the update.  I don't know what version I had before.  Have you any suggestions?

Thanks

Aidan

In reply to Aidan McCanny

Re: Problems viewing Hot Potatoes results

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

HI Aidan,
I am glad to hear you have regained control of your clue buttons smile

The double brackets are appearing because you have not installed the hotpot messages file yet. Here's a snip from the README.TXT file on how to do that:

   On Moodle 1.5 and earlier:
   (a) download
http://cvs.sourceforge.net/viewcvs.py/moodle/moodle/lang/en_utf8/hotpot.php
       to "lang/en/hotpot.php" on your Moodle site
   (b) download the files in
http://cvs.sourceforge.net/viewcvs.py/moodle/moodle/lang/en_utf8/help/hotpot/
       into "lang/en/help/hotpot/" on your Moodle site

Regarding the status and results of the quizzes, please remember that the results are NOT stored when you click the breadcrumbs. The results are only sent back to Moodle if click buttons in the quiz ("check", "hint" etc).

To verify that Moodle is storing the results of your quizzes, please could you try the following test:

  1. add a short HotPot activity to your course that we can use for this test
  2. attempt the activity and answer all the questions correctly. Please do not click on the breadcrumbs or any navigation links. Allow the quiz return to the course page automatically when the quiz is completed
  3. click on the "Hot Potatoes Quizzes" link in the "Activities" menu on your course page
  4. click on the link which says "View reports for 1 attempts (1 Users)" for the test quiz
  5. verify that the status of your attempt at the test quiz is "Completed" and that there is a link to the results of the test

I am particularly concerned to know what happens in step 2.

best regards
Gordon