Proyectos de Subversion Moodle

Rev

Autoría | Ultima modificación | Ver Log |

{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template mod_questionnaire/mobile_rate_question

    Template which defines a rate question display in the mobile app.

    Context variables required for this template:
    * fieldkey - integer: ID of the question.
    * choices - array of objects: choice_id, content, completed and value of each question choice.

    Example context (json):
    {
        "choices": [
            {
                "fieldkey": 985,
                "content": "Red",
                "min": 0,
                "max": 5,
                "minstr": "zero",
                "maxstr": "five",
                "na": 1
            },
            {
                "fieldkey": 986,
                "content": "Blue",
                "min": 0,
                "max": 5,
                "minstr": "zero",
                "maxstr": "five",
                "na": 1
            }
        ],
        "rates": [
            {
                "value": 0,
                "label": "Good"
            },
            {
                "value": 1,
                "label": 1
            }
        ]
    }
}}
{{=<% %>=}}
<ion-list>
    <ion-grid>
        <ion-row justify-content-center align-items-center text-center>
            <%#choices.0%>
            <%#leftlabel%>
            <ion-col></ion-col>
            <%/leftlabel%>
            <%/choices.0%>
            <%#rates%>
            <ion-col>
                <ion-label><%label%></ion-label>
            </ion-col>
            <%/rates%>
            <%#hasnacolumn%>
            <ion-col>
                <ion-label><%label%></ion-label>
            </ion-col>
            <%/hasnacolumn%>
            <%#choices.0%>
            <%#rightlabel%>
            <ion-col></ion-col>
            <%/rightlabel%>
            <%/choices.0%>
        </ion-row>
        <%#choices%>
        <ion-row><ion-col>
            <ion-list-header style="margin-bottom: 0; border-top-style: none;">
                <core-format-text text="<%content%>"></core-format-text>
                <ion-badge item-end>{{ CONTENT_OTHERDATA.<%fieldkey%> }}</ion-badge>
            </ion-list-header>
        </ion-col></ion-row>
        <ion-row radio-group [(ngModel)]="CONTENT_OTHERDATA.<%fieldkey%>" justify-content-center align-items-center text-center>
            <%#leftlabel%>
            <ion-col>
                <%leftlabel%>
            </ion-col>
            <%/leftlabel%>
            <%#rates%>
            <ion-col>
                <ion-radio value="<%label%>" <%#completed%> disabled="true"<%/completed%>></ion-radio>
            </ion-col>
            <%/rates%>
            <%#hasnacolumn%>
            <ion-col>
                <ion-radio value="<%value%>" <%#completed%> disabled="true"<%/completed%>></ion-radio>
            </ion-col>
            <%/hasnacolumn%>
            <%#rightlabel%>
            <ion-col>
                <%rightlabel%>
            </ion-col>
            <%/rightlabel%>
        </ion-row>
        <%/choices%>
    </ion-grid>
</ion-list>