The same happens when restoring a backup made in another moodle server, same moodle version 2.03+ on ubuntu 11.04 and apache2:
Debug info: ERROR: null value in column "sumgrades" violates not-null constraint
INSERT INTO mdl_quiz (name,intro,introformat,timeopen,timeclose,optionflags,penaltyscheme,attempts,attemptonlast,grademethod,decimalpoints,questiondecimalpoints,review,questionsperpage,shufflequestions,shuffleanswers,questions,sumgrades,grade,timecreated,timemodified,timelimit,password,subnet,popup,delay1,delay2,showuserpicture,showblocks,course) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30) RETURNING id
[array (
'name' => 'Whole Numbers Addition Quiz',
'intro' => '<p>Whole Numbers Addition Quiz</p>',
'introformat' => '1',
'timeopen' => '0',
'timeclose' => '0',
'optionflags' => '1',
'penaltyscheme' => '1',
'attempts' => '0',
'attemptonlast' => '0',
'grademethod' => '1',
'decimalpoints' => '2',
'questiondecimalpoints' => '-1',
'review' => '4459503',
'questionsperpage' => '1',
'shufflequestions' => '0',
'shuffleanswers' => '1',
'questions' => '',
'sumgrades' => NULL,
'grade' => '10.00000',
'timecreated' => '0',
'timemodified' => 1304606058,
'timelimit' => '0',
'password' => '',
'subnet' => '',
'popup' => '0',
'delay1' => '0',
'delay2' => '0',
'showuserpicture' => '0',
'showblocks' => '0',
'course' => 4,
)]
Stack trace:
- line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown
- line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
- line 781 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
- line 833 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
- line 78 of /mod/quiz/backup/moodle2/restore_quiz_stepslib.php: call to pgsql_native_moodle_database->insert_record()
- line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_quiz_activity_structure_step->process_quiz()
- line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
- line 106 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
- line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()
- line 132 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
- line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()
- line 169 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
- line 212 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
- line ? of unknownfile: call to progressive_parser->start_tag()
- line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
- line 137 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
- line 105 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
- line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
- line 170 of /backup/moodle2/restore_activity_task.class.php: call to base_task->execute()
- line 148 of /backup/util/plan/base_plan.class.php: call to restore_activity_task->execute()
- line 157 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
- line 299 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
- line 144 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
- line 39 of /backup/restore.php: call to restore_ui->execute()
Funny, I am not importing grades... Anyway, it restores only part of the course. I have done this before without problems in ubuntu 10.10. What am I doing wrong? How can I fix this?