Fix Question getter; search ID
This commit is contained in:
parent
7e7b77769f
commit
ec83fb3121
2 changed files with 5 additions and 4 deletions
|
|
@ -21,7 +21,6 @@ class QuestionsFile
|
|||
private function reload()
|
||||
{
|
||||
$this->treeXML = new DOMDocument('1.0', 'UTF-8');
|
||||
$this->treeXML->formatOutput = true;
|
||||
|
||||
if (@$this->treeXML->load($this->filename))
|
||||
{
|
||||
|
|
@ -44,7 +43,8 @@ class QuestionsFile
|
|||
*/
|
||||
public function add_question($question)
|
||||
{
|
||||
$this->root_node->appendChild($question->to_xml($this->treeXML));
|
||||
$qnode = $question->to_xml($this->treeXML);
|
||||
$this->root_node->appendChild($qnode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -63,6 +63,7 @@ class QuestionsFile
|
|||
if (!empty($newfilename))
|
||||
$this->filename = $newfilename;
|
||||
|
||||
$this->treeXML->formatOutput = true;
|
||||
$this->treeXML->save($this->filename);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue