Could not add a new instance of hotpot

Could not add a new instance of hotpot

by Myo Gyi -
Number of replies: 8

Hello,

I have a problem in using hotpot with only attached specific file and I don't know why. It is just a simple match hotpot files.

I got an error "Could not add a new instance of hotop".

Regards,

Myo Gyi

Average of ratings: -
In reply to Myo Gyi

Re: Could not add a new instance of hotpot

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Myo,
I was able to add the quiz no problem to my site, so I don't think it is the content of the quiz which is causing the error message.

Perhaps your database is full, or your disk is full?
  • Can you check how full the disk is and how much unused disk space you have?
  • Are you able to add other kinds of activity to the Moodle course?
  • Can you add other HotPots to the Moodle course?
all the best
Gordon
In reply to Gordon Bateson

Re: Could not add a new instance of hotpot

by Peter Ruthven-Stuart -
Picture of Plugin developers
Hello Gordon and Myo

I and my students have had a similar problem before: a HotPot quiz that works fine on its own, can not be imported by the Hot Pot module.

My solution to this has been to add a different quiz, and then edit that quiz and add the quiz that I wanted to be imported. This has worked the few times that I have had his problem.
In reply to Peter Ruthven-Stuart

Re: Could not add a new instance of hotpot

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Thanks Peter, it's interesting to know this solution.

I would very much like to have a look at a server that behaves like this, so if it happens again and you would be willing to let me have access your server, please let me know.

Gordon
In reply to Myo Gyi

Re: Could not add a new instance of hotpot

by Myo Gyi -

HI Gordon and Peter,

First of all, thanks for your both replies.

I try to fix by creating a new quizzes with the same question. SO, I did one step by step. Finally, I got a weird solution.

I delete "  's " in my question's tile and it is working now.

Is it a bug? I don't know.

Thanks again for all of your support.

Myo Gyi

In reply to Myo Gyi

Re: Could not add a new instance of hotpot

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Myo,
I am glad to hear you have been able to add the HotPot to your course. Phew!

Thanks to your hint about the title, I have realized that if that the cause of this error is an apostrophe in the title.

I will fix up the HotPot module and report back.

many thanks
Gordon

P.S. For reference, here is the full error message that was produced when I set "Debug" set to "Yes" on my Moodle site:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's biography', 'myogyi/tuanbio.htm', 'Matching exercise', 0, 0, 0, 1, 1, 10, 1137' at line 1

INSERT INTO mdl_hotpot ( COURSE, NAME, REFERENCE, SUMMARY, TIMEOPEN, TIMECLOSE, ATTEMPTS, GRADEMETHOD, REVIEW, GRADE, TIMECREATED, TIMEMODIFIED, LOCATION, NAVIGATION, OUTPUTFORMAT, SHOWNEXTQUIZ, FORCEPLUGINS, PASSWORD, SUBNET, CLICKREPORTING, STUDENTFEEDBACK, STUDENTFEEDBACKURL ) VALUES ( 3, 'Tuan's biography', 'myogyi/tuanbio.htm', 'Matching exercise', 0, 0, 0, 1, 1, 10, 1137751114, 1137751114, 0, 1, 1, 0, 0, '', '', 0, 0, '' )

Could not add a new instance of hotpot
In reply to Gordon Bateson

Re: Could not add a new instance of hotpot

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Looking at the code, this problem seems to occur when adding a HotPot activity under the following conditions:
  • using HotPot v2.1
  • adding a single quiz (not a chain)
  • the "name" or "summary" field is set to "Get from Quiz"
  • the "name" or "summary" in the quiz contains an apostrophe
I have fixed the relevant script ("hotpot/lib.php") and uploaded it to the Moodle CVS depository. The new HotPot version number is v2.1.10

all the best
Gordon

P.S. You can also download the new module from:
http://bateson.kanazawa-gu.ac.jp/moodle/hotpot-module.2.1.x.zip
Average of ratings: Useful (1)
In reply to Gordon Bateson

Re: Could not add a new instance of hotpot

by Peter Ruthven-Stuart -
Picture of Plugin developers
Gordon, thank you very much.

I just had a quick look at some hotpot quizzes that I had uploaded to my moodle, and yes, as you describe above, the ones that I remember having problems with have apostrophes in their names.
In reply to Peter Ruthven-Stuart

Re: Could not add a new instance of hotpot

by Myo Gyi -

Hi Gordon,

Thanks again. It is very excellent skill of you for finding out these errors quickly in hotpot.

I will  update new hotpot version and hope everything will OK soon.

Regards,

Myo Gyi