Permalink
Browse files

MDL-27447 Backup - improvements to 1.9 quiz backup converter

  • Loading branch information...
1 parent 63e9bb6 commit 4b2da7cee08bea3c00338c5807f874a370c1c065 @nebgor nebgor committed Jun 1, 2011
Showing with 2 additions and 12 deletions.
  1. +2 −12 mod/quiz/backup/moodle1/lib.php
@@ -117,12 +117,7 @@ public function process_quiz_question_instance($data) {
// quiz_question_instances.grade should be decimal(12,7) not null default 0
// $data['grade'] and other precisions will be changed when inserted into db.
- $this->xmlwriter->begin_tag('question_instance', array('id' => $data['id']));
- unset($data['id']); // we already write it as attribute, do not repeat it as child element
- foreach ($data as $field => $value) {
- $this->xmlwriter->full_tag($field, $value);
- }
- $this->xmlwriter->end_tag('question_instance');
+ $this->write_xml('question_instance', $data, array('/question_instance/id'));
}
public function on_quiz_feedbacks_start() {
@@ -143,12 +138,7 @@ public function process_quiz_feedback($data) {
$data['maxgrade'] = 0;
}
- $this->xmlwriter->begin_tag('feedback', array('id' => $data['id']));
- unset($data['id']); // we already write it as attribute, do not repeat it as child element
- foreach ($data as $field => $value) {
- $this->xmlwriter->full_tag($field, $value);
- }
- $this->xmlwriter->end_tag('feedback');
+ $this->write_xml('feedback', $data, array('/feedback/id'));
}
/**

0 comments on commit 4b2da7c

Please sign in to comment.