$questions = array();
- $defaultq = $this->defaultquestion();
-
- process_tf($xml, $questions, $defaultq);
- process_mc($xml, $questions, $defaultq);
- process_ma($xml, $questions, $defaultq);
- process_fib($xml, $questions, $defaultq);
- process_matching($xml, $questions, $defaultq);
+ process_tf($xml, $questions);
+ process_mc($xml, $questions);
+ process_ma($xml, $questions);
+ process_fib($xml, $questions);
+ process_matching($xml, $questions);
return $questions;
}
//----------------------------------------
// Process True / False Questions
//----------------------------------------
-function process_tf($xml, &$questions, $defaultq) {
+function process_tf($xml, &$questions) {
if (isset($xml["POOL"]["#"]["QUESTION_TRUEFALSE"])) {
$tfquestions = $xml["POOL"]["#"]["QUESTION_TRUEFALSE"];
for ($i = 0; $i < sizeof ($tfquestions); $i++) {
- $question = $defaultq;
+ $question = $this->defaultquestion();
$question->qtype = TRUEFALSE;
$question->single = 1; // Only one answer is allowed
//----------------------------------------
// Process Multiple Choice Questions
//----------------------------------------
-function process_mc($xml, &$questions, $defaultq) {
+function process_mc($xml, &$questions) {
if (isset($xml["POOL"]["#"]["QUESTION_MULTIPLECHOICE"])) {
$mcquestions = $xml["POOL"]["#"]["QUESTION_MULTIPLECHOICE"];
for ($i = 0; $i < sizeof ($mcquestions); $i++) {
- $question = $defaultq;
+ $question = $this->defaultquestion();
$question->qtype = MULTICHOICE;
$question->single = 1; // Only one answer is allowed
//----------------------------------------
// Process Multiple Choice Questions With Multiple Answers
//----------------------------------------
-function process_ma($xml, &$questions, $defaultq) {
+function process_ma($xml, &$questions) {
if (isset($xml["POOL"]["#"]["QUESTION_MULTIPLEANSWER"])) {
$maquestions = $xml["POOL"]["#"]["QUESTION_MULTIPLEANSWER"];
for ($i = 0; $i < sizeof ($maquestions); $i++) {
- $question = $defaultq;
+ $question = $this->defaultquestion();
$question->qtype = MULTICHOICE;
$question->defaultgrade = 1;
//----------------------------------------
// Process Fill in the Blank Questions
//----------------------------------------
-function process_fib($xml, &$questions, $defaultq) {
+function process_fib($xml, &$questions) {
if (isset($xml["POOL"]["#"]["QUESTION_FILLINBLANK"])) {
$fibquestions = $xml["POOL"]["#"]["QUESTION_FILLINBLANK"];
for ($i = 0; $i < sizeof ($fibquestions); $i++) {
- $question = $defaultq;
+ $question = $this->defaultquestion();
$question->qtype = SHORTANSWER;
$question->usecase = 0; // Ignore case
//----------------------------------------
// Process Matching Questions
//----------------------------------------
-function process_matching($xml, &$questions, $defaultq) {
+function process_matching($xml, &$questions) {
if (isset($xml["POOL"]["#"]["QUESTION_MATCH"])) {
$matchquestions = $xml["POOL"]["#"]["QUESTION_MATCH"];
for ($i = 0; $i < sizeof ($matchquestions); $i++) {
- $question = $defaultq;
+ $question = $this->defaultquestion();
$question->qtype = MATCH;