{{!
    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/question_radio

    Template which defines a radio button type question survey display.

    Classes required for JS:
    * /mod/questionnaire/module.js

    Data attributes required for JS:
    * none

    Context variables required for this template:

    Example context (json):
    {
        "qelements": [
            {
                "choice": {
                    "horizontal": 1,
                    "id": "choiceid1",
                    "value": "1",
                    "name": "choiceid1",
                    "checked": "",
                    "disabled": 1,
                    "onclick": 1,
                    "label": "Choice label",
                    "alabel": "Some question Choice label"
                }
            },
            {
                "choice": {
                    "horizontal": 1,
                    "id": "choiceid2",
                    "value": "2",
                    "name": "choiceid2",
                    "checked": "1",
                    "onclick": 1,
                    "label": "Choice label",
                    "alabel": "Some question Choice label",
                    "oid": "choiceid2_7",
                    "olabel": "Choice other label",
                    "aolabel": "Some question Choice other label",
                    "oname": "Other",
                    "ovalue": "another choice"
                }
            }
        ]
    }
    }}
<!-- Begin HTML generated from question_radio template. -->
{{#qelements}}
    {{#choice}}
        {{#choice.horizontal}}<span style="white-space:nowrap;">{{/choice.horizontal}}
            <input id="{{choice.id}}" value="{{choice.value}}" name="{{choice.name}}" type="radio"
                   {{#choice.checked}}checked="checked"{{/choice.checked}} {{#choice.disabled}}disabled="disabled"{{/choice.disabled}}
                {{#choice.onclick}}onclick="{{choice.onclick}}"{{/choice.onclick}} aria-label="{{alabel}}"/>
            <label for="{{choice.id}}">{{{choice.label}}}</label>
        {{#choice.oname}}
                <input size="25" name="{{choice.oname}}" id="{{choice.oid}}" onclick="other_check(name)"
                       value="{{choice.ovalue}}" type="text" aria-label="{{aolabel}}"/>
                <label for="{{choice.oid}}" class="accesshide">{{{choice.olabel}}}</label>&nbsp;
        {{/choice.oname}}
        {{#choice.horizontal}}</span>{{/choice.horizontal}}
        {{^choice.horizontal}}<br/>{{/choice.horizontal}}
    {{/choice}}
{{/qelements}}
<!-- End HTML generated from question_radio template. -->