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

          Attachments

            Activity

              People

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

                Dates

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