Exemple #1
0
            $Output .= $this->Tab(2) . "}\n";
            $Output .= "\n";
        }
        $Output .= "\n";
        $Output .= $this->Tab(1) . "}\n";
        $Output .= "\n";
        /*
        $FileName = 'ClassBuilder/' . $this->ClassName . '.txt';
        $FilePath = 'http://www.card2u.com.my/' . $FileName;
        $File = fopen($FileName, 'w') or die("Error opening file!");
        fwrite($File, $Output);
        fclose($File) or die("Error closing file!");
        */
        $this->Output = $Output;
        $this->FilePath = $FilePath;
    }
    function Tab($Num)
    {
        $Output = '';
        for ($i = 1; $i <= $Num; $i++) {
            $Output .= '   ';
        }
        return $Output;
    }
}
$x = new ClassBuilder("QuestionSet");
$x->SetVariables(array('_single_choice', '_multiple_choice', '_completion', '_true_or_false', '_cloze_test', '_simple_answer', '_short_answer', '_integration'));
// $x->SetMethods(array("Method1", "Method2"));
$x->GenerateClass();
echo $x->GetOutput();
flush();