Details
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.
Bug is still present in 1.9.2+ build 20081008. The solution described earlier works just fine. No side effects yet.