Skip to content

Commit

Permalink
MDL-44630: Fix CC backup of quizzes
Browse files Browse the repository at this point in the history
The common cartridge backup was skipping
quizzes because the <questions> element
is no longer in the Moodle backup file.
Instead, now reading from the list of
<question_instances> list.
  • Loading branch information
polothy committed May 6, 2014
1 parent cb4b7e5 commit 4bcde92
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions backup/cc/cc_lib/cc_asssesment.php
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,7 @@ public static function add_respcondition($node, $title, $feedback_refid, $grade_
/**
*
* Enter description here ...
* @param unknown_type $qdoc
* @param XMLGenericDocument $qdoc
* @param unknown_type $manifest
* @param cc_assesment_section $section
* @param unknown_type $rootpath
Expand All @@ -1973,8 +1973,10 @@ public static function process_questions(&$qdoc, &$manifest, cc_assesment_sectio
pkg_resource_dependencies::instance()->reset();
$questioncount = 0;
$questionforexport = 0;
$qids = explode(',', $qdoc->nodeValue('/activity/quiz/questions'));
foreach ($qids as $value) {
$qids = $qdoc->nodeList('//question_instances//questionid');
foreach ($qids as $qid) {
/** @var DOMNode $qid */
$value = $qid->nodeValue;
if (intval($value) == 0) {
continue;
}
Expand Down

0 comments on commit 4bcde92

Please sign in to comment.