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/response_rate

    Template which defines a rate type response 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):
    {
        "twidth": "50%",
        "osgood": "1",
        "sidecolwidth": "45%",
        "colwidth": "10%",
        "textalign": "right",
        "headers": [
            {
                "bg": "c0",
                "str": "Okay"
            }
        ],
        "rows": [
            {
                "content": "HTML content",
                "cols": [
                    {
                        "checked": "1",
                        "bg": "c0",
                        "str": "Okay",
                        "name": "choice1"
                    }
                ],
                "osgoodstr": "Something right."
            }
        ]
    }
}}
<!-- Begin HTML generated from response_rate template. -->
<div class="questionnaire_response questionnaire_radio">
<table class="individual" style="border: 0; border-spacing: 1px; padding: 0; width:{{twidth}}">
  <tbody>
    <tr>
        {{#osgood}}<td style="width: {{sidecolwidth}}; text-align: right;"></td>{{/osgood}}
        {{^osgood}}<td style="width: {{sidecolwidth}}"></td>{{/osgood}}
        {{#headers}}
        <td style="width:{{colwidth}}; text-align:center" class="{{bg}} smalltext">{{str}}</td>
        {{/headers}}
        {{#osgood}}<td style="width:{{sidecolwidth}};"></td>{{/osgood}}
    </tr>
    {{#rows}}
    <tr>
        <td style="text-align:{{textalign}}">{{{content}}}</td>
        {{#cols}}
        {{#checked}}
        <td style="text-align:center;" class="selected">
            <span class="selected"><input type="radio" name="{{str}}" checked="checked" disabled="disabled"/></span>
        </td>
        {{/checked}}
        {{^checked}}
        <td style="text-align:center;" class="{{bg}}">
            <span class="unselected"><input type="radio" disabled="disabled" name="{{str}}" onclick="this.checked=false;" /></span>
        </td>
        {{/checked}}
        {{/cols}}
        {{#osgood}}<td>{{{osgoodstr}}}</td>{{/osgood}}
    </tr>
    {{/rows}}
  </tbody>
</table>
</div>
<!-- End HTML generated from response_rate template. -->