Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-27865

Warnings and notices when creating a calculated simple question in a course

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      Try creating and editing all three types of calculated question.

      Note MDL-27868, which I found while working on this, and have not fixed yet.

      Show
      Try creating and editing all three types of calculated question. Note MDL-27868 , which I found while working on this, and have not fixed yet.
    • Workaround:
      Hide

      There are several workable workarounds to work around this problem:

      • Downgrade your site to Moodle 2.0.
      • Don't create calculated simple questions.
      • Freeze yourself and then have yourself reanimated one the problem has been resolved.
      • Close your eyes when you create a simple question so you don't see the warnings
      • Throw a penny at a wall [repeat until this bug has been fixed by someone]
      • Fix the problem yourself.
      Show
      There are several workable workarounds to work around this problem: Downgrade your site to Moodle 2.0. Don't create calculated simple questions. Freeze yourself and then have yourself reanimated one the problem has been resolved. Close your eyes when you create a simple question so you don't see the warnings Throw a penny at a wall [repeat until this bug has been fixed by someone] Fix the problem yourself.
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Hi Tim,

      I got these while testing some of the other issues you've fixed.
      If you create a calculated simple question using the values in the help page for this question type you can replicate the problem.

      Creating a calculated simple question

      Notice: Undefined property: qtype_calculatedsimple::$fileoptionsa in /var/git/integration/master/question/type/calculatedsimple/questiontype.php on line 109
      Call Stack

      1. Time Memory Function Location
        1 0.0013 888072
        Unknown macro: {main}

        ( ) ../question.php:0
        2 0.2397 45803064 qtype_calculated->save_question( ) ../question.php:264
        3 0.2397 45803280 question_type->save_question( ) ../questiontype.php:622
        4 0.3165 45878304 qtype_calculatedsimple->save_question_options( ) ../questiontypebase.php:424

        ( ! ) Warning: ksort() expects parameter 1 to be array, null given in /var/git/integration/master/question/type/calculatedsimple/questiontype.php on line 201
        Call Stack

        1. Time Memory Function Location
          1 0.0013 888072

        ( ) ../question.php:0
        2 0.2397 45803064 qtype_calculated->save_question( ) ../question.php:264
        3 0.2397 45803280 question_type->save_question( ) ../questiontype.php:622
        4 0.3165 45878304 qtype_calculatedsimple->save_question_options( ) ../questiontypebase.php:424
        5 0.5852 45999824 ksort ( ) ../questiontype.php:201

      ( ! ) Warning: Invalid argument supplied for foreach() in /var/git/integration/master/question/type/calculatedsimple/questiontype.php on line 202
      Call Stack

      1. Time Memory Function Location
        1 0.0013 888072
        Unknown macro: {main}

        ( ) ../question.php:0
        2 0.2397 45803064 qtype_calculated->save_question( ) ../question.php:264
        3 0.2397 45803280 question_type->save_question( ) ../questiontype.php:622
        4 0.3165 45878304 qtype_calculatedsimple->save_question_options( ) ../questiontypebase.php:424

      I also suspect that there are further problems this causes if you then use the created question in a quiz and/or backup/restore/export/attempt to take the quiz etc..

      Cheers
      Sam

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              samhemelryk Sam Hemelryk
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                1/Jul/11