$restoreq->user_files = 0; $restoreq->course_files = 0; $restoreq->site_files = 0; $restoreq->messages = 0; $restoreq->blogs = 0; $restoreq->restore_gradebook_history = 0; $restoreq->course_id = $courseid; $restoreq->course_shortname = $courseqdata->shortname; $restoreq->restore_restorecatto = 0; $restoreq->deleting = ''; $restoreq->original_wwwroot = $CFG->wwwroot; $restoreq->backup_version = 2008030300; $dirq = "/temp/backup/" . $restoreq->backup_unique_code; make_upload_directory($dirq); $xmlcontentf = ""; $xmlcontent = reader_curlfile($readercfg->reader_serverlink . '/getfile.php?getid=' . $quizzestoadd_['id'] . '&pass='******'publisher']][$quizzestoadd_['level']]); foreach ($xmlcontent as $xmlcontent_) { $xmlcontentf .= $xmlcontent_; } $xmlcontentfnew = explode("<QUESTION_CATEGORY>", $xmlcontentf); //Crope Default questions $xmlcontentfnewtext = ""; $c = 0; foreach ($xmlcontentfnew as $xmlcontentfnew_) { if (!strstr($xmlcontentfnew_, "<NAME>Default for Test101</NAME>")) { if ($c > 0) { $xmlcontentfnewtext .= "<QUESTION_CATEGORY>" . $xmlcontentfnew_; } else { $xmlcontentfnewtext .= $xmlcontentfnew_; } $c++;
$o .= html_writer::end_tag('span'); $o .= html_writer::end_tag('div'); } $o .= html_writer::end_tag('span'); } $o .= html_writer::start_tag('div', array('class' => 'dl-page-install')); $o .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'downloadquizzes', 'value' => 'Install Quizzes')); $o .= html_writer::end_tag('div'); } $o .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'step', 'value' => '1')); $o .= html_writer::end_tag('div'); $o .= html_writer::end_tag('form'); echo $o; echo $OUTPUT->box_end(); } else { $listofpublishers = reader_curlfile("{$readercfg->reader_serverlink}/?a=publishers&login={$readercfg->reader_serverlogin}&password={$readercfg->reader_serverpassword}"); $listofpublishers = xmlize(reader_makexml($listofpublishers)); foreach ($listofpublishers['myxml']['#']['item'] as $listofpublisher) { $quizzes[$listofpublisher['@']['publisher']][$listofpublisher['@']['level']][$listofpublisher['@']['id']] = $listofpublisher['#']; } //Check Passwords if ($step == 1) { $postzapros = array('quiz' => $quiz); } else { $postzapros = array('password' => $password, 'quiz' => $quiz); } $listofpublishers = xmlize(reader_file("{$readercfg->reader_serverlink}/?a=quizzes&login={$readercfg->reader_serverlogin}&password={$readercfg->reader_serverpassword}", $postzapros)); foreach ($listofpublishers['myxml']['#']['item'] as $listofpublisher) { $publishers[$listofpublisher['@']['publisher']][$listofpublisher['@']['level']]['pass'] = $listofpublisher['#']; if (isset($listofpublisher['@']['status'])) { $publishers[$listofpublisher['@']['publisher']][$listofpublisher['@']['level']]['status'] = $listofpublisher['@']['status'];