Moodle
  1. Moodle
  2. MDL-32213

3rd party manually-graded question types do not upgrade properly

    Details

    • Testing Instructions:
      Hide

      Repeat for versions 2.1 and 2.2

      1. Set up a Moodle 2.0 site, create a quiz and add at least one essay question
      2. Log in as a student and attempt the quiz, answering all answers and submitting
      3. upgrade the site to Moodle [2.1 or 2.2]
      4. login as an admin/teacher and confirm that the question responses are present and that the questions are marked as being in need of manual grading
      Show
      Repeat for versions 2.1 and 2.2 Set up a Moodle 2.0 site, create a quiz and add at least one essay question Log in as a student and attempt the quiz, answering all answers and submitting upgrade the site to Moodle [2.1 or 2.2] login as an admin/teacher and confirm that the question responses are present and that the questions are marked as being in need of manual grading
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      MDL-32213_manual_grade_question_upgrade
    • Rank:
      38988

      Description

      The function 'get_converter_class_name' in '/question/engine/upgrade/upgradelib.php' is hard-coded to treat the question type 'essay' as manually-graded, when it should treat all manually-graded question types as manually-graded. I'm not sure quite how clear that last sentence was, so hopefully the fix is a bit clearer - change:

      if ($question->qtype == 'essay') {

      to:

      $qtype = question_bank::get_qtype($question->qtype, false);
      if ($qtype->is_manual_graded()) {

        Activity

        Hide
        Tim Hunt added a comment -

        That looks good. How about a git branch that I can submit for integration?

        Show
        Tim Hunt added a comment - That looks good. How about a git branch that I can submit for integration?
        Hide
        Davo Smith added a comment -

        There you go, Tim.

        It should cherry-pick fine to the other branches.

        Show
        Davo Smith added a comment - There you go, Tim. It should cherry-pick fine to the other branches.
        Hide
        Tim Hunt added a comment -

        What testing have you done?

        Can you write some testing instructions?

        Show
        Tim Hunt added a comment - What testing have you done? Can you write some testing instructions?
        Hide
        Davo Smith added a comment -

        I've tested it by running a 1.9 => 2.2 upgrade several times with a custom question type, based on the essay type.

        Added some testing instructions.

        Show
        Davo Smith added a comment - I've tested it by running a 1.9 => 2.2 upgrade several times with a custom question type, based on the essay type. Added some testing instructions.
        Hide
        Tim Hunt added a comment -

        To INTEGRATORS:

        Please cherry-pick to all branches 2.1+

        Show
        Tim Hunt added a comment - To INTEGRATORS: Please cherry-pick to all branches 2.1+
        Hide
        Eloy Lafuente (stronk7) added a comment -

        The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

        TIA and ciao

        Show
        Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
        Hide
        Dan Poltawski added a comment -

        Tim, do you know if there are any manually graded question types to use for testing this which aren't the essay question type?

        Show
        Dan Poltawski added a comment - Tim, do you know if there are any manually graded question types to use for testing this which aren't the essay question type?
        Hide
        Tim Hunt added a comment -

        No. Sorry. Davo is clearly working on one, and reviewing the code change, it seems very low-risk to me.

        I think what we really need to test is that Upgrade from 2.0 -> 2.1+ still works for standard Moodle essay qtypes. In other words, I think it is sufficient if we just test with essay. We can assume that what Davo has done, works for his 3rd party type.

        Show
        Tim Hunt added a comment - No. Sorry. Davo is clearly working on one, and reviewing the code change, it seems very low-risk to me. I think what we really need to test is that Upgrade from 2.0 -> 2.1+ still works for standard Moodle essay qtypes. In other words, I think it is sufficient if we just test with essay. We can assume that what Davo has done, works for his 3rd party type.
        Hide
        Dan Poltawski added a comment -

        Thanks, i've integrated this now.

        Show
        Dan Poltawski added a comment - Thanks, i've integrated this now.
        Hide
        Jason Fowler added a comment -

        Works fine - I upgraded from 2.0 to 2.2 ...

        Show
        Jason Fowler added a comment - Works fine - I upgraded from 2.0 to 2.2 ...
        Hide
        Aparup Banerjee added a comment -

        The code here has been spread to upstream moodle repositories and mirrors for anyone to use .

        Closing, have a good weekend!

        Show
        Aparup Banerjee added a comment - The code here has been spread to upstream moodle repositories and mirrors for anyone to use . Closing, have a good weekend!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: