Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-32791

Total of Grades in Quiz misreported due to orphan records in mdl_quiz_question_instances table

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.2.5, 2.3.2
    • Component/s: Quiz
    • Labels:
    • Environment:
      Apache 2.2 on Windows Server 2008, php 5.3.5
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      1. Make sure upgrade works with no errors.

      2. Then go and attempt some quizzes, just to ensure there are no obvious regressions.

      Show
      1. Make sure upgrade works with no errors. 2. Then go and attempt some quizzes, just to ensure there are no obvious regressions.
    • Workaround:
      Hide

      delete the orphaned records from the table.

      Show
      delete the orphaned records from the table.
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      A quiz with 39 questions worth 1 point each was reporting total of grades as 81, which caused incorrect grade calculation. This forum thread http://moodle.org/mod/forum/discuss.php?d=184405 led me to the fix, but the problem in the code still exists. According to the instructor, he re-used an existing quiz as the basis for the one, taking out the former questions and adding new ones. Just as in the forum post, when I look at the table contents for the quiz I see records in the mdl_quiz_question_instances table with a value of 0 for the question field, and a value of 1 for the grade. It appears moodle is picking up the grade even though there is no associated question with that grade (and shouldn't those records have been deleted the question instance table when the instructor removed them?). I've marked this major because it affects student grade calculation.

      Contents of table for the quiz in question:
      id quiz question grade
      3537 466 0 1
      3538 466 0 1
      3539 466 0 1
      3540 466 0 1
      3541 466 0 1
      3542 466 0 1
      3543 466 0 1
      3544 466 0 1
      3545 466 0 1
      3546 466 0 1
      3547 466 0 1
      3548 466 0 1
      3549 466 0 1
      3550 466 0 1
      3551 466 0 1
      3552 466 0 1
      3553 466 0 1
      3554 466 0 1
      3555 466 0 1
      3556 466 0 1
      3557 466 0 1
      3558 466 0 1
      3559 466 0 1
      3560 466 0 1
      3561 466 0 1
      3562 466 0 1
      3563 466 0 1
      3564 466 0 1
      3565 466 0 1
      3566 466 0 1
      3567 466 0 1
      3568 466 0 1
      3569 466 0 1
      3570 466 0 1
      3571 466 0 1
      3572 466 0 1
      3573 466 0 1
      3574 466 0 1
      3575 466 0 1
      3576 466 0 1
      3577 466 0 1
      3578 466 0 1
      3579 466 3036 0
      3580 466 4121 1
      3581 466 4123 1
      3582 466 4120 1
      3583 466 4122 1
      3584 466 4124 1
      3585 466 4119 0
      3586 466 4125 0
      3587 466 4127 1
      3588 466 4128 1
      3589 466 4129 1
      3590 466 4131 0
      3591 466 4134 1
      3592 466 4132 1
      3593 466 4133 1
      3594 466 4135 1
      3595 466 4136 1
      3596 466 2940 1
      3597 466 3331 1
      3598 466 4081 1
      3599 466 4080 1
      3600 466 4086 1
      3601 466 3329 1
      3602 466 2968 1
      3603 466 3330 1
      3604 466 2992 1
      3605 466 3702 1
      3606 466 3705 1
      3607 466 3708 1
      3608 466 4021 1
      3609 466 4001 1
      3610 466 4037 1
      3611 466 4039 1
      3612 466 4049 1
      3613 466 4064 1
      3614 466 4063 1
      3615 466 4062 1
      3616 466 3688 1
      3617 466 2955 1
      3618 466 3710 1
      3619 466 3709 1
      3620 466 3711 1
      3621 466 3687 1

        Gliffy Diagrams

          Activity

          Hide
          timhunt Tim Hunt added a comment -

          Can you try updating to the latest 2.2.2+. I this I did a fix for this, which makes the orphaned rows show up so you can delete them.

          Show
          timhunt Tim Hunt added a comment - Can you try updating to the latest 2.2.2+. I this I did a fix for this, which makes the orphaned rows show up so you can delete them.
          Hide
          mspall Michael Spall added a comment -

          Idaho State University is seeing this as well and we will be upgrading to 2.2.3+ soon and will be able to test this. I am wondering what is causing this.
          Quiz bug
          Backup and restore bug
          Backup and restore from 1.9 to 2.0 with "old questions"
          A user stopping a process before completion and leaving 0's instead of correct question ids in question.

          Tim,
          Does your fix handle question ids going to non-existent questions?
          What is the commit that contains the fix?

          Show
          mspall Michael Spall added a comment - Idaho State University is seeing this as well and we will be upgrading to 2.2.3+ soon and will be able to test this. I am wondering what is causing this. Quiz bug Backup and restore bug Backup and restore from 1.9 to 2.0 with "old questions" A user stopping a process before completion and leaving 0's instead of correct question ids in question. Tim, Does your fix handle question ids going to non-existent questions? What is the commit that contains the fix?
          Hide
          mindyk Melinda Kraft added a comment -

          We are upgrading tomorrow and I will advise after we do that. We are fairly certain the steps that triggered the bug was editing an existing quiz. It left partial records behind in the table (there were point values, but no associated question).

          Show
          mindyk Melinda Kraft added a comment - We are upgrading tomorrow and I will advise after we do that. We are fairly certain the steps that triggered the bug was editing an existing quiz. It left partial records behind in the table (there were point values, but no associated question).
          Hide
          timhunt Tim Hunt added a comment -

          I think when we encountered this but, it was related to backup and restore issues. Anyway, hopefully you will be able to fix it soon.

          Show
          timhunt Tim Hunt added a comment - I think when we encountered this but, it was related to backup and restore issues. Anyway, hopefully you will be able to fix it soon.
          Hide
          mindyk Melinda Kraft added a comment -

          Ok - so we ran the upgrade to 2.2.3 today, but editing the quiz returned no different results. Total still shows 81 and the actual number of points should be 39. The problem is in the mdl_quiz_question_instances table. To my way of thinking, the easy fix in the code would be to tell Moodle not to aggregate questions where the question field equals 0.

          Show
          mindyk Melinda Kraft added a comment - Ok - so we ran the upgrade to 2.2.3 today, but editing the quiz returned no different results. Total still shows 81 and the actual number of points should be 39. The problem is in the mdl_quiz_question_instances table. To my way of thinking, the easy fix in the code would be to tell Moodle not to aggregate questions where the question field equals 0.
          Hide
          timhunt Tim Hunt added a comment -

          Oh!

          Can you check again, what is the data in mdl_quiz_question_instances for this quiz, and what is the date in the quiz table (particularly the questions field).

          Show
          timhunt Tim Hunt added a comment - Oh! Can you check again, what is the data in mdl_quiz_question_instances for this quiz, and what is the date in the quiz table (particularly the questions field).
          Hide
          mspall Michael Spall added a comment -

          We are testing Moodle 2.2.3 (Build: 20120514) and don't see the orphaned rows in the edit quiz interface to be able to delete them.

          In the mdl_quiz.questions field we see these as examples:
          119939,119936,105488,119937,105467,105469,105483,100974,105494,105481,105465,105463,105472,0,105474,0,105476,0,105498,0,105225,0,105482,0,105464,0
          ,0,,0,,0,,0,,0,,0,,0,,0,,0,,0,,0,,0,,0

          In the mdl_quiz_question_instances table we see these as examples
          id, quiz, question, grade
          30789 1806 0 1.0000000
          30790 1806 0 3.0000000

          With the quiz that has all 0's as an example when I go to "edit quiz"/"order and paging" and delete the empty page 1, mdl_quiz.questions is now correctly empty.

          But there is still a problem. Without any questions, "Total of grades", which comes from mdl_quiz.sumgrades, is 45 because that is the sum of mdl_quiz_question_instances.grade for all the rows that have mdl_quiz_question_instances.quiz match the quiz.id and have mdl_quiz_question_instances.question = 0.

          Besides contacting a DB admin to delete the bad mdl_quiz_question_instances, is there a way for users in the teacher role to fix these quizzes?

          Show
          mspall Michael Spall added a comment - We are testing Moodle 2.2.3 (Build: 20120514) and don't see the orphaned rows in the edit quiz interface to be able to delete them. In the mdl_quiz.questions field we see these as examples: 119939,119936,105488,119937,105467,105469,105483,100974,105494,105481,105465,105463,105472,0,105474,0,105476,0,105498,0,105225,0,105482,0,105464,0 ,0,,0,,0,,0,,0,,0,,0,,0,,0,,0,,0,,0,,0 In the mdl_quiz_question_instances table we see these as examples id, quiz, question, grade 30789 1806 0 1.0000000 30790 1806 0 3.0000000 With the quiz that has all 0's as an example when I go to "edit quiz"/"order and paging" and delete the empty page 1, mdl_quiz.questions is now correctly empty. But there is still a problem. Without any questions, "Total of grades", which comes from mdl_quiz.sumgrades, is 45 because that is the sum of mdl_quiz_question_instances.grade for all the rows that have mdl_quiz_question_instances.quiz match the quiz.id and have mdl_quiz_question_instances.question = 0. Besides contacting a DB admin to delete the bad mdl_quiz_question_instances, is there a way for users in the teacher role to fix these quizzes?
          Hide
          timhunt Tim Hunt added a comment -

          OK, so the bug reported here must actually be different from the bug we were experiencing at the OU, even though some of the symptoms are similar.

          Given what you are saying, I can't think of any way to fix this through the Moodle UI. I needs to be fixed in the DB.

          Rows in quiz_question_instances with question=0 are meaningless. At the moment, I cannot see any harm in doing

          DELETE FROM mdl_quiz_question_instances WHERE question=0

          however, that is nothing more than an educated guess. You are strongly advised to test this on a copy of your live site before doing it for real.

          I am afraid that I am about to go on holiday for two weeks. I will attend to this further on my return.

          In the mean time, it would be helpful if you could share:

          1. The steps you take to fix this manually in the database (if you decide to do that).

          2. Any observations on where this bad data comes from. (E.g. I restore the attached back-up, and I end up with a broken quiz.)

          Show
          timhunt Tim Hunt added a comment - OK, so the bug reported here must actually be different from the bug we were experiencing at the OU, even though some of the symptoms are similar. Given what you are saying, I can't think of any way to fix this through the Moodle UI. I needs to be fixed in the DB. Rows in quiz_question_instances with question=0 are meaningless. At the moment, I cannot see any harm in doing DELETE FROM mdl_quiz_question_instances WHERE question=0 however, that is nothing more than an educated guess. You are strongly advised to test this on a copy of your live site before doing it for real. I am afraid that I am about to go on holiday for two weeks. I will attend to this further on my return. In the mean time, it would be helpful if you could share: 1. The steps you take to fix this manually in the database (if you decide to do that). 2. Any observations on where this bad data comes from. (E.g. I restore the attached back-up, and I end up with a broken quiz.)
          Hide
          mindyk Melinda Kraft added a comment -

          Tim, here is the data you requested, post 2.3 upgrade.

          The values in my mdl_quiz table for the quiz in question (note sum of grades is 81, not 39 - quiz_instances data is at the end):

          id 345
          course 362
          name Final Exam, part A (timed short answer)
          intro <p>You may use any sources you like except others in the class.</p>
          introformat 1
          timeopen 1335560400
          timeclose 1336007400
          preferredbehaviour deferredfeedback
          attempts 1
          attemptonlast 0
          grademethod 1
          decimalpoints 2
          questiondecimalpoints -1
          reviewattempt 69904
          reviewcorrectness 16
          reviewmarks 16
          reviewspecificfeedback 4368
          reviewgeneralfeedback 4368
          reviewrightanswer 16
          reviewoverallfeedback 4352
          questionsperpage 0
          shufflequestions 0
          shuffleanswers 1
          questions 3036,4119,4120,4121,4122,4123,4124,4125,4127,4128,4129,4131,4132,4133,4134,4135,4136,2940,3331,4081,4080,4086,3329,2968,3330,2992,3702,3705,3708,4021,4001,4037,4039,4049,4064,4063,4062,3688,2955,3710,3709,3711,3687,0
          sumgrades 81
          grade 100
          timecreated 0
          timemodified 1335533056
          timelimit 3000
          password
          subnet
          browsersecurity -
          delay1 0
          delay2 0
          showuserpicture 0
          showblocks 0

          Values in the quiz_instances table for this quiz remain as they were (note they total 81 because of the questions that show as 0):
          id quiz question grade
          3537 466 0 1
          3538 466 0 1
          3539 466 0 1
          3540 466 0 1
          3541 466 0 1
          3542 466 0 1
          3543 466 0 1
          3544 466 0 1
          3545 466 0 1
          3546 466 0 1
          3547 466 0 1
          3548 466 0 1
          3549 466 0 1
          3550 466 0 1
          3551 466 0 1
          3552 466 0 1
          3553 466 0 1
          3554 466 0 1
          3555 466 0 1
          3556 466 0 1
          3557 466 0 1
          3558 466 0 1
          3559 466 0 1
          3560 466 0 1
          3561 466 0 1
          3562 466 0 1
          3563 466 0 1
          3564 466 0 1
          3565 466 0 1
          3566 466 0 1
          3567 466 0 1
          3568 466 0 1
          3569 466 0 1
          3570 466 0 1
          3571 466 0 1
          3572 466 0 1
          3573 466 0 1
          3574 466 0 1
          3575 466 0 1
          3576 466 0 1
          3577 466 0 1
          3578 466 0 1
          3579 466 3036 0
          3580 466 4121 1
          3581 466 4123 1
          3582 466 4120 1
          3583 466 4122 1
          3584 466 4124 1
          3585 466 4119 0
          3586 466 4125 0
          3587 466 4127 1
          3588 466 4128 1
          3589 466 4129 1
          3590 466 4131 0
          3591 466 4134 1
          3592 466 4132 1
          3593 466 4133 1
          3594 466 4135 1
          3595 466 4136 1
          3596 466 2940 1
          3597 466 3331 1
          3598 466 4081 1
          3599 466 4080 1
          3600 466 4086 1
          3601 466 3329 1
          3602 466 2968 1
          3603 466 3330 1
          3604 466 2992 1
          3605 466 3702 1
          3606 466 3705 1
          3607 466 3708 1
          3608 466 4021 1
          3609 466 4001 1
          3610 466 4037 1
          3611 466 4039 1
          3612 466 4049 1
          3613 466 4064 1
          3614 466 4063 1
          3615 466 4062 1
          3616 466 3688 1
          3617 466 2955 1
          3618 466 3710 1
          3619 466 3709 1
          3620 466 3711 1
          3621 466 3687 1

          Show
          mindyk Melinda Kraft added a comment - Tim, here is the data you requested, post 2.3 upgrade. The values in my mdl_quiz table for the quiz in question (note sum of grades is 81, not 39 - quiz_instances data is at the end): id 345 course 362 name Final Exam, part A (timed short answer) intro <p>You may use any sources you like except others in the class.</p> introformat 1 timeopen 1335560400 timeclose 1336007400 preferredbehaviour deferredfeedback attempts 1 attemptonlast 0 grademethod 1 decimalpoints 2 questiondecimalpoints -1 reviewattempt 69904 reviewcorrectness 16 reviewmarks 16 reviewspecificfeedback 4368 reviewgeneralfeedback 4368 reviewrightanswer 16 reviewoverallfeedback 4352 questionsperpage 0 shufflequestions 0 shuffleanswers 1 questions 3036,4119,4120,4121,4122,4123,4124,4125,4127,4128,4129,4131,4132,4133,4134,4135,4136,2940,3331,4081,4080,4086,3329,2968,3330,2992,3702,3705,3708,4021,4001,4037,4039,4049,4064,4063,4062,3688,2955,3710,3709,3711,3687,0 sumgrades 81 grade 100 timecreated 0 timemodified 1335533056 timelimit 3000 password subnet browsersecurity - delay1 0 delay2 0 showuserpicture 0 showblocks 0 Values in the quiz_instances table for this quiz remain as they were (note they total 81 because of the questions that show as 0): id quiz question grade 3537 466 0 1 3538 466 0 1 3539 466 0 1 3540 466 0 1 3541 466 0 1 3542 466 0 1 3543 466 0 1 3544 466 0 1 3545 466 0 1 3546 466 0 1 3547 466 0 1 3548 466 0 1 3549 466 0 1 3550 466 0 1 3551 466 0 1 3552 466 0 1 3553 466 0 1 3554 466 0 1 3555 466 0 1 3556 466 0 1 3557 466 0 1 3558 466 0 1 3559 466 0 1 3560 466 0 1 3561 466 0 1 3562 466 0 1 3563 466 0 1 3564 466 0 1 3565 466 0 1 3566 466 0 1 3567 466 0 1 3568 466 0 1 3569 466 0 1 3570 466 0 1 3571 466 0 1 3572 466 0 1 3573 466 0 1 3574 466 0 1 3575 466 0 1 3576 466 0 1 3577 466 0 1 3578 466 0 1 3579 466 3036 0 3580 466 4121 1 3581 466 4123 1 3582 466 4120 1 3583 466 4122 1 3584 466 4124 1 3585 466 4119 0 3586 466 4125 0 3587 466 4127 1 3588 466 4128 1 3589 466 4129 1 3590 466 4131 0 3591 466 4134 1 3592 466 4132 1 3593 466 4133 1 3594 466 4135 1 3595 466 4136 1 3596 466 2940 1 3597 466 3331 1 3598 466 4081 1 3599 466 4080 1 3600 466 4086 1 3601 466 3329 1 3602 466 2968 1 3603 466 3330 1 3604 466 2992 1 3605 466 3702 1 3606 466 3705 1 3607 466 3708 1 3608 466 4021 1 3609 466 4001 1 3610 466 4037 1 3611 466 4039 1 3612 466 4049 1 3613 466 4064 1 3614 466 4063 1 3615 466 4062 1 3616 466 3688 1 3617 466 2955 1 3618 466 3710 1 3619 466 3709 1 3620 466 3711 1 3621 466 3687 1
          Hide
          mindyk Melinda Kraft added a comment - - edited

          If you look at my earlier post you will see that we suspect that the bad data occurred from a restored quiz where the teacher deleted some questions from the quiz, then added others. He suspects the deleted questions are the ones that were retained in the instances table with a question value of 0 and a grade of 1.

          I am also happy and relieved to add that this appears to be the only quiz that had the problem. Not that it probably helps, but duplicating the quiz in the Moodle edit interface duplicates the problem in the instances table for the new quiz created.

          Show
          mindyk Melinda Kraft added a comment - - edited If you look at my earlier post you will see that we suspect that the bad data occurred from a restored quiz where the teacher deleted some questions from the quiz, then added others. He suspects the deleted questions are the ones that were retained in the instances table with a question value of 0 and a grade of 1. I am also happy and relieved to add that this appears to be the only quiz that had the problem. Not that it probably helps, but duplicating the quiz in the Moodle edit interface duplicates the problem in the instances table for the new quiz created.
          Hide
          timhunt Tim Hunt added a comment -

          I just rediscovered this bug.

          Thinking about it again, I think all we can do is to add an upgrade step that deletes any quiz_question_instances rows where question = 0. Such rows are clearly garbage, and since they are causing problems, the need to be deleted. We may as well do that automatically.

          Show
          timhunt Tim Hunt added a comment - I just rediscovered this bug. Thinking about it again, I think all we can do is to add an upgrade step that deletes any quiz_question_instances rows where question = 0. Such rows are clearly garbage, and since they are causing problems, the need to be deleted. We may as well do that automatically.
          Hide
          poltawski Dan Poltawski added a comment -

          Integrated to 22, 23 and master.

          Thanks Tim.

          Show
          poltawski Dan Poltawski added a comment - Integrated to 22, 23 and master. Thanks Tim.
          Hide
          poltawski Dan Poltawski added a comment -

          Integration server to the rescue (i'll fix it)

           - /Users/Shared/Jenkins/Home/git_repositories/MOODLE_22_STABLE/mod/quiz/db/upgrade.php: 
              + ERROR: version 2011112903 has wrong savepoint call with version 2012061702

          Show
          poltawski Dan Poltawski added a comment - Integration server to the rescue (i'll fix it) - /Users/Shared/Jenkins/Home/git_repositories/MOODLE_22_STABLE/mod/quiz/db/upgrade.php: + ERROR: version 2011112903 has wrong savepoint call with version 2012061702
          Hide
          timhunt Tim Hunt added a comment -

          Bum! Thanks Dan. I thought I was being careful about things like that.

          Show
          timhunt Tim Hunt added a comment - Bum! Thanks Dan. I thought I was being careful about things like that.
          Hide
          poltawski Dan Poltawski added a comment -

          All good now (forgot to reset status)

          Show
          poltawski Dan Poltawski added a comment - All good now (forgot to reset status)
          Hide
          dmonllao David Monllaó added a comment -

          To replicate the http://tracker.moodle.org/browse/MDL-32791?focusedCommentId=158391&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-158391 scenario I've tested it forcing quiz_question_instance records with question = 0, updating the quiz->questions field and changing the module version in db/upgrade.php and version.php to an upper version to execute the upgrade process. Marked as "Test passed" since I've seen no crashes, if I just remove records with quiz_question_instances->question = 0 the quiz crashes but the described scenario doesn't seems to fill in this.

          Tested in 2.2 and master.

          Show
          dmonllao David Monllaó added a comment - To replicate the http://tracker.moodle.org/browse/MDL-32791?focusedCommentId=158391&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-158391 scenario I've tested it forcing quiz_question_instance records with question = 0, updating the quiz->questions field and changing the module version in db/upgrade.php and version.php to an upper version to execute the upgrade process. Marked as "Test passed" since I've seen no crashes, if I just remove records with quiz_question_instances->question = 0 the quiz crashes but the described scenario doesn't seems to fill in this. Tested in 2.2 and master.
          Hide
          poltawski Dan Poltawski added a comment -

          asko, Дзякуй, ধন্যবাদ, Благодаря, Gràcies, 感谢, 謝謝, Hvala, Díky, Tak, Bedankt, Tänan, متشکریم, Salamat, Kiitokset, Merci, Grazas, Danke, Ευχαριστώ, આભાર, תודה, धन्यवाद, Köszönjük, Takk fyrir, Terima Kasih, Grazie, ありがとうございます, Рахмет, សូមអរគុណ, 감사합니다, gratiās, Pateicamies, Ačiū, Благодарам, Tēnā koa, Kia Ora Rawa Atu, आभारी आहोत, Талархал, Takk, Dziękuję, Obrigado, Mulţumesc, Engraziel, Спасибо, Fa'afetai, Хвала, Hvala, ස්තූතියි, Vďaka, Hvala, Mahadsanid, Thanks, Gracias, Tack, Salamat, நன்றி, నెనరులు, ขอบคุณค่ะ!

          Your work has made it into this weeks Moodle release! There are no gold medals available this week - but millions around the world will benefit. Thank you!

          Show
          poltawski Dan Poltawski added a comment - asko, Дзякуй, ধন্যবাদ, Благодаря, Gràcies, 感谢, 謝謝, Hvala, Díky, Tak, Bedankt, Tänan, متشکریم, Salamat, Kiitokset, Merci, Grazas, Danke, Ευχαριστώ, આભાર, תודה, धन्यवाद, Köszönjük, Takk fyrir, Terima Kasih, Grazie, ありがとうございます, Рахмет, សូមអរគុណ, 감사합니다, gratiās, Pateicamies, Ačiū, Благодарам, Tēnā koa, Kia Ora Rawa Atu, आभारी आहोत, Талархал, Takk, Dziękuję, Obrigado, Mulţumesc, Engraziel, Спасибо, Fa'afetai, Хвала, Hvala, ස්තූතියි, Vďaka, Hvala, Mahadsanid, Thanks, Gracias, Tack, Salamat, நன்றி, నెనరులు, ขอบคุณค่ะ! Your work has made it into this weeks Moodle release! There are no gold medals available this week - but millions around the world will benefit. Thank you!
          Hide
          bltmacomb Barbara Taylor added a comment -

          We are running 2.3.2 (Build: 20120910) and we have a quiz with these settings: Marks 19, Questions 18, Maximum grade 18. The grades are off by 1 point. How do we fix it so the Marks is equal to Questions? Did we miss a release that fixed this?

          Show
          bltmacomb Barbara Taylor added a comment - We are running 2.3.2 (Build: 20120910) and we have a quiz with these settings: Marks 19, Questions 18, Maximum grade 18. The grades are off by 1 point. How do we fix it so the Marks is equal to Questions? Did we miss a release that fixed this?
          Hide
          timhunt Tim Hunt added a comment -

          That is odd. Can you try the following:

          1. On the edit quiz page, try changing the Mark for one question from 1 to 2 (and save changes) then change it back from 2 to 1 again. See if that sorts it out.

          2. If the numbers are still weird, are you able to try a direct database query, like

          SELECT * FROM mdl_quiz_question_instances WHERE quiz =

          {quizid}

          and see if the list of questions is right.

          Show
          timhunt Tim Hunt added a comment - That is odd. Can you try the following: 1. On the edit quiz page, try changing the Mark for one question from 1 to 2 (and save changes) then change it back from 2 to 1 again. See if that sorts it out. 2. If the numbers are still weird, are you able to try a direct database query, like SELECT * FROM mdl_quiz_question_instances WHERE quiz = {quizid} and see if the list of questions is right.
          Hide
          evillard Eric Villard added a comment -

          Hi,

          I was faced of the same issue with an imported quiz.
          As the plugin upgrade was already done, I had to apply the fix manually.
          So, to make it easier I created a plugin available here : https://github.com/eviweb/moodle-local_sanitychecker.git
          At this time, it provides only the fix for this issue, but is designed to give access to other sniffers.

          Eric

          Show
          evillard Eric Villard added a comment - Hi, I was faced of the same issue with an imported quiz. As the plugin upgrade was already done, I had to apply the fix manually. So, to make it easier I created a plugin available here : https://github.com/eviweb/moodle-local_sanitychecker.git At this time, it provides only the fix for this issue, but is designed to give access to other sniffers. Eric
          Hide
          pjfish06 Susan Mangan added a comment - - edited

          Still experiencing this in latest 2.6.10 build. We will be upgrading to 2.8 during later in summer but we have exams running now and incorrect totals

          Tried this: "On the edit quiz page, try changing the Mark for one question from 1 to 2 (and save changes) then change it back from 2 to 1 again. See if that sorts it out."

          Did not work, ran above query and results show one extra question that is not on the actual Quiz.

          I need a safe fix. Not sure if I can just remove the extra row directly in the database?

          Also, anything that can be changed in the code so we can make sure quiz totals are accurate for our next term? assuming this is not an issue in 2.7 2.8 branches so will not be an issue in the Fall (hopefully)

          Show
          pjfish06 Susan Mangan added a comment - - edited Still experiencing this in latest 2.6.10 build. We will be upgrading to 2.8 during later in summer but we have exams running now and incorrect totals Tried this: "On the edit quiz page, try changing the Mark for one question from 1 to 2 (and save changes) then change it back from 2 to 1 again. See if that sorts it out." Did not work, ran above query and results show one extra question that is not on the actual Quiz. I need a safe fix. Not sure if I can just remove the extra row directly in the database? Also, anything that can be changed in the code so we can make sure quiz totals are accurate for our next term? assuming this is not an issue in 2.7 2.8 branches so will not be an issue in the Fall (hopefully)

            People

            • Votes:
              6 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Sep/12