Moodle
  1. Moodle
  2. MDL-17309

code for upgrading from 1.5 db structure in report.php

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.7
    • Fix Version/s: 2.1
    • Component/s: Quiz
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Rank:
      1377

      Description

      The following code is executed every time a report is viewed :

      // Upgrade any attempts that have not yet been upgraded to the
      // Moodle 1.5 model (they will not yet have the timestamp set)
      if ($attempts = $DB->get_records_sql("SELECT a.*".
      " FROM

      {quiz_attempts}

      a,

      {question_states}

      s".
      " WHERE a.quiz = ? AND s.attempt = a.uniqueid AND s.timestamp = 0", array($quiz->id))) {
      foreach ($attempts as $attempt)

      { quiz_upgrade_states($attempt); }

      }

      It is in mod/quiz/report.php.

      I think it needs to be removed from HEAD and can possibly be removed from 1.9 and 1.8 too?

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          The problem was that there was never a proper upgrade of old attempts from 1.5 to 1.6. If you look in upgrade.php, it just upgraded open attempts, and left the other to be upgraded if they were ever viewed. This was to stop the upgrade taking forever.

          So in theory, if we remove this code, we would have to do the upgrade script again to deal with any remaining attempts. But it would be nice to sort this.

          I think it is worth removing from HEAD, and doing properly. I'll add it to my list.

          Show
          Tim Hunt added a comment - The problem was that there was never a proper upgrade of old attempts from 1.5 to 1.6. If you look in upgrade.php, it just upgraded open attempts, and left the other to be upgraded if they were ever viewed. This was to stop the upgrade taking forever. So in theory, if we remove this code, we would have to do the upgrade script again to deal with any remaining attempts. But it would be nice to sort this. I think it is worth removing from HEAD, and doing properly. I'll add it to my list.
          Hide
          Tim Hunt added a comment -

          I will be fixing this in the upgrade to my new question engine.

          Show
          Tim Hunt added a comment - I will be fixing this in the upgrade to my new question engine.
          Hide
          Tim Hunt added a comment -

          Fixed in 2.1 dev now that MDL-20636 has been integrated.

          Show
          Tim Hunt added a comment - Fixed in 2.1 dev now that MDL-20636 has been integrated.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: