Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-3565

HotPot question import inserts null values in a not nullable field

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: Module: HotPot
    • Labels:
      None
    • Affected Branches:
      MOODLE_22_STABLE

      Description

      I'm using Moodle 2.2.x on an Oracle database and I've found an issue while importing a .jqz file. After some debugging I've seen the SQL query in mdl_question table sets the value '' to field generalfeedback; in other words, it is trying to set an empty value to a not nullable field. MySQL has no problem with it, but Oracle complains and throws an error "ORA-01400: cannot insert NULL into generalfeedback.

      The fix would be forcing this field being always populated.

      Example: this SQL works on MySQL, but not on Oracle

      INSERT INTO mdl_question (defaultmark,questiontextformat,generalfeedback,generalfeedbackformat,penalty,length,name,questiontext,qtype,category,stamp,createdby,timecreated,modifiedby,timemodified)
      VALUES (1,'1','','0',0.3333333,1,'Mi primer ejercicio','¿Cuál es la capital de Vietnam?','multichoice','22','agora+120402123533+5r4Ueo','2',1333370133,'2',1333370133)

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: