Moodle
  1. Moodle
  2. MDL-13892

undefined offset when displaying choice results

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9.1
    • Component/s: Choice
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      30435

      Description

      Notice: Undefined offset: 141 in /var/www/moodle/mod/choice/lib.php on line 147 [repeated for as many options there are]

      The line is:
      $cdisplay[$aid]->countanswers = count($allresponses[$optionid]);

      doing a print_object of $allrespones:
      Array
      (
      [0] => Array
      (
      [631] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 45
      [idnumber] =>
      [id] => 631
      )

      [761] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 58
      [idnumber] =>
      [id] => 761
      )

      [701] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 52
      [idnumber] =>
      [id] => 701
      )

      [641] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 46
      [idnumber] =>
      [id] => 641
      )

      [771] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 59
      [idnumber] =>
      [id] => 771
      )

      [711] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 53
      [idnumber] =>
      [id] => 711
      )

      [651] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 47
      [idnumber] =>
      [id] => 651
      )

      [781] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 60
      [idnumber] =>
      [id] => 781
      )

      [591] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 41
      [idnumber] =>
      [id] => 591
      )

      [721] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 54
      [idnumber] =>
      [id] => 721
      )

      [661] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 48
      [idnumber] =>
      [id] => 661
      )

      [601] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 42
      [idnumber] =>
      [id] => 601
      )

      [731] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 55
      [idnumber] =>
      [id] => 731
      )

      [671] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 49
      [idnumber] =>
      [id] => 671
      )

      [611] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 43
      [idnumber] =>
      [id] => 611
      )

      [741] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 56
      [idnumber] =>
      [id] => 741
      )

      [681] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 50
      [idnumber] =>
      [id] => 681
      )

      [621] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 44
      [idnumber] =>
      [id] => 621
      )

      [751] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 57
      [idnumber] =>
      [id] => 751
      )

      [691] => stdClass Object
      (
      [picture] => 0
      [firstname] => Trainee
      [lastname] => 51
      [idnumber] =>
      [id] => 691
      )

      )

      )

        Activity

        Hide
        Dan Marsden added a comment -

        thanks Dan - I meant to patch that on Monday! - I'm hoping all those users haven't already selected a choice? - if so, then I've fixed it in HEAD and 1.9stable - if those users "had" selected a choice, then I've only partially fixed it!

        thanks,

        Dan

        Show
        Dan Marsden added a comment - thanks Dan - I meant to patch that on Monday! - I'm hoping all those users haven't already selected a choice? - if so, then I've fixed it in HEAD and 1.9stable - if those users "had" selected a choice, then I've only partially fixed it! thanks, Dan
        Hide
        Dan Poltawski added a comment -

        Yeah there were no answers, thanks!

        Show
        Dan Poltawski added a comment - Yeah there were no answers, thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: