Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 80... Línea 80...
80
    }
80
    }
Línea 81... Línea 81...
81
 
81
 
82
    /**
82
    /**
83
     * Validate the data from any form fields added using {@link add_settings_form_fields()}.
83
     * Validate the data from any form fields added using {@link add_settings_form_fields()}.
-
 
84
     *
-
 
85
     * If the managing user cannot configure SEB by either lack of permissions or locked
-
 
86
     * settings, then the form fields will be frozen and no validation will be done.
84
     *
87
     *
85
     * @param array $errors the errors found so far.
88
     * @param array $errors the errors found so far.
86
     * @param array $data the submitted form data.
89
     * @param array $data the submitted form data.
87
     * @param array $files information about any uploaded files.
90
     * @param array $files information about any uploaded files.
88
     * @param mod_quiz_mod_form $quizform the quiz form object.
91
     * @param mod_quiz_mod_form $quizform the quiz form object.
Línea 247... Línea 250...
247
                . 'seb.quitpassword AS seb_quitpassword, '
250
                . 'seb.quitpassword AS seb_quitpassword, '
248
                . 'seb.linkquitseb AS seb_linkquitseb, '
251
                . 'seb.linkquitseb AS seb_linkquitseb, '
249
                . 'seb.userconfirmquit AS seb_userconfirmquit, '
252
                . 'seb.userconfirmquit AS seb_userconfirmquit, '
250
                . 'seb.enableaudiocontrol AS seb_enableaudiocontrol, '
253
                . 'seb.enableaudiocontrol AS seb_enableaudiocontrol, '
251
                . 'seb.muteonstartup AS seb_muteonstartup, '
254
                . 'seb.muteonstartup AS seb_muteonstartup, '
-
 
255
                . 'seb.allowcapturecamera AS seb_allowcapturecamera, '
-
 
256
                . 'seb.allowcapturemicrophone AS seb_allowcapturemicrophone, '
252
                . 'seb.allowspellchecking AS seb_allowspellchecking, '
257
                . 'seb.allowspellchecking AS seb_allowspellchecking, '
253
                . 'seb.allowreloadinexam AS seb_allowreloadinexam, '
258
                . 'seb.allowreloadinexam AS seb_allowreloadinexam, '
254
                . 'seb.activateurlfiltering AS seb_activateurlfiltering, '
259
                . 'seb.activateurlfiltering AS seb_activateurlfiltering, '
255
                . 'seb.filterembeddedcontent AS seb_filterembeddedcontent, '
260
                . 'seb.filterembeddedcontent AS seb_filterembeddedcontent, '
256
                . 'seb.expressionsallowed AS seb_expressionsallowed, '
261
                . 'seb.expressionsallowed AS seb_expressionsallowed, '
Línea 374... Línea 379...
374
     *
379
     *
375
     * @return string
380
     * @return string
376
     */
381
     */
377
    private function get_invalid_key_error_message(): string {
382
    private function get_invalid_key_error_message(): string {
378
        // Return error message with download link and links to get the seb config.
383
        // Return error message with download link and links to get the seb config.
-
 
384
        if ($this->accessmanager->is_using_seb()) {
379
        return get_string('invalidkeys', 'quizaccess_seb')
385
            return get_string('invalidkeys', 'quizaccess_seb')
380
            . $this->display_buttons($this->get_action_buttons());
386
                . $this->display_buttons($this->get_action_buttons());
-
 
387
        }
-
 
388
        return $this->display_buttons($this->get_action_buttons());
381
    }
389
    }
Línea 382... Línea 390...
382
 
390
 
383
    /**
391
    /**
384
     * Return error message when a SEB browser is not used.
392
     * Return error message when a SEB browser is not used.
Línea 476... Línea 484...
476
     * @param string $class Optional CSS class (or classes as space-separated list)
484
     * @param string $class Optional CSS class (or classes as space-separated list)
477
     * @param array $attributes Optional other attributes as array
485
     * @param array $attributes Optional other attributes as array
478
     *
486
     *
479
     * @return string HTML code of the provided buttons.
487
     * @return string HTML code of the provided buttons.
480
     */
488
     */
481
    private function display_buttons(string $buttonshtml, $class = '', array $attributes = null): string {
489
    private function display_buttons(string $buttonshtml, $class = '', ?array $attributes = null): string {
482
        $html = '';
490
        $html = '';
Línea 483... Línea 491...
483
 
491
 
484
        if (!empty($buttonshtml)) {
492
        if (!empty($buttonshtml)) {
485
            $html = html_writer::div($buttonshtml, $class, $attributes);
493
            $html = html_writer::div($buttonshtml, $class, $attributes);
Línea 526... Línea 534...
526
        global $OUTPUT;
534
        global $OUTPUT;
Línea 527... Línea 535...
527
 
535
 
Línea 528... Línea 536...
528
        $button = '';
536
        $button = '';
-
 
537
 
-
 
538
        if (!empty($this->get_seb_download_url())) {
529
 
539
            $sebdownloadlink = $this->get_seb_download_url();
-
 
540
            $button = html_writer::start_tag('div', ['class' => 'singlebutton']);
-
 
541
            $button .= html_writer::link($sebdownloadlink, get_string('sebdownloadbutton', 'quizaccess_seb'),
-
 
542
                ['class' => 'btn btn-secondary', 'target' => '_blank']);
530
        if (!empty($this->get_seb_download_url())) {
543
            $button .= html_writer::end_tag('div');
Línea 531... Línea 544...
531
            $button = $OUTPUT->single_button($this->get_seb_download_url(), get_string('sebdownloadbutton', 'quizaccess_seb'));
544
 
532
        }
545
        }