Skip to content

Commit

Permalink
MDL-8100, defaultgrade not imported. Question obect initialisation an…
Browse files Browse the repository at this point in the history
…d value import wrong way round - whoops!
  • Loading branch information
thepurpleblob committed Jan 16, 2007
1 parent e70d370 commit e43202e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion question/format/xml/format.php
Expand Up @@ -98,6 +98,7 @@ function import_optional_text($subelement, $question) {
*/
function import_headers( $question ) {
// this routine initialises the question object
$qo = $this->defaultquestion();
$name = $this->import_text( $question['#']['name'][0]['#']['text'] );
$qtext = $this->import_text( $question['#']['questiontext'][0]['#']['text'] );
$qformat = $question['#']['questiontext'][0]['@']['format'];
Expand All @@ -114,9 +115,9 @@ function import_headers( $question ) {
if (!empty($question['#']['defaultgrade'][0]['#'])) {
$qo->defaultgrade = $question['#']['defaultgrade'][0]['#'];
}

$penalty = $question['#']['penalty'][0]['#'];

$qo = $this->defaultquestion();
$qo->name = $name;
$qo->questiontext = $qtext;
$qo->questiontextformat = $this->trans_format( $qformat );
Expand Down

0 comments on commit e43202e

Please sign in to comment.