Fix lots of bugs in classes (now correctly creating file)
This commit is contained in:
parent
6885c2883c
commit
9b545226d2
3 changed files with 10 additions and 9 deletions
|
|
@ -63,12 +63,12 @@ class Question
|
|||
* @param $answer The answer string
|
||||
* @param $scrore The score given by this answer
|
||||
*/
|
||||
private function gen_anode($answer, $score = 1)
|
||||
private function gen_anode($treeXML, $answer, $score = 1)
|
||||
{
|
||||
$anode = $this->treeXML->createElement("answer");
|
||||
$anode = $treeXML->createElement("answer");
|
||||
|
||||
$qnode->setAttribute("answer", $answer);
|
||||
$qnode->setAttribute("score", $score);
|
||||
$anode->setAttribute("answer", $answer);
|
||||
$anode->setAttribute("score", $score);
|
||||
|
||||
return $anode;
|
||||
}
|
||||
|
|
@ -87,8 +87,8 @@ class Question
|
|||
$qnode->setAttribute("course", $this->course);
|
||||
$qnode->setAttribute("question", $this->question);
|
||||
|
||||
foreach ($answers as $ans)
|
||||
$qnode->appendChild(gen_anode($ans));
|
||||
foreach ($this->answers as $ans)
|
||||
$qnode->appendChild($this->gen_anode($root, $ans));
|
||||
|
||||
return $qnode;
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue