Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
88.24% covered (warning)
88.24%
15 / 17
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
evidence_form
100.00% covered (success)
100.00%
15 / 15
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 definition
100.00% covered (success)
100.00%
15 / 15
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2// This file is part of Moodle - https://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle.  If not, see <https://www.gnu.org/licenses/>.
16
17namespace local_integritycase\form;
18
19defined('MOODLE_INTERNAL') || die();
20
21require_once($CFG->libdir . '/formslib.php');
22
23/**
24 * Staff-only evidence files on a case.
25 *
26 * @package    local_integritycase
27 * @copyright  2026 DevLMS <contact@devlms.com>
28 * @license    https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
29 */
30class evidence_form extends \moodleform {
31    /**
32     * Define the fields.
33     */
34    protected function definition() {
35        $mform = $this->_form;
36        $mform->addElement('hidden', 'id');
37        $mform->setType('id', PARAM_INT);
38        $mform->addElement('hidden', 'action', 'evidence');
39        $mform->setType('action', PARAM_ALPHA);
40        $mform->addElement('header', 'evidencehdr', get_string('evidence', 'local_integritycase'));
41        $mform->addElement(
42            'filemanager',
43            'evidence',
44            get_string('evidence', 'local_integritycase'),
45            null,
46            ['subdirs' => 0, 'maxfiles' => 20]
47        );
48        $mform->addHelpButton('evidence', 'evidence', 'local_integritycase');
49        $this->add_action_buttons(false, get_string('savechanges'));
50    }
51}