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
|
|
@ -6,6 +6,7 @@ class QuestionsFile
|
|||
{
|
||||
private $filename;
|
||||
private $treeXML;
|
||||
private $root_node;
|
||||
|
||||
public function __construct($filename)
|
||||
{
|
||||
|
|
@ -22,7 +23,7 @@ class QuestionsFile
|
|||
$this->treeXML = new DOMDocument('1.0', 'UTF-8');
|
||||
$this->treeXML->formatOutput = true;
|
||||
|
||||
if (isfile($this->filename))
|
||||
if (is_file($this->filename))
|
||||
{
|
||||
$this->treeXML->load($this->filename);
|
||||
|
||||
|
|
@ -45,7 +46,7 @@ class QuestionsFile
|
|||
*/
|
||||
public function add_question($question)
|
||||
{
|
||||
$this->root_node->appendChild($question->to_xml($this->root_node));
|
||||
$this->root_node->appendChild($question->to_xml($this->treeXML));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Reference in a new issue