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 qbank_previewquestion/preview_question
19
 
20
    The preview page for the question type preview.
21
    * actionurl - Url to post to
22
    * session - Moodle session
23
    * slot - The identifying number of the first question that was added to this usage
24
    * question - The html of the actual question from the engine
25
    * questionicon - The icon of the question type
26
    * questiontitle - The name of the question
27
    * versiontitle - The string for displaying the version
28
    * questionidumber - The idnumber of the question
29
    * restartdisabled - The attributes to enable or disable the button, same for finishdisabled and filldisabled
30
    * techinfo - Technical information like fraction, state, behaviour etc
31
    * exporttoxml - Link to export the question to xml
32
    * redirecturl - Url to the base view
33
    * comments - Comments api html
34
    * extrapreviewelements - Any plugin implementing the callback and sending extra html to view something in the preview page
35
 
36
    Example context (json):
37
    {
38
        "actionurl": "/",
39
        "session": "E2PwCfrnzz",
40
        "slot": "1",
41
        "question": "<div>question html</div>",
42
        "questionicon": "<i class='icon fa fa-search-plus fa-fw' title='Preview question' aria-label='Preview question'></i>",
43
        "questiontitle": "Question title",
44
        "versiontitle": {
45
            "versioninfo": "Version 3 (latest)"
46
        },
47
        "questionidumber": "qidnumber1",
48
        "restartdisabled": "disabled='disabled'",
49
        "finishdisabled": "disabled='disabled'",
50
        "filldisabled": "disabled='disabled'",
51
        "techinfo": "<div>Behaviour being used: Deferred feedback</div>",
52
        "redirecturl": "/",
53
        "exporttoxml": "Download this question in Moodle XML format",
54
        "comments": "html from comments api",
55
        "extrapreviewelements": "<div>callback to get html from plugins need to show info in preview</div>"
56
    }
57
}}
58
<form id="responseform" method="post" action="{{{actionurl}}}" enctype="multipart/form-data" autocomplete="off">
59
    <div class="d-flex">
60
        <h2 class="mt-2">{{{questionicon}}}</h2>
61
        <h2 class="ml-2 mt-2"> {{questiontitle}}</h2>
62
        <h3 class="px-2 py-1 ml-2 mt-2">
63
            {{#versiontitle}}
64
                {{>core_question/question_version_info}}
65
            {{/versiontitle}}
66
        </h3>
67
    </div>
68
    {{#newerversion}}
69
    <div class="alert alert-primary">
70
        {{{newerversion}}}
71
    </div>
72
    {{/newerversion}}
73
    <div class="d-flex">
74
        <div class="bg-primary text-white h-50 px-2 mt-n2">
75
            <span class="accesshide">ID number</span>
76
            {{questionidumber}}
77
        </div>
78
    </div>
79
    <br>
80
    <div>
81
        <input type="hidden" name="sesskey" value="{{session}}">
82
        <input type="hidden" name="slots" value="{{slot}}">
83
        <input type="hidden" name="scrollpos" value="" id="scrollpos">
84
    </div>
85
    {{{question}}}
86
    <div id="previewcontrols" class="controls input-group">
87
        <input type="submit" name="restart" value="{{#str}} restart, question{{/str}}" class="btn btn-secondary mr-1 mb-1" id="id_restart_question_preview" {{{restartdisabled}}}>
88
        <input type="submit" name="save" value="{{#str}} save, question{{/str}}" class="btn btn-secondary mr-1 mb-1" id="id_save_question_preview" {{{finishdisabled}}}>
89
        <input type="submit" name="fill" value="{{#str}} fillincorrect, question{{/str}}" class="btn btn-secondary mr-1 mb-1" {{{filldisabled}}}>
90
        <input type="submit" name="finish" value="{{#str}} submitandfinish, question{{/str}}" class="btn btn-secondary mr-1 mb-1" id="id_finish_question_preview" {{{finishdisabled}}}>
91
        {{^redirect}}
92
            <input type="button" name="close" value="{{#str}} closepreview, question{{/str}}" class="btn btn-secondary mr-1 mb-1" id="close-previewquestion-page">
93
        {{/redirect}}
94
        {{#redirect}}
95
            <a href="{{{redirecturl}}}" class="btn btn-secondary mr-1 mb-1" role="button">{{#str}} closepreview, question{{/str}}</a>
96
        {{/redirect}}
97
    </div>
98
</form>
99
<br>
100
{{#comments}}
101
    <a data-toggle="collapse" href="#commentcollapse" role="button" aria-expanded="false" aria-controls="commentcollapse">
102
        {{#pix}} t/collapsed, core {{/pix}}
103
        {{#str}} commentplural, qbank_comment{{/str}}
104
    </a>
105
    <div class="collapse" id="commentcollapse">
106
        {{{comments}}}
107
    </div>
108
    {{{options}}}
109
{{/comments}}
110
{{^comments}}
111
    {{{options}}}
112
{{/comments}}
113
{{{techinfo}}}
114
{{#extrapreviewelements}}
115
    {{{extrapreviewelements}}}
116
{{/extrapreviewelements}}