Merged from STABLE

This commit is contained in:
thepurpleblob 2006-06-01 10:13:57 +00:00
parent d65af16ffd
commit a0d187bfd7

View file

@ -210,20 +210,21 @@ class qformat_xml extends qformat_default {
$qo->tolerance = array(); $qo->tolerance = array();
foreach ($answers as $answer) { foreach ($answers as $answer) {
$qo->answer[] = $answer['#'][0]; $qo->answer[] = $answer['#'][0];
$qo->feedback[] = $answer['#']['feedback'][0]['#']['text'][0]['#']; $qo->feedback[] = $this->import_text( $answer['#']['feedback'][0]['#']['text'] );
$qo->fraction[] = $answer['#']['fraction'][0]['#']; $qo->fraction[] = $answer['#']['fraction'][0]['#'];
$qo->tolerance[] = $answer['#']['tolerance'][0]['#']; $qo->tolerance[] = $answer['#']['tolerance'][0]['#'];
} }
// get units array // get units array
$units = $question['#']['units'][0]['#']['unit'];
$qo->unit = array(); $qo->unit = array();
if (isset($question['#']['units'][0]['#']['unit'])) {
$units = $question['#']['units'][0]['#']['unit'];
$qo->multiplier = array(); $qo->multiplier = array();
foreach ($units as $unit) { foreach ($units as $unit) {
$qo->multiplier[] = $unit['#']['multiplier'][0]['#']; $qo->multiplier[] = $unit['#']['multiplier'][0]['#'];
$qo->unit[] = $unit['#']['unit_name'][0]['#']; $qo->unit[] = $unit['#']['unit_name'][0]['#'];
} }
}
return $qo; return $qo;
} }
@ -244,8 +245,8 @@ class qformat_xml extends qformat_default {
// run through subquestions // run through subquestions
foreach ($subquestions as $subquestion) { foreach ($subquestions as $subquestion) {
$qtext = $subquestion['#']['text'][0]['#']; $qtext = $this->import_text( $subquestion['#']['text'] );
$atext = $subquestion['#']['answer'][0]['#']['text'][0]['#']; $atext = $this->import_text( $subquestion['#']['answer'][0]['#']['text'] );
$qo->subquestions[] = $qtext; $qo->subquestions[] = $qtext;
$qo->subanswers[] = $atext; $qo->subanswers[] = $atext;
} }