| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- class FormGenerator {
- private $eForm;
- public function __construct() {
- $this->eForm = e107::getForm();
- }
- public function ExcelGenerator() {
- $text = $this->eForm->open('ExcelGenerator', 'post', '', ['autocomplete' => 'off', 'class' => 'formclass'])
- . $this->eForm->label('<b>Number of qusetions to generate </b>') . '</br>'
- . $this->eForm->number('numberOfQuestions', 20, 2, ['min' => 1, 'max' => 160]) . '</br></br>'
- . $this->eForm->flipswitch('addition', 'on', ['on' => 'on', 'off' => 'off'])
- . $this->eForm->label(' Addition') . '</br></br>'
- . $this->eForm->flipswitch('subtraction', 'on', ['on' => 'on', 'off' => 'off'])
- . $this->eForm->label(' subtraction') . '</br></br>'
- . $this->eForm->flipswitch('multiplication', 'on', ['on' => 'on', 'off' => 'off'])
- . $this->eForm->label(' multiplication') . '</br></br>'
- . $this->eForm->flipswitch('division', 'on', ['on' => 'on', 'off' => 'off'])
- . $this->eForm->label(' division') . '</br></br>'
- . '<button type="submit" name="mode" value="Generate Sheet" id="getexcel" class="btn submit btn-success"><span>Generate Sheet</span></button>'
- . $this->eForm->close() . '</br></br>';
-
- return $text;
- }
-
- private function OldFractionsMulti($title,$q) {
- require_once( __DIR__ . '/fraction/src/Fraction.php');
-
- $this->FormattedQuestionForm .= e107::getForm()->label($title) . "\n";
- $this->FormattedQuestionForm .= '</br>';
-
- $this->FormattedQuestionForm .= e107::getForm()->label($nominator*$multiplier) . "<br/>\n";
- $this->FormattedQuestionForm .= "-------<br/>\n";
- $this->FormattedQuestionForm .= e107::getForm()->label($denominator*$multiplier) . "\n";
- $this->FormattedQuestionForm .= '</br></br>';
-
- $this->FormattedQuestionForm .= e107::getForm()->text('q1', '', 80, ['placeholder' => 'Write answer here!','autocomplete'=>"off"]) . "\n";
- $this->FormattedQuestionForm .= "-------<br/>\n";
- $this->FormattedQuestionForm .= e107::getForm()->text('q2', '', 80, ['placeholder' => 'Write answer here!','autocomplete'=>"off"]) . "\n";
- $this->FormattedQuestionForm .= e107::getForm()->hidden('a1', (int)($fract1->getNumerator())) . "\n";
- $this->FormattedQuestionForm .= e107::getForm()->hidden('a2', (int)($fract1->getDenominator())) . "\n";
- $this->FormattedQuestionForm .= e107::getForm()->hidden('qc1', 2) . "\n";
- $this->FormattedQuestionForm .= e107::getForm()->hidden('question', "Simplify " . $nominator*$multiplier . " over " . $denominator*$multiplier) . "\n";
- }
- }
|