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 mod_h5pactivity/attempt
19
 
20
    This template will render an attempt basic information inside a H5P activity results report.
21
 
22
    Variables required for this template:
23
    * timemodified - Full attempts list
24
    * attempt - Full attempts list
25
    * rawscore - Full attempts list
26
    * maxscore - Full attempts list
27
    * duration - Full attempts list
28
    * completionicon - Full attempts list
29
    * successicon - Full attempts list
30
    * reporturl - Full attempts list
31
 
32
    Variables optional for this template:
33
    * user - optional user record
34
    * scored - The scored attempt
35
 
36
    Example context (json):
37
    {
38
        "id": 11,
39
        "h5pactivityid": 1,
40
        "userid": 3,
41
        "timecreated": 1587655101,
42
        "timemodified": 1587655101,
43
        "attempt": 2,
44
        "rawscore": 6,
45
        "maxscore": 6,
46
        "duration": "2 minutes 10 seconds",
47
        "completion": 1,
48
        "completionicon": "<i class=\"icon fa fa-check-circle fa-fw \"  title=\"Attempt completed\" aria-label=\"Attempt completed\"><\/i>",
49
        "success": 1,
50
        "successicon": "<i class=\"icon fa fa-check-circle fa-fw \"  title=\"Attempt completed successfully\" aria-label=\"Attempt completed successfully\"><\/i>",
51
        "scaled": 1,
52
        "reporturl": {},
53
        "score": "6 out of 6",
54
        "user": {
55
            "id": "3",
56
            "idnumber": "",
57
            "firstname": "John",
58
            "lastname": "Doe",
59
            "email": "s1@example.com",
60
            "institution": "Moodle HQ",
61
            "department": "Business",
62
            "address": "",
63
            "city": "Barcelona",
64
            "country": "Spain",
65
            "lang": "en",
66
            "picture": "[userpic]",
67
            "fullname": "User Fullname"
68
        }
69
    }
70
 
71
}}
72
<h2 class="px-0 px-md-3">
73
    {{#user}}
74
      {{{picture}}}
75
      {{#str}}attempt, mod_h5pactivity{{/str}} #{{attempt}}: {{fullname}}
76
    {{/user}}
77
    {{^user}}
78
      {{#str}}attempt, mod_h5pactivity{{/str}} #{{attempt}}
79
    {{/user}}
80
</h2>
81
<div class="container-fluid mt-4 mb-5 px-0 px-md-3">
82
    <dl class="row">
83
        <dt class="col-12">{{#str}} startdate, mod_h5pactivity {{/str}}</dt>
84
        <dd class="col-12">{{#userdate}} {{timemodified}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}</dd>
85
        <dt class="col-12">{{#str}} completion, mod_h5pactivity {{/str}}</dt>
86
        <dd class="col-12">{{{completiontext}}}</dd>
87
        <dt class="col-12 text-truncate">{{#str}} duration, mod_h5pactivity {{/str}}</dt>
88
        <dd class="col-12">{{duration}}</dd>
89
        <dt class="col-12">{{#str}} outcome, mod_h5pactivity {{/str}}</dt>
90
        <dd class="col-12">{{{successtext}}}</dd>
91
        {{#score}}
92
            <dt class="col-12">{{#str}} totalscore, mod_h5pactivity {{/str}}</dt>
93
            <dd class="col-12">{{score}}</dd>
94
        {{/score}}
95
    </dl>
96
</div>