--- /dev/null
+<?php
+
+
+namespace App\SubForms;
+
+use Cubist\Backpack\app\Magic\SubForm;
+
+class Answer extends SubForm
+{
+ public function init()
+ {
+ parent::init();
+
+ $this->addField(['name' => 'answer',
+ 'type' => 'Text',
+ 'label' => 'Answer label']);
+
+ $this->addField(['name' => 'answer',
+ 'type' => 'Checkbox',
+ 'label' => 'Correct']);
+ }
+}
'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',
+// ]);
+
}
}