{{!
    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 theme_thinkera/quiz_summary

    «ملخص التدريب» before the student hands it in: the one sentence they need, then every question.

    Example context (json):
    {
        "rows": [{"isheading": false, "number": "1", "url": "#", "canvisit": true, "status": "صحيح",
                  "state": "correct", "flagged": false, "hasmark": true, "mark": "1"}],
        "hasrows": true, "answered": 1, "left": 11, "total": 12, "alldone": false, "hasleft": true
    }
}}
<div class="tk-sum">
    {{#hasrows}}
    <p class="tk-sum-lead {{#alldone}}is-done{{/alldone}}">
        {{#hasleft}}{{#str}}sum_left, theme_thinkera, {{left}}{{/str}}{{/hasleft}}
        {{#alldone}}{{#str}}sum_alldone, theme_thinkera{{/str}}{{/alldone}}
        <span class="tk-sum-count">{{#str}}sum_count, theme_thinkera, {{answered}}/{{total}}{{/str}}</span>
    </p>

    <ol class="tk-sumlist">
        {{#rows}}
        {{#isheading}}
        <li class="tk-sum-head">{{heading}}</li>
        {{/isheading}}
        {{^isheading}}
        <li class="tk-sum-item {{state}}">
            {{#canvisit}}
            <a class="tk-sum-no" href="{{url}}">
                <span class="tk-sum-no-num" dir="ltr">{{number}}</span>
                <span class="visually-hidden">{{#str}}sum_goto, theme_thinkera, {{number}}{{/str}}</span>
            </a>
            {{/canvisit}}
            {{^canvisit}}
            <span class="tk-sum-no" aria-hidden="true"><span class="tk-sum-no-num" dir="ltr">{{number}}</span></span>
            {{/canvisit}}
            <span class="tk-sum-state">{{status}}</span>
            {{#flagged}}<span class="tk-sum-flag" title="{{#str}}sum_flagged, theme_thinkera{{/str}}">★</span>{{/flagged}}
            {{#hasmark}}<span class="tk-sum-mark" dir="ltr">{{mark}}</span>{{/hasmark}}
        </li>
        {{/isheading}}
        {{/rows}}
    </ol>
    {{/hasrows}}
</div>
