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

HotPot question import inserts null values in a not nullable field

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 2.2.2
    • Module: HotPot
    • None
    • MOODLE_22_STABLE

      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)

            xxxxxxx Gordon Bateson
            toni.ginard Toni Ginard
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.