No "Hot Potatoes XML format" when importing into question bank

Re: No "Hot Potatoes XML format" when importing into question bank

by Joseph Rézeau -
Number of replies: 8
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Gordon,

Just downloaded your HP mod and question/format/hotpot folder and installed on my moodle 2 test sites.

Tried to import a JCQ file with just one MCQ question.

Import works OK in Moodle 2.0.

Does not work in Moodle 2.1, throws this error message:

Notice: Undefined property: stdClass::$questiontextformat in L:\server\htdocs\moodle21fork\moodle\question\format.php on line 873
Error writing to database

More information about this error
Debug info: Incorrect integer value: 't' for column 'answerformat' at row 1
UPDATE mdl_question_answers SET question = ?,answer = ?,feedback = ?,answerformat = ?,fraction = ?,feedbackformat = ? WHERE id=?
[array (
0 => 112,
1 => 't',
2 => 'yes, this is correct',
3 => 't',
4 => 1,
5 => '1',
6 => 218,
)]
Stack trace:

    line 397 of \lib\dml\moodle_database.php: dml_write_exception thrown
    line 984 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
    line 1016 of \lib\dml\mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
    line 92 of \question\type\multichoice\questiontype.php: call to mysqli_native_moodle_database->update_record()
    line 416 of \question\format.php: call to qtype_multichoice->save_question_options()
    line 119 of \question\import.php: call to qformat_default->importprocess()

Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: No "Hot Potatoes XML format" when importing into question bank

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

Hi Joseph,
thanks for pointing this out approve

I have fixed this issue, and checked the import of *all* the HP question formats, to make sure they can be imported into the latest Moodle 2.x. If you find any else odd, please let me know smile

Please downoad the modified scripts when you have a chance:

regards
Gordon

In reply to Gordon Bateson

Re: No "Hot Potatoes XML format" when importing into question bank

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Gordon,

Thanks for the super-fast reaction.cool I've downloaded and tested (with jqz files only at the moment) and the import feature works OK.

Joseph

PS.- I hope your Hot Potatoes mini-Moot in Paris next week goes well and that you will have some free time to do some sight-seeing there as well.wink

In reply to Joseph Rézeau

Re: No "Hot Potatoes XML format" when importing into question bank

by Jean-Michel Védrine -

Hello,

There is still an issue : in Moodle 2.1 what was called question->defaultgrade in Moodle 1.9 and 2.0 is now called question->defaultmark and is set by default to 1 so the modified format will work for moodle 2.1 but all imported questions will have a default mark set to 1.

Average of ratings: Useful (1)
In reply to Jean-Michel Védrine

Re: No "Hot Potatoes XML format" when importing into question bank

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

Dear Jean-Michel
thank you so much for this great information approve

I have adjusted the HP->question import script, so that it will set "defaultmark" as required by Moodle 2.1+. I have left the old defaultgrade setting as well, so that the code can also be used in Moodle 2.0 sites.

This issue affects JCloze import particularly, and I confirmed that a JCloze with three gaps had is default grade/mark set to "3" as required.

Please download and install the modified scripts when you have a chance:

best regards
Gordon

In reply to Gordon Bateson

Odp: Re: No "Hot Potatoes XML format" when importing into question bank

by Marek Marczak -

Hello,

I have the latest version for Moodle 2.x and the mod has installed properly and so has question (its visible on the plugin list). However, there is no sign of it on the question import list. Do you happen to know what might cause the problem?

In reply to Marek Marczak

Re: Odp: Re: No "Hot Potatoes XML format" when importing into question bank

by Rob Johnson -

I have the same problem.  I am sure both the mod and question import folders are in the proper locations.  I got a "Success" message after installation for both components.  The module is working fine, but Hot Potatoes XML format is not one of my import options.  I have tried on two production sites and a test Moodle.  All are running 2.1.4+. 

Rob

In reply to Rob Johnson

Re: Odp: Re: No "Hot Potatoes XML format" when importing into question bank

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

Marek, Rob,

my bad - I "fixed" something yesterday that disabled the HotPot question  import (in Moodle 2.x) completely. Sorry about that blush. I have fixed it now and updated the code in the downloadable zip files for (Moodle 2.x):

In case anyone was wondering, HotPot module and HotPot question import in Moodle 1.x are unaffected by this issue.

regards
Gordon

In reply to Gordon Bateson

Odp: Re: Odp: Re: No "Hot Potatoes XML format" when importing into question bank

by Marek Marczak -

Gordon,

Everything works fine now. Thanks a lot.

regards

Marek