Rubarb and quizport problem

Rubarb and quizport problem

by Robert Maran -
Number of replies: 10

Hi Gordon

I created a rubarb quiz using quizport. When I finished the quiz  the following message/error came up and of course the results were not in the gradebook. If I used the same rubarb quiz using hotpot, it works fine.

Data too long for column 'correct' at row 1

INSERT INTO mdl_quizport_responses ( ATTEMPTID, QUESTIONID, SCORE, WEIGHTING, HINTS, CLUES, CHECKS, CORRECT ) VALUES ( 544519, 28161, 0, 0, 0, 0, 61, '660,84,24411,2556,6524,283,337,1189,876,37260,177,3080,37242,2874,169,909,594,1009,8329,664,37261,874,342,18494,375,37262,180,3021,7560,648,341,50,221,37263,619,3059,347,22161,47,37264,5375,250,36076,178,698,36,3150,8947,37265,15807,37268,373,657,6,6531,1008,4977,1763,30,968,2704' )
line 1554 of lib\dmllib.php: call to debugging()
line 65 of mod\quizport\legacy\mdl_19.php: call to insert_record()
line 1432 of mod\quizport\output\class.php: call to moodle_database->insert_record()
line 1382 of mod\quizport\output\class.php: call to quizport_output->add_response()
line 1215 of mod\quizport\output\class.php: call to quizport_output->store_details()
line 37 of mod\quizport\view.php: call to quizport_output->store()

Could not insert record in database table: quizport_responses

Strange thing is that a couple of weeks ago i made a similar rubarb quiz using quizport and it worked fine...

I have uploaded your server for you to look at.

 

Cheers

Robert



Average of ratings: -
In reply to Robert Maran

Re: Rubarb and quizport problem

by Robert Maran -
In reply to Robert Maran

Re: Rubarb and quizport problem

by Glenys Hanson -

Hi Robert,

I did your Shopping Dictagloss on Gordon's site and I didn't see an error message at the end - I was just trapped in the exercise with no elegant way out.

You should maybe put a shorter one on his site for him to test.

By the way, there's a place where you hear: "for" but you need to put, I think,  "in" - a two letter word anyway.

As you're creating dictation-like exercises with WebRhubarb you might be intersted in the 2011-09-20-TexToys-modified-source-files.zip I put on the Hot Potatoes users group recently. I can explain exactly what they do - I already have on the users group.

Cheers,

Glenys

In reply to Glenys Hanson

Re: Rubarb and quizport problem

by Robert Maran -

Hi Glenys,

Thanks for your message. Yes, I should have created something shorter for Gordon to test- I did, but haven't uploaded to his site yet. I did however upload it to my server and it works OK, so I suspect there is a problem with the rubarb I created and uploaded. (As i said I made another rubarb a few weeks ago and there was no problem). 

I would be interested in your modified source files, and if you could talk me through them I would appreciate it.

Cheers
Robert

In reply to Glenys Hanson

Re: Rubarb and quizport problem

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

Hi Glenys,

> I was just trapped in the exercise with no elegant way out.

This was the new "Next activity grade" at work (see screenshot). Robert had setup the activity to only progress if the score was 100%  - nothing less than perfection! And since the "exit page" for this activity was disabled, QuizPort forced the student to retry automatically. If you get 100% you are returned to the course page.

> You should maybe put a shorter one on his site for him to test.

Thanks for thinking of me approve

kind regards
Gordon

Attachment quizport.next.activity.jpg
In reply to Robert Maran

Re: Rubarb and quizport problem

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

Hi Robert,

> INSERT INTO mdl_quizport_responses ( ATTEMPTID, ... ) VALUES ( 544519, ... )

Congratualtions to you and your students for doing over half a million attempts at QuizPort quizzes  - cool !

> INSERT INTO mdl_quizport_responses ( ATTEMPTID, ... CORRECT )
> VALUES ( 544519, ... '660,84,24411,2556,6524,283,337,1189,876,37260,
> 177,3080,37242,2874,169,909,594,1009,8329,664,37261,874,342,18494,
> 375,37262,180,3021,7560,648,341,50,221,37263,619,3059,347,22161,
> 47,37264,5375,250,36076,178,698,36,3150,8947,37265,15807,37268,
> 373,657,6,6531,1008,4977,1763,30,968,2704' )

What is happening here is that each word in the correct answer is assigned an id from the "strings" table and then this list of ids is stored in the "correct" field of the record in the "attempts" table. The "correct" field can be up to 256 chars long, but because the ids in your database are now large, combined with the fact that rhubarb quizzes require a lot of ids means that all those ids are now longer than the allowed length of the "correct" field.

When we do the same activity on my server, the ids are all much shorter and therefore there is enough room for this information and we don't get the error on my server.

I don't really want to make this field in the database longer, because at the moment the type of this field in the database is VARCHAR(256) whch is has a variable length and is quite an efficient way to store text fields that are usually short but sometimes long. To make the field longer, we would have to make it a fixed length TEXT field, but this would mean we have to allocate space for the field even if it is not used - and usually this field only contains a handful of ids.

I think a better solution would be to rethink how to store Rhubarb results. For the moment, I will simply cut off the list of ids if it is going to be longer than 256 chars. This will mean that you lose some informationabout which words were entered. In the longer term I will implement a solution which allows the all the words to be stored.

I will let you know when you can download a version of the QuizPort module which can handle your situation.

best regards
Gordon

In reply to Gordon Bateson

Re: Rubarb and quizport problem

by Robert Maran -

Hi Gordon

Thanks for the quick response! As I said, it only appears to be a problem with the rubarb I created because shorter rubarbs I created work fine. The interim fix is for me to use hotpot- that seems to work fine without any errors.

Cheers

Robert

In reply to Robert Maran

Re: Rubarb and quizport problem

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

Your new Moodle QuizPort module is ready for collection !

The lastest version of this module will handle a situation such as you have reported, where the length of a list of string ids is longer than the allowable length (255) for any of the "correct", "wrong" or "ignored" fields in the "quizport_responses" table of the Moodle database.

thank you for reporting this issue
Gordon

P.S. I made a similar change to HotPot for Moodle 2.x and TaskChain for Moodle 2.x

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

Re: Rubarb and quizport problem

by Robert Maran -

Hi Gordon

 

Thanks for that. I will get our IT mob to update....

 

Robert