From: Vincent Vanwaelscappel Date: Fri, 28 Feb 2020 20:09:36 +0000 (+0100) Subject: wip #3438 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=02d847544dd80205e038f791b0b08bbdf07a8e94;p=QuizFactory.git wip #3438 --- diff --git a/app/SubForms/Answer.php b/app/SubForms/Answer.php new file mode 100644 index 0000000..50fa0f2 --- /dev/null +++ b/app/SubForms/Answer.php @@ -0,0 +1,22 @@ +addField(['name' => 'answer', + 'type' => 'Text', + 'label' => 'Answer label']); + + $this->addField(['name' => 'answer', + 'type' => 'Checkbox', + 'label' => 'Correct']); + } +} diff --git a/app/SubForms/Question.php b/app/SubForms/Question.php index 50877e3..3e3917c 100644 --- a/app/SubForms/Question.php +++ b/app/SubForms/Question.php @@ -15,19 +15,35 @@ class Question extends SubForm 'type' => 'Text', 'label' => 'Question']); + $this->addField(['name' => 'explaination', + 'type' => 'Textarea', + 'label' => 'Explanation / Answer details', + 'hint' => 'Text displayed at review time']); + $this->addField(['name' => 'multiple', 'type' => 'Checkbox', 'label' => 'Multiple answers']); - $this->addField([ - 'name' => 'answers', - 'type' => 'Table', - 'entity_singular' => 'answer', - 'columns' => [ - 'answer' => 'Answer label', - 'correct' => 'Correct', - ], - 'label' => 'Answers', - ]); +// $this->addField([ +// 'name' => 'answers', +// 'type' => 'Table', +// 'entity_singular' => 'answer', +// 'columns' => [ +// 'answer' => 'Answer label', +// 'correct' => 'Correct', +// ], +// 'label' => 'Answers', +// ]); + + +// $this->addField([ +// 'name' => 'questions', +// 'type' => 'BunchOfFieldsMultiple', +// 'bunch' => 'App\SubForms\Answer', +// 'label' => 'Questions', +// 'add_label' => 'Add question', +// 'tab' => 'Questions / Answers', +// ]); + } }