Merge branch 'MDL-27394_master' of git://github.com/timhunt/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2011-05-05 22:00:58 +02:00
3 changed files with 19 additions and 3 deletions
+12 -2
View File
@@ -53,7 +53,12 @@ abstract class backup_qtype_plugin extends backup_plugin {
$answers->add_child($answer);
// Set the sources
$answer->set_source_table('question_answers', array('question' => backup::VAR_PARENTID));
$answer->set_source_sql('
SELECT *
FROM {question_answers}
WHERE question = :question
ORDER BY id',
array('question' => backup::VAR_PARENTID));
// Aliases
$answer->set_source_alias('answer', 'answertext');
@@ -82,7 +87,12 @@ abstract class backup_qtype_plugin extends backup_plugin {
$units->add_child($unit);
// Set the sources
$unit->set_source_table('question_numerical_units', array('question' => backup::VAR_PARENTID));
$unit->set_source_sql('
SELECT *
FROM {question_numerical_units}
WHERE question = :question
ORDER BY id',
array('question' => backup::VAR_PARENTID));
// don't need to annotate ids nor files
}
+1
View File
@@ -2194,6 +2194,7 @@ abstract class restore_activity_structure_step extends restore_structure_step {
/**
* As far as activity restore steps are implementing restore_subplugin stuff, they need to
* have the parent task available for wrapping purposes (get course/context....)
* @return restore_task
*/
public function get_task() {
return $this->task;
@@ -58,7 +58,12 @@ class backup_qtype_match_plugin extends backup_qtype_plugin {
// set source to populate the data
$matchoptions->set_source_table('question_match', array('question' => backup::VAR_PARENTID));
$match->set_source_table('question_match_sub', array('question' => backup::VAR_PARENTID));
$match->set_source_sql('
SELECT *
FROM {question_match_sub}
WHERE question = :question
ORDER BY id',
array('question' => backup::VAR_PARENTID));
// don't need to annotate ids nor files