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

A question mark in the correct answer formula in calculated questions results in a php error

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.2
    • Fix Version/s: STABLE backlog
    • Component/s: Questions
    • Labels:
    • Database:
      Any
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      Created a simple calculated question in quiz. set the correct answer formula to

      {x}

      +

      {y}

      ?

      The presence of the question mark causes the following to be output.

      ( ! ) Parse error: syntax error, unexpected ';' in /home/andrew/Desktop/review/moodle/question/type/calculated/questiontype.php(1547) : eval()'d code on line 1
      Call Stack

      1. Time Memory Function Location
        1 0.0010 359896 {main}( ) ../question.php:0
        2 0.2373 46893840 default_questiontype->create_editing_form( ) ../question.php:180
        3 0.2403 47619192 question_edit_calculatedsimple_form->question_edit_calculatedsimple_form( ) ../questiontype.php:213
        4 0.2407 47644624 question_edit_form->question_edit_form( ) ../edit_calculatedsimple_form.php:271
        5 0.2410 47648200 moodleform->moodleform( ) ../edit_question_form.php:79
        6 0.2447 47870104 question_edit_form->definition( ) ../formslib.php:152
        7 0.2898 53262952 question_edit_calculatedsimple_form->definition_inner( ) ../edit_question_form.php:162
        8 0.3329 54410248 question_calculated_qtype->comment_on_datasetitems( ) ../edit_calculatedsimple_form.php:417
        9 0.3334 54417088 qtype_calculated_calculate_answer( ) ../questiontype.php:1322
        10 0.3334 54418152 question_calculated_qtype->substitute_variables_and_eval( ) ../questiontype.php:2183

        ( ! ) Parse error: syntax error, unexpected ';' in /home/andrew/Desktop/review/moodle/question/type/calculated/questiontype.php(1327) : eval()'d code on line 1
        Call Stack
        # Time Memory Function Location
        1 0.0010 359896 {main}

        ( ) ../question.php:0
        2 0.2373 46893840 default_questiontype->create_editing_form( ) ../question.php:180
        3 0.2403 47619192 question_edit_calculatedsimple_form->question_edit_calculatedsimple_form( ) ../questiontype.php:213
        4 0.2407 47644624 question_edit_form->question_edit_form( ) ../edit_calculatedsimple_form.php:271
        5 0.2410 47648200 moodleform->moodleform( ) ../edit_question_form.php:79
        6 0.2447 47870104 question_edit_form->definition( ) ../formslib.php:152
        7 0.2898 53262952 question_edit_calculatedsimple_form->definition_inner( ) ../edit_question_form.php:162
        8 0.3329 54410248 question_calculated_qtype->comment_on_datasetitems( ) ../edit_calculatedsimple_form.php:417

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated: