Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 166... Línea 166...
166
            'seb_requiresafeexambrowser' => $requiresafeexambrowser,
166
            'seb_requiresafeexambrowser' => $requiresafeexambrowser,
167
        ]);
167
        ]);
168
        $quiz->seb_showsebdownloadlink = 1;
168
        $quiz->seb_showsebdownloadlink = 1;
169
        $quiz->coursemodule = $quiz->cmid;
169
        $quiz->coursemodule = $quiz->cmid;
Línea -... Línea 170...
-
 
170
 
-
 
171
        // Create a question bank.
-
 
172
        $qbank = self::getDataGenerator()->create_module('qbank', ['course' => $course->id]);
-
 
173
        $qbankcontext = context_module::instance($qbank->cmid);
170
 
174
 
171
        // Create a couple of questions.
175
        // Create a couple of questions.
172
        $questiongenerator = $this->getDataGenerator()->get_plugin_generator('core_question');
176
        $questiongenerator = $this->getDataGenerator()->get_plugin_generator('core_question');
Línea 173... Línea 177...
173
        $cat = $questiongenerator->create_question_category();
177
        $cat = $questiongenerator->create_question_category(['contextid' => $qbankcontext->id]);
174
 
178
 
175
        $saq = $questiongenerator->create_question('shortanswer', null, ['category' => $cat->id]);
179
        $saq = $questiongenerator->create_question('shortanswer', null, ['category' => $cat->id]);
176
        quiz_add_quiz_question($saq->id, $quiz);
180
        quiz_add_quiz_question($saq->id, $quiz);
Línea 211... Línea 215...
211
 
215
 
Línea 212... Línea 216...
212
        $attemptobj->process_submitted_actions($starttime, false, $tosubmit);
216
        $attemptobj->process_submitted_actions($starttime, false, $tosubmit);
213
 
217
 
214
        // Finish the attempt.
218
        // Finish the attempt.
-
 
219
        $attemptobj = quiz_attempt::create($attempt->id);
Línea 215... Línea 220...
215
        $attemptobj = quiz_attempt::create($attempt->id);
220
        $attemptobj->process_submit($starttime, false);
Línea 216... Línea 221...
216
        $attemptobj->process_finish($starttime, false);
221
        $attemptobj->process_grade_submission($starttime);
217
 
222
 
Línea 224... Línea 229...
224
     * Create test template.
229
     * Create test template.
225
     *
230
     *
226
     * @param string|null $xml Template content.
231
     * @param string|null $xml Template content.
227
     * @return \quizaccess_seb\template Just created template.
232
     * @return \quizaccess_seb\template Just created template.
228
     */
233
     */
229
    public function create_template(string $xml = null) {
234
    public function create_template(?string $xml = null) {
230
        $data = [];
235
        $data = [];
Línea 231... Línea 236...
231
 
236
 
232
        if (!is_null($xml)) {
237
        if (!is_null($xml)) {
233
            $data['content'] = $xml;
238
            $data['content'] = $xml;
Línea 294... Línea 299...
294
            'quitpassword' => 'test',
299
            'quitpassword' => 'test',
295
            'linkquitseb' => '',
300
            'linkquitseb' => '',
296
            'userconfirmquit' => '1',
301
            'userconfirmquit' => '1',
297
            'enableaudiocontrol' => '1',
302
            'enableaudiocontrol' => '1',
298
            'muteonstartup' => '0',
303
            'muteonstartup' => '0',
-
 
304
            'allowcapturecamera' => '1',
-
 
305
            'allowcapturemicrophone' => '1',
299
            'allowspellchecking' => '0',
306
            'allowspellchecking' => '0',
300
            'allowreloadinexam' => '1',
307
            'allowreloadinexam' => '1',
301
            'activateurlfiltering' => '1',
308
            'activateurlfiltering' => '1',
302
            'filterembeddedcontent' => '0',
309
            'filterembeddedcontent' => '0',
303
            'expressionsallowed' => 'test.com',
310
            'expressionsallowed' => 'test.com',