Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 41... Línea 41...
41
        $stemorder = $question->get_stem_order();
41
        $stemorder = $question->get_stem_order();
42
        $response = $qa->get_last_qt_data();
42
        $response = $qa->get_last_qt_data();
Línea 43... Línea 43...
43
 
43
 
Línea -... Línea 44...
-
 
44
        $choices = $this->format_choices($question);
44
        $choices = $this->format_choices($question);
45
 
45
 
46
        $questiontextid = $qa->get_qt_field_name('qtext');
46
        $result = '';
47
        $result = '';
Línea 47... Línea 48...
47
        $result .= html_writer::tag('div', $question->format_questiontext($qa),
48
        $result .= html_writer::tag('div', $question->format_questiontext($qa),
48
                array('class' => 'qtext'));
49
                array('class' => 'qtext', 'id' => $questiontextid));
49
 
50
 
Línea 50... Línea 51...
50
        $result .= html_writer::start_tag('div', array('class' => 'ablock'));
51
        $result .= html_writer::start_tag('div', array('class' => 'ablock'));
51
        $result .= html_writer::start_tag('table', array('class' => 'answer'));
52
        $result .= html_writer::start_tag('table', array('class' => 'answer', 'role' => 'presentation'));
52
        $result .= html_writer::start_tag('tbody');
53
        $result .= html_writer::start_tag('tbody', ['role' => 'presentation']);
Línea 53... Línea 54...
53
 
54
 
54
        $parity = 0;
55
        $parity = 0;
Línea -... Línea 56...
-
 
56
        $i = 1;
55
        $i = 1;
57
        foreach ($stemorder as $key => $stemid) {
56
        foreach ($stemorder as $key => $stemid) {
58
 
Línea 57... Línea 59...
57
 
59
            $result .= html_writer::start_tag('tr', array('class' => 'r' . $parity, 'role' => 'presentation'));
58
            $result .= html_writer::start_tag('tr', array('class' => 'r' . $parity));
60
            $fieldname = 'sub' . $key;
Línea 59... Línea 61...
59
            $fieldname = 'sub' . $key;
61
 
Línea 75... Línea 77...
75
            if ($options->correctness && $selected) {
77
            if ($options->correctness && $selected) {
76
                $classes .= ' ' . $this->feedback_class($fraction);
78
                $classes .= ' ' . $this->feedback_class($fraction);
77
                $feedbackimage = $this->feedback_image($fraction);
79
                $feedbackimage = $this->feedback_image($fraction);
78
            }
80
            }
Línea -... Línea 81...
-
 
81
 
-
 
82
            // We only want to add the question text to the first answer field to
-
 
83
            // avoid repetition of the question text for the subsequent answer fields.
-
 
84
            if ($i == 1) {
-
 
85
                $ariadescribedbyids = $questiontextid . ' ' . $itemtextid;
-
 
86
            } else {
-
 
87
                $ariadescribedbyids = $itemtextid;
-
 
88
            }
79
 
89
 
80
            $labeltext = $options->add_question_identifier_to_label(get_string('answer', 'qtype_match', $i));
90
            $labeltext = $options->add_question_identifier_to_label(get_string('answer', 'qtype_match', $i));
81
            $result .= html_writer::tag('td',
91
            $result .= html_writer::tag('td',
82
                    html_writer::label($labeltext,
92
                    html_writer::label($labeltext,
83
                            'menu' . $qa->get_qt_field_name('sub' . $key), false,
93
                            'menu' . $qa->get_qt_field_name('sub' . $key), false,
84
                            array('class' => 'accesshide')) .
94
                            array('class' => 'accesshide')) .
-
 
95
                    html_writer::select($choices, $qa->get_qt_field_name('sub' . $key), $selected,
-
 
96
                            ['0' => 'choose'],
85
                    html_writer::select($choices, $qa->get_qt_field_name('sub' . $key), $selected,
97
                            [
-
 
98
                                'disabled' => $options->readonly,
-
 
99
                                'class' => 'form-select d-inline-block ms-1',
-
 
100
                                'aria-describedby' => $ariadescribedbyids,
86
                            array('0' => 'choose'), array('disabled' => $options->readonly, 'class' => 'custom-select ml-1')) .
101
                            ]) .
Línea 87... Línea 102...
87
                    ' ' . $feedbackimage, array('class' => $classes));
102
                    ' ' . $feedbackimage, array('class' => $classes, 'role' => 'presentation'));
88
 
103
 
89
            $result .= html_writer::end_tag('tr');
104
            $result .= html_writer::end_tag('tr');
90
            $parity = 1 - $parity;
105
            $parity = 1 - $parity;