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

Problems updating Embedded Answers (Cloze)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9.1
    • 1.9.5
    • Questions
    • None
    • linux, postgres
    • PostgreSQL
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

    Description

      When we want to update cloze-questions, there is an error and it is not possible:

      ERROR: invalid input syntax for integer: "49,1"

      UPDATE mdl_question SET category = '49,1',parent = '1811',name = 'Lückentext-Frage',questiontext = '

      {1:MULTICHOICE:~=starke~schwache}

      ',questiontextformat = '0',image = '',generalfeedback = '',defaultgrade = '1',penalty = '0',qtype = 'multichoice',length = '1',stamp = 'sandkasten.ethz.ch+080721120644+2ohm9v',timemodified = '1216734374',modifiedby = '5' WHERE id = 1812

      We use a postgres-db. The db-field category is a bigint and postgres doesn't accept '49,1' as an integer. mysql does and so there is no problem with mysql. In this case 49 is stored in the db.

      In the method 'save_question_options' of the class 'embedded_cloze_qtype' (question/type/multianswer/questiontype.php) ',1' is added to the category of the question. In the comment it says that the method 'save_question' should strip this extra bit off again. Why is this ',1' needed? As a workaround we cleaned it out and it seems to work anyway. But maybe there are side effects.

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              raol Oliver Rahs
              Jérôme Mouneyrac Jérôme Mouneyrac
              Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/May/09