Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 32... Línea 32...
32
 * @copyright  2010 The Open University
32
 * @copyright  2010 The Open University
33
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
33
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
34
 */
34
 */
35
class qtype_ddwtos_test_helper extends question_test_helper {
35
class qtype_ddwtos_test_helper extends question_test_helper {
36
    public function get_test_questions() {
36
    public function get_test_questions() {
37
        return array('fox', 'maths', 'oddgroups', 'missingchoiceno', 'infinite');
37
        return ['fox', 'maths', 'oddgroups', 'missingchoiceno', 'infinite', 'mathjax'];
38
    }
38
    }
Línea 39... Línea 39...
39
 
39
 
40
    /**
40
    /**
41
     * @return qtype_ddwtos_question
41
     * @return qtype_ddwtos_question
Línea 97... Línea 97...
97
        test_question_maker::set_standard_combined_feedback_form_data($fromform);
97
        test_question_maker::set_standard_combined_feedback_form_data($fromform);
98
        $fromform->shownumcorrect = 0;
98
        $fromform->shownumcorrect = 0;
99
        $fromform->penalty = 0.3333333;
99
        $fromform->penalty = 0.3333333;
100
        $fromform->status = \core_question\local\bank\question_version_status::QUESTION_STATUS_READY;
100
        $fromform->status = \core_question\local\bank\question_version_status::QUESTION_STATUS_READY;
Línea -... Línea 101...
-
 
101
 
-
 
102
        $fromform->hint = [
-
 
103
            [
-
 
104
                'text' => 'Fast',
-
 
105
                'format' => FORMAT_HTML,
-
 
106
            ],
-
 
107
        ];
101
 
108
 
102
        return $fromform;
109
        return $fromform;
Línea 103... Línea 110...
103
    }
110
    }
104
 
111
 
Línea 155... Línea 162...
155
 
162
 
156
        return $fromform;
163
        return $fromform;
Línea 157... Línea 164...
157
    }
164
    }
-
 
165
 
-
 
166
    /**
-
 
167
     * Get data required to save a drag-drop into text question where the the answer contain equation
-
 
168
     *
-
 
169
     *
-
 
170
     * @return stdClass data to create a ddwtos question.
-
 
171
     */
-
 
172
    public function get_ddwtos_question_form_data_mathjax() {
-
 
173
        $fromform = new stdClass();
-
 
174
 
-
 
175
        $fromform->name = 'Drag-and-drop words into sentences question with equation';
-
 
176
        $fromform->questiontext = ['text' => 'Fill in the correct mathjax equation: y = 2, x =4 : [[1]]', 'format' => FORMAT_HTML];
-
 
177
        $fromform->defaultmark = 1.0;
-
 
178
        $fromform->generalfeedback = ['text' => 'The right answer is: "y = x^2"', 'format' => FORMAT_HTML];
-
 
179
        $fromform->choices = [
-
 
180
            ['answer' => '$$ y = x^2 $$', 'choicegroup' => '1'],
-
 
181
            ['answer' => '$$ y = x^5 $$', 'choicegroup' => '1'],
-
 
182
        ];
-
 
183
        test_question_maker::set_standard_combined_feedback_form_data($fromform);
-
 
184
        $fromform->shownumcorrect = 0;
-
 
185
        $fromform->penalty = 0.3333333;
-
 
186
        $fromform->status = \core_question\local\bank\question_version_status::QUESTION_STATUS_READY;
-
 
187
        return $fromform;
-
 
188
    }
158
 
189
 
159
    /**
190
    /**
160
     * @return qtype_ddwtos_question
191
     * @return qtype_ddwtos_question
161
     */
192
     */
162
    public function make_ddwtos_question_maths() {
193
    public function make_ddwtos_question_maths() {