Question Import Snafu

Question Import Snafu

Eric Malone
Number of replies: 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!

평균 등급 : -
In reply to Eric Malone

Re: Question Import Snafu

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.

In reply to Eric Malone

Re: Question Import Snafu

Eric Malone

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

In reply to Eric Malone

Re: Question Import Snafu

Emma Richardson
Documentation writers 사진 Particularly helpful Moodlers 사진 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?

 

In reply to Emma Richardson

Re: Question Import Snafu

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.

In reply to Eric Malone

Re: Question Import Snafu

Emma Richardson
Documentation writers 사진 Particularly helpful Moodlers 사진 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?

In reply to Emma Richardson

Re: Question Import Snafu

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.

In reply to Jean-Michel Védrine

Re: Question Import Snafu

Emma Richardson
Documentation writers 사진 Particularly helpful Moodlers 사진 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.  

In reply to Eric Malone

Re: Question Import Snafu

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.

 

In reply to Jean-Michel Védrine

Re: Question Import Snafu

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. 미소

In reply to Eric Malone

Re: Question Import Snafu

Tim Hunt
Core developers 사진 Documentation writers 사진 Particularly helpful Moodlers 사진 Peer reviewers 사진 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.

In reply to Tim Hunt

Re: Question Import Snafu

Eric Malone

We're on 2.4.1. I can assure you I tried several things and it didn't work.