Index: question/type/shortanswer/backup/moodle2/restore_qtype_shortanswer_plugin.class.php =================================================================== RCS file: /cvsroot/moodle/moodle/question/type/shortanswer/backup/moodle2/restore_qtype_shortanswer_plugin.class.php,v retrieving revision 1.2 diff -u -r1.2 restore_qtype_shortanswer_plugin.class.php --- question/type/shortanswer/backup/moodle2/restore_qtype_shortanswer_plugin.class.php 9 Jun 2011 02:10:09 -0000 1.2 +++ question/type/shortanswer/backup/moodle2/restore_qtype_shortanswer_plugin.class.php 7 Feb 2012 06:57:06 -0000 @@ -75,6 +75,10 @@ // Map sequence of question_answer ids $answersarr = explode(',', $data->answers); foreach ($answersarr as $key => $answer) { + //Postgresql does not handle empty strings as integer values + if ($answer == '') { + $answer = null; + } $answersarr[$key] = $this->get_mappingid('question_answer', $answer); } $data->answers = implode(',', $answersarr);