Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 125... Línea 125...
125
                array('a' => 3, 'b' => 4),
125
                array('a' => 3, 'b' => 4),
126
        ));
126
        ));
Línea 127... Línea 127...
127
 
127
 
128
        return $q;
128
        return $q;
-
 
129
    }
-
 
130
 
-
 
131
    /**
-
 
132
     * Return the form data for a question with a single response.
-
 
133
     *
-
 
134
     * @return stdClass
-
 
135
     */
-
 
136
    public function get_calculatedmulti_question_form_data_singleresponse(): stdClass {
-
 
137
        question_bank::load_question_definition_classes('calculated');
-
 
138
        $fromform = new stdClass();
-
 
139
 
-
 
140
        $fromform->name = 'Simple sum';
-
 
141
        $fromform->questiontext['text'] = 'What is {a} + {b}?';
-
 
142
        $fromform->questiontext['format'] = FORMAT_HTML;
-
 
143
        $fromform->defaultmark = 1.0;
-
 
144
        $fromform->generalfeedback['text'] = 'Generalfeedback: {={a} + {b}} is the right answer.';
-
 
145
        $fromform->generalfeedback['format'] = FORMAT_HTML;
-
 
146
 
-
 
147
        $fromform->unitrole = '3';
-
 
148
        $fromform->unitpenalty = 0.1;
-
 
149
        $fromform->unitgradingtypes = '1';
-
 
150
        $fromform->unitsleft = '0';
-
 
151
        $fromform->nounits = 1;
-
 
152
        $fromform->multiplier = [];
-
 
153
        $fromform->multiplier[0] = '1.0';
-
 
154
        $fromform->synchronize = 0;
-
 
155
        $fromform->answernumbering = 0;
-
 
156
        $fromform->shuffleanswers = 0;
-
 
157
        $fromform->single = 1;
-
 
158
        $fromform->correctfeedback['text'] = 'Very good';
-
 
159
        $fromform->correctfeedback['format'] = FORMAT_HTML;
-
 
160
        $fromform->partiallycorrectfeedback['text'] = 'Mostly good';
-
 
161
        $fromform->partiallycorrectfeedback['format'] = FORMAT_HTML;
-
 
162
        $fromform->incorrectfeedback['text'] = 'Completely Wrong';
-
 
163
        $fromform->incorrectfeedback['format'] = FORMAT_HTML;
-
 
164
        $fromform->shownumcorrect = 1;
-
 
165
 
-
 
166
        $fromform->noanswers = 6;
-
 
167
        $fromform->answer = [];
-
 
168
        $fromform->answer[0]['text'] = '{a} + {b}';
-
 
169
        $fromform->answer[0]['format'] = FORMAT_HTML;
-
 
170
        $fromform->answer[1]['text'] = '{a} - {b}';
-
 
171
        $fromform->answer[1]['format'] = FORMAT_HTML;
-
 
172
        $fromform->answer[2]['text'] = '*';
-
 
173
        $fromform->answer[2]['format'] = FORMAT_HTML;
-
 
174
 
-
 
175
        $fromform->fraction = [];
-
 
176
        $fromform->fraction[0] = '1.0';
-
 
177
        $fromform->fraction[1] = '0.0';
-
 
178
        $fromform->fraction[2] = '0.0';
-
 
179
 
-
 
180
        $fromform->tolerance = [];
-
 
181
        $fromform->tolerance[0] = 0.001;
-
 
182
        $fromform->tolerance[1] = 0.001;
-
 
183
        $fromform->tolerance[2] = 0;
-
 
184
 
-
 
185
        $fromform->tolerancetype[0] = 1;
-
 
186
        $fromform->tolerancetype[1] = 1;
-
 
187
        $fromform->tolerancetype[2] = 1;
-
 
188
 
-
 
189
        $fromform->correctanswerlength[0] = 2;
-
 
190
        $fromform->correctanswerlength[1] = 2;
-
 
191
        $fromform->correctanswerlength[2] = 2;
-
 
192
 
-
 
193
        $fromform->correctanswerformat[0] = 1;
-
 
194
        $fromform->correctanswerformat[1] = 1;
-
 
195
        $fromform->correctanswerformat[2] = 1;
-
 
196
 
-
 
197
        $fromform->feedback = [];
-
 
198
        $fromform->feedback[0] = [];
-
 
199
        $fromform->feedback[0]['format'] = FORMAT_HTML;
-
 
200
        $fromform->feedback[0]['text'] = 'Very good.';
-
 
201
 
-
 
202
        $fromform->feedback[1] = [];
-
 
203
        $fromform->feedback[1]['format'] = FORMAT_HTML;
-
 
204
        $fromform->feedback[1]['text'] = 'Add. not subtract!';
-
 
205
 
-
 
206
        $fromform->feedback[2] = [];
-
 
207
        $fromform->feedback[2]['format'] = FORMAT_HTML;
-
 
208
        $fromform->feedback[2]['text'] = 'Completely wrong.';
-
 
209
 
-
 
210
        $fromform->status = \core_question\local\bank\question_version_status::QUESTION_STATUS_READY;
-
 
211
 
-
 
212
        $fromform->hint = [
-
 
213
            [
-
 
214
                'text' => 'Add',
-
 
215
                'format' => FORMAT_HTML,
-
 
216
            ],
-
 
217
        ];
-
 
218
 
-
 
219
        return $fromform;
129
    }
220
    }