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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1
    • 2.1
    • Questions
    • MOODLE_21_STABLE
    • MOODLE_21_STABLE
    • 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.
    • 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.

    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

              timhunt Tim Hunt
              samhemelryk Sam Hemelryk
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Safat Shahin, Tim Hunt, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Raquel Ortega, Sabina Abellan, Sander Bangma, Sara Arjona (@sarjona), Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                1/Jul/11