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

Cannot create questions using Oracle 10 in Moodle 2.1 and onwards

    Details

    • Database:
      Oracle
    • Testing Instructions:
      Hide

      Install a Moodle 2.1 or 2.2 version
      Go to the question bank (general or in a course)
      Create a new question multichoice, with penalty (decimal)

      Show
      Install a Moodle 2.1 or 2.2 version Go to the question bank (general or in a course) Create a new question multichoice, with penalty (decimal)
    • Workaround:
      Hide

      I think the problem is in the base form:
      https://github.com/moodle/moodle/blob/MOODLE_21_STABLE/question/type/edit_question_form.php#L382

      The penalty is not "typed" as number

      In previous versions (2.0), the penalty field is "typed" as number
      https://github.com/moodle/moodle/blob/MOODLE_20_STABLE/question/type/edit_question_form.php#L149
      $mform->setType('penalty', PARAM_NUMBER);

      Show
      I think the problem is in the base form: https://github.com/moodle/moodle/blob/MOODLE_21_STABLE/question/type/edit_question_form.php#L382 The penalty is not "typed" as number In previous versions (2.0), the penalty field is "typed" as number https://github.com/moodle/moodle/blob/MOODLE_20_STABLE/question/type/edit_question_form.php#L149 $mform->setType('penalty', PARAM_NUMBER);
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE

      Description

      When trying to create a new question (multichoice) we got this error:

      [Wed Jan 18 18:26:04 2012] [error] [client 10.100.100.21] Default exception handler: Error al escribir a la base de datos Debug: ORA-01722: n\xc3\xbamero no v\xc3\xa1lido\n
      INSERT INTO m_question (category,qtype,name,parent,length,penalty,questiontext,questiontextformat,generalfeedback,generalfeedbackformat,defaultmark,stamp,createdby,timecreated) VALUES (:category,:qtype,:name,:parent,:length,:penalty,:questiontext,:questiontextformat,:generalfeedback,:generalfeedbackformat,:defaultmark,:stamp,:createdby,:timecreated) RETURNING id INTO :oracle_id\n[array (\n 'category' => '2',\n 'qtype' => 'multichoice',\n 'name' => '1',\n 'parent' => 0,\n 'length' => 1,\n 'penalty' => '0.3333333',\n 'questiontext' => '<p>asfsadf</p>',\n 'questiontextformat' => '1',\n 'generalfeedback' => '',\n 'generalfeedbackformat' => '1',\n 'defaultmark' => 1,\n 'stamp' => 'mydomain.es+120118172604+bxcrL1',\n 'createdby' => '2',\n 'timecreated' => 1326907564,\n)]\n* line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown\n* line 273 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()\n* line 1205 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()\n* line 1248 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->insert_record_raw()\n* line 393 of /question/type/questiontypebase.php: call to oci_native_moodle_database->insert_record()\n* line 264 of /question/question.php: call to question_type->save_question()\n, referer: http://mydomain.es/question/question.php?returnurl=%2Fquestion%2Fedit.php%3Fcmid%3D82&cmid=82&category=2&qtype=multichoice

      According to: http://www.orafaq.com/wiki/ORA-01722
      An ORA-01722 error occurs when an attempt is made to convert a character string into a number

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  4 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated: