Skip to content

Commit

Permalink
MDL-23479 backup - choice revised & old code deleted (but restore logs)
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Jul 30, 2010
1 parent 01b4ca0 commit 1ef927d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 631 deletions.
5 changes: 5 additions & 0 deletions mod/choice/backup/moodle2/restore_choice_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ protected function process_choice($data) {

$data->timeopen = $this->apply_date_offset($data->timeopen);
$data->timeclose = $this->apply_date_offset($data->timeclose);
$data->timemodified = $this->apply_date_offset($data->timemodified);

// insert the choice record
$newitemid = $DB->insert_record('choice', $data);
Expand All @@ -67,7 +68,9 @@ protected function process_choice_option($data) {

$data = (object)$data;
$oldid = $data->id;

$data->choiceid = $this->get_new_parentid('choice');
$data->timemodified = $this->apply_date_offset($data->timemodified);

$newitemid = $DB->insert_record('choice_options', $data);
$this->set_mapping('choice_option', $oldid, $newitemid);
Expand All @@ -78,9 +81,11 @@ protected function process_choice_answer($data) {

$data = (object)$data;
$oldid = $data->id;

$data->choiceid = $this->get_new_parentid('choice');
$data->optionid = $this->get_mappingid('choice_option', $oldid);
$data->userid = $this->get_mappingid('user', $data->userid);
$data->timemodified = $this->apply_date_offset($data->timemodified);

$newitemid = $DB->insert_record('choice_answers', $data);
// No need to save this mapping as far as nothing depend on it
Expand Down
249 changes: 0 additions & 249 deletions mod/choice/backuplib.php

This file was deleted.

Loading

0 comments on commit 1ef927d

Please sign in to comment.