QuizPort - Incorrect grade array

Re: QuizPort - Incorrect grade array

by Gordon Bateson -
Number of replies: 0
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
If anyone is interested in fixing the message which only seems to appear when restoring to the current course, try this:
  • in lib/gradelib.php

    • replace this:
      debugging('Incorrect grade array index, must be user id! Grade ignored.');

    • with this:
      // debugging('Incorrect grade array index, must be user id! Grade ignored.');
  • in backup/restorelib.php

    • replace this:
      $olditeminstance = backup_todb($info['GRADE_ITEM']['#']['ITEMINSTANCE']['0']['#'], false);
      $mod = backup_getid($restore->backup_unique_code,$dbrec->itemmodule, $olditeminstance);


    • with this:
      if (! $olditeminstance = backup_todb($info['GRADE_ITEM']['#']['ITEMINSTANCE']['0']['#'], false)) {
      continue; // item not backed up
      }
      if (! $mod = backup_getid($restore->backup_unique_code,$dbrec->itemmodule, $olditeminstance)) {
      continue; // mod not restored
      }

As I said, this message is just a "notice" not an "error", and I don't believe it eminates from the QuizPort module.

If I had more time I would report it on the Moodle Tracker ...