Proyectos de Subversion LeadersLinked - Backend

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
17002 efrain 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace LeadersLinked\Form\Microlearning;
6
 
7
use Laminas\Form\Form;
8
use LeadersLinked\Model\MicrolearningAnswer;
9
 
10
 
11
 
12
class AnswerCreateOrEditForm extends Form
13
{
14
 
15
    public function __construct()
16
    {
17
        parent::__construct();
18
        $this->setInputFilter(new AnswerCreateOrEditFilter());
19
 
20
 
21
 
22
        $this->add([
23
            'name' => 'text',
24
            'type' => \Laminas\Form\Element\Textarea::class,
25
            'attributes' => [
26
                'id'    => 'text',
27
            ]
28
        ]);
29
 
30
        $this->add([
31
            'name' => 'correct',
32
            'type' => \Laminas\Form\Element\Select::class,
33
            'options' => [
34
                'empty_option' => 'LABEL_ANSWER_CORRECT',
35
                'value_options' => [
36
                    MicrolearningAnswer::CORRECT_YES => 'LABEL_YES',
37
                    MicrolearningAnswer::CORRECT_NO => 'LABEL_NO',
38
                ]
39
            ],
40
            'attributes' => [
41
                'id' => 'correct',
42
            ]
43
        ]);
44
 
45
        $this->add([
46
            'name' => 'points',
47
            'type' => \Laminas\Form\Element\Text::class,
48
            'attributes' => [
49
                'maxlength' 	=> 3,
50
                'id' 			=> 'points',
51
            ]
52
        ]);
53
    }
54
}