A couple of changes to Pierre's calculated question import/export

export_process and import_process flags now apply to all questions
and what looked like a development print_r has been commented out.
This commit is contained in:
thepurpleblob 2007-03-28 11:58:44 +00:00
parent 77e90955b5
commit 5fd8f999d3
3 changed files with 9 additions and 5 deletions

@ -22,9 +22,10 @@ define('DEFAULT_QUESTIONS_PER_PAGE', 20);
* @param int $category category number
* @param bool $noparent if true only questions with NO parent will be selected
* @param bool $recurse include subdirectories
* @param bool $export set true if this is called by questionbank export
* @author added by Howard Miller June 2004
*/
function get_questions_category( $category, $noparent=false, $recurse=true ) {
function get_questions_category( $category, $noparent=false, $recurse=true, $export=true ) {
global $QTYPES;
@ -51,6 +52,7 @@ function get_questions_category( $category, $noparent=false, $recurse=true ) {
// iterate through questions, getting stuff we need
foreach($questions as $question) {
$questiontype = $QTYPES[$question->qtype];
$question->export_process = $export;
$questiontype->get_question_options( $question );
$qresults[] = $question;
}
@ -394,4 +396,4 @@ function question_list($course, $categoryid, $quizid=0,
echo "</form>\n";
}
?>
?>

@ -314,6 +314,10 @@ class qformat_default {
$question->partiallycorrectfeedback = '';
$question->incorrectfeedback = '';
// this option in case the questiontypes class wants
// to know where the data came from
$question->export_process = true;
return $question;
}

@ -529,9 +529,7 @@ class qformat_xml extends qformat_default {
}
}
echo "<pre>loaded qo";print_r($qo);echo "</pre>";
$qo->import_process = true ; // flag for question_save_options()
// echo "<pre>loaded qo";print_r($qo);echo "</pre>";
return $qo;
}