Permalink
Browse files

Merged from STABLE

  • Loading branch information...
1 parent d65af16 commit a0d187bfd7ac3181ef5df972bb948c8a79b797f1 thepurpleblob committed Jun 1, 2006
Showing with 10 additions and 9 deletions.
  1. +10 −9 question/format/xml/format.php
@@ -210,20 +210,21 @@ function import_numerical( $question ) {
$qo->tolerance = array();
foreach ($answers as $answer) {
$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->tolerance[] = $answer['#']['tolerance'][0]['#'];
}
// get units array
- $units = $question['#']['units'][0]['#']['unit'];
$qo->unit = array();
- $qo->multiplier = array();
- foreach ($units as $unit) {
- $qo->multiplier[] = $unit['#']['multiplier'][0]['#'];
- $qo->unit[] = $unit['#']['unit_name'][0]['#'];
+ if (isset($question['#']['units'][0]['#']['unit'])) {
+ $units = $question['#']['units'][0]['#']['unit'];
+ $qo->multiplier = array();
+ foreach ($units as $unit) {
+ $qo->multiplier[] = $unit['#']['multiplier'][0]['#'];
+ $qo->unit[] = $unit['#']['unit_name'][0]['#'];
+ }
}
-
return $qo;
}
@@ -244,8 +245,8 @@ function import_matching( $question ) {
// run through subquestions
foreach ($subquestions as $subquestion) {
- $qtext = $subquestion['#']['text'][0]['#'];
- $atext = $subquestion['#']['answer'][0]['#']['text'][0]['#'];
+ $qtext = $this->import_text( $subquestion['#']['text'] );
+ $atext = $this->import_text( $subquestion['#']['answer'][0]['#']['text'] );
$qo->subquestions[] = $qtext;
$qo->subanswers[] = $atext;
}

0 comments on commit a0d187b

Please sign in to comment.