Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
{{!
2
    This file is part of Moodle - http://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 <http://www.gnu.org/licenses/>.
16
}}
17
{{!
18
    @template tool_analytics/evaluation_options
19
 
20
    Evaluation selector.
21
 
22
    The purpose of this template is to render the evaluation mode options.
23
 
24
    Classes required for JS:
25
    * none
26
 
27
    Data attributes required for JS:
28
    * none
29
 
30
    Example context (json):
31
    {
32
        "trainedexternally": "1",
33
        "timesplittingmethods": [
34
            {
35
                "id": "ou",
36
                "name": "Quarters"
37
            }, {
38
                "id": "yeah",
39
                "name": "Tenths"
40
            }
41
        ]
42
    }
43
}}
44
 
45
{{#trainedexternally}}
46
    <div class="box mb-4">{{#str}} evaluationmodeinfo, tool_analytics {{/str}}</div>
47
 
48
    <div class="custom-control custom-radio">
49
        <input class="custom-control-input" type="radio" name="evaluationmode" id="id-mode-trainedmodel" value="trainedmodel" checked>
50
        <label class="custom-control-label" for="id-mode-trainedmodel">{{#str}} evaluationmodetrainedmodel, tool_analytics {{/str}}</label>
51
    </div>
52
 
53
    <div class="custom-control custom-radio">
54
        <input class="custom-control-input" type="radio" name="evaluationmode" id="id-mode-configuration" value="configuration">
55
        <label class="custom-control-label" for="id-mode-configuration">{{#str}} evaluationmodeconfiguration, tool_analytics {{/str}}</label>
56
    </div>
57
{{/trainedexternally}}
58
 
59
{{! Hidden by default if #trainedexternally as the default option is trainedmodel in this case.}}
60
<div id="id-evaluation-timesplitting-container" class="mt-3 {{#trainedexternally}}hidden{{/trainedexternally}}">
61
    {{#str}} selecttimesplittingforevaluation, tool_analytics {{/str}}
62
    <div>
63
        <select id="id-evaluation-timesplitting" name="timesplitting" class="custom-select mt-3">
64
            {{#timesplittingmethods}}
65
                <option value="{{id}}">{{text}}</option>
66
            {{/timesplittingmethods}}
67
        </select>
68
    </div>
69
</div>
70
 
71
 
72
{{#js}}
73
    require(['jquery'], function($) {
74
        $("input[name='evaluationmode']:radio").change(function() {
75
            if ($(this).val() == 'configuration') {
76
                $('#id-evaluation-timesplitting-container').show();
77
            } else {
78
                $('#id-evaluation-timesplitting-container').hide();
79
            }
80
        });
81
    });
82
{{/js}}