Moodle
  1. Moodle
  2. MDL-31829

ERROR: Colum "attemptstepid" does not exits

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.4, 2.2.1, 2.3
    • Fix Version/s: 2.1.5, 2.2.2
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide

      It is quite tricky to reproduce this bug, so you will need to follow these instructions closely.

      1. Create a quiz set to use interactive behaviour with one short-answer question as follows:
      Question name: Regrade test.
      Question text: What is the best amphibian?
      Answer 1 -> Answer: Toad
      Answer 1 -> Grade: 100%
      Hint 1 -> Hint text: Hint 1

      2. Attempt the quiz as a student.

      3. First, give the response 'Frog' and click Check.

      4. Click Try again.

      5. Give the response 'Toad' and click Check.

      6. Click Next

      7. Click Submit all and finish.

      8. Now, as teacher, edit the question and change
      Answer 1 -> Answer: Frog

      9. Go to Results -> Grades, and click the regrade all button.

      10. Verify that the student's grade changes from 66.67% (or whatever it was) to 100%, and more importantly that there are no fatal errors.

      Having tested this specific case, you are encouraged to test some other regrades, to help verify that there are no other regressions I have not thought of.

      Show
      It is quite tricky to reproduce this bug, so you will need to follow these instructions closely. 1. Create a quiz set to use interactive behaviour with one short-answer question as follows: Question name: Regrade test. Question text: What is the best amphibian? Answer 1 -> Answer: Toad Answer 1 -> Grade: 100% Hint 1 -> Hint text: Hint 1 2. Attempt the quiz as a student. 3. First, give the response 'Frog' and click Check. 4. Click Try again. 5. Give the response 'Toad' and click Check. 6. Click Next 7. Click Submit all and finish. 8. Now, as teacher, edit the question and change Answer 1 -> Answer: Frog 9. Go to Results -> Grades, and click the regrade all button. 10. Verify that the student's grade changes from 66.67% (or whatever it was) to 100%, and more importantly that there are no fatal errors. Having tested this specific case, you are encouraged to test some other regrades, to help verify that there are no other regressions I have not thought of.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      38468

      Description

      Bjorn Hilmarsson mentioned in the moodle.org forum a problem with regrading quizzes. Tim Hunt noted the bug, and suggested to Bjorn to post it in tracker. I am doing this on behalf of both Bjorn and Tim. Tim said he would fix this bug quickly.

      Forum = http://moodle.org/mod/forum/discuss.php?d=197277#p859974

      Error =

      "We have a large moodle website for the university of iceland and we are not able to do regrade all we get this error message:

      Debug: ERROR: column "attemptstepid" does not exist\nLINE 1: DELETE FROM mdl_question_attempt_steps WHERE attemptstepid =...\n ^\nDELETE FROM "

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          Thanks Rick.

          I think the correct fix is to change lines 809-810 of question/engine/datalib.php from

                  $this->db->delete_records_select('question_attempt_steps',
                          "attemptstepid $test", $params);
          

          to

                  $this->db->delete_records_select('question_attempt_steps',
                          "id $test", $params);
          

          If anyone can test that and confirm, that would be really helpful. Anyway, I will try to make this into a proper fix and apply it tomorrow.

          Show
          Tim Hunt added a comment - Thanks Rick. I think the correct fix is to change lines 809-810 of question/engine/datalib.php from $ this ->db->delete_records_select('question_attempt_steps', "attemptstepid $test" , $params); to $ this ->db->delete_records_select('question_attempt_steps', "id $test" , $params); If anyone can test that and confirm, that would be really helpful. Anyway, I will try to make this into a proper fix and apply it tomorrow.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks! (21, 22 & master)

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks! (21, 22 & master)
          Hide
          Sam Hemelryk added a comment -

          Thanks Tim, passing this test now

          Show
          Sam Hemelryk added a comment - Thanks Tim, passing this test now
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Your changes are now upstream and will be included in the next minor released scheduled for March 13th (next Monday!).

          icao_reverse('arreis olik rebemevon afla letoh ognat');
          

          Closing, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Your changes are now upstream and will be included in the next minor released scheduled for March 13th (next Monday!). icao_reverse('arreis olik rebemevon afla letoh ognat'); Closing, ciao
          Hide
          Jean-Philippe Gaudreau added a comment -

          Hi guys,

          Are you sure the testing instructions for this bug are ok? I've just tested in 2.2.1 without the fix and there is no problems... If the patch really fixes a bug, can you provide me any testing instructions that will reproduce it?

          thx!

          Show
          Jean-Philippe Gaudreau added a comment - Hi guys, Are you sure the testing instructions for this bug are ok? I've just tested in 2.2.1 without the fix and there is no problems... If the patch really fixes a bug, can you provide me any testing instructions that will reproduce it? thx!
          Hide
          Tim Hunt added a comment -

          Note the bit above where it says "This issue is a regression caused by: MDL-30484". There were no problems in Moodle 2.2.1 (well, there were other more serious problems, which is what MDL-30484 fixed). This problem created and fixed between 2.2.1 and 2.2.2.

          Show
          Tim Hunt added a comment - Note the bit above where it says "This issue is a regression caused by: MDL-30484 ". There were no problems in Moodle 2.2.1 (well, there were other more serious problems, which is what MDL-30484 fixed). This problem created and fixed between 2.2.1 and 2.2.2.
          Hide
          Jean-Philippe Gaudreau added a comment -

          Ok thx for the clarification Tim!

          Show
          Jean-Philippe Gaudreau added a comment - Ok thx for the clarification Tim!

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: