Question Import Snafu

Question Import Snafu

av Eric Malone -
Antall svar: 14

Hey All,

A professor has imported several quizzes in the GIFT format. The files were not formatted correctly (UTF8) but Moodle took them anyway. Now that students have taken the quizzes, the "marks" for the majority of the questions is set at 100 instead of 1. So instead of students getting a 24/25 or 23/25, they are getting 2000/25.

I've run some modifications to the questions, with phpmyadmin. E.G. 

UPDATE `mdl_question_answers`
SET fraction = '1'
WHERE fraction = '100' AND question BETWEEN 5479 AND 5503

This fixes the questions, which were not displaying a 100% for a correct answer, but it doesn't fix the student's attempt. It seems like I need to "refresh" the score, but running a regrade doesn't work.

 

Please advise!

Gjennomsnittlig vurdering: -
Som svar til Eric Malone

Re: Question Import Snafu

av Eric Malone -

Updating the version and timemodified cells do not work. I need some method that does the same thing as clicking the edit pencil on the question and then clicking save without making any changes.

Som svar til Eric Malone

Re: Question Import Snafu

av Eric Malone -

Any thoughts? I don't want to have to edit 400 questions. :/

Som svar til Eric Malone

Re: Question Import Snafu

av Emma Richardson -
Bilde av Documentation writers Bilde av Particularly helpful Moodlers Bilde av Plugin developers

I wonder if there is something hanging around in the question attempts somewhere.  I would have thought a regrade would have fixed it.  You say the questions are fixed but you don't want to have to fix 400 questions???  If the questions are showing the correct grading, then the issue must just be in the attempts.  If you take the quiz now, does it grade correctly?

 

Som svar til Emma Richardson

Re: Question Import Snafu

av Eric Malone -

Yes, I think you're right. The quiz grades correctly if I take it now. When I click edit on the questions, then save (without changing anything) regrade works like it should. The only difference that I can tell is that the question modified date and unique identifier change. I'll poke around in the attempts table and see what I can find.

Som svar til Eric Malone

Re: Question Import Snafu

av Emma Richardson -
Bilde av Documentation writers Bilde av Particularly helpful Moodlers Bilde av Plugin developers

I wonder if you ran a repair on the questions table that you updated, if that would help. Or perhaps on the attempts..you have to be close.  Have you tried restarting mysql?

Som svar til Emma Richardson

Re: Question Import Snafu

av Jean-Michel Védrine -

Sorry Emma, I don't think a repair or restaring mysql will help.

Tim is currently in Ireland for the MoodleMoot but I am quite sure he will give good advices when he can.

I too was thinking a regrade would solve the problem but thinking more, maybe the question engine is thinking that questions are unchanged.

I will try to have a look at the regrade code.

Som svar til Jean-Michel Védrine

Re: Question Import Snafu

av Emma Richardson -
Bilde av Documentation writers Bilde av Particularly helpful Moodlers Bilde av Plugin developers

Thanks Jean-Michele - I know that I have made changes to the database before that have affecting grading but have not had to deal with existing attempts so have not run into this specifically.  

Som svar til Eric Malone

Re: Question Import Snafu

av Jean-Michel Védrine -

Hello Eric,

It would be interesting if you can send us one of the wrong files because I don't understand how answers fraction can be set to 100 using GIFT import (I know this problem did happen with some old version of a Respondus question importer but I can't see how this can happen with the GIFT format so I am interested to fix this, adding more validation in the GIFT code if necessary)

Your SQL query fix the problem with fraction incorrectly set to 100 in mdl_question_answers.

Have you checked that all is also correct in mdl_question table for theses questions including a right value for defaulmark ?

For your problem of regrade not fixing the wrong attempts marks, you are quite right, I can reproduce this easily.

it seems to me it can be fixed by changing with a sql query all the records in the mdl_question_attempt_stepts table that have fraction incorrectly set to 100.0000000 back to 1.0000000 but if I were you, I would wait for Tim Hunt's comments because he know the question engine a lot more than me (he wrote it !) and maybe there is a better way to correct the problem.

As I said there was a similar problem with some questions imported from Respondus so I will do a search in this forum to see if some other solution was given.

 

Som svar til Jean-Michel Védrine

Re: Question Import Snafu

av Eric Malone -

Thanks for the thoughts. I checked the mdl_question_answers and mdl_question tables and everything shows correctly (as 1 instead of 100).

I ended up manually "updating" the questions by opening the quiz, clicking edit, and opening each question in a new window. Then I just hit the end key on each question "edit" page and clicked save. I ended up only having to do half the quizzes because the students haven't taken the rest. Took about 15 minutes.

It would be nice to know what the mechanism for "refreshing" a question is, because after the database change (from fraction 100 to 1) all I had to do was edit and save the questions without changing anything and moodle recognized the change and regrade worked.

I'll see about getting the GIFT file, but no promises. smiler

Som svar til Eric Malone

Re: Question Import Snafu

av Tim Hunt -
Bilde av Core developers Bilde av Documentation writers Bilde av Particularly helpful Moodlers Bilde av Peer reviewers Bilde av Plugin developers

No one has yet mentioned which version of Moodle we are discussing.

I would have expected that editing the question (like you did with the database query) and then re-grading would fix the problem. I am really sure that would work in any version more recent than Moodle 2.1. In older versions regrade was a bit less reliable, but I still think it should have worked.

Som svar til Jean-Michel Védrine

Re: Question Import Snafu

av Eric Malone -

Jean-Michel, here are the some of the GIFT files that were imported.