<h1 class="text-center">{{#str}}totalscore, mod_minilesson{{/str}} {{total}}%</h1>
<div class="quizrating">
    {{#yellowstars}}
        <span><img src="{{{ config.wwwroot }}}/mod/minilesson/pix/yellow_star.png"/></span>
    {{/yellowstars}}
    {{#graystars}}
        <span><img src="{{{ config.wwwroot }}}/mod/minilesson/pix/gray_star.png"/></span>
    {{/graystars}}
</div>
{{#showfullresults}}
<p>
    <a class="btn btn-primary itemscoresbutton" data-toggle="collapse" href="#itemscores" data-bs-toggle="collapse" data-bs-target="#itemscores" role="button" aria-expanded="false" aria-controls="itemscores" data-hide-text="{{#str}}hideitemscores, mod_minilesson{{/str}}" data-show-text="{{#str}}showitemscores, mod_minilesson{{/str}}" >
        {{#str}}showitemscores, mod_minilesson{{/str}}
    </a>
</p>
{{/showfullresults}}
<div class="collapse" id="itemscores">
{{#results}}
<div class="mod_minilesson_result_div">
    <div class="panel-group" id="accordion">
        <div class="btn-primary mod_minilesson_result_index">{{index}}</div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title"> <a class="accordion-toggle mod_minilesson_result_title " data-bs-toggle="collapse" data-toggle="collapse" data-parent="#accordion" href="#accordion{{index}}">  {{title}}</a> </h4>
            </div>
            <div id="accordion{{index}}" class="panel-collapse collapse show in">
                <div class="panel-body">
                    <ul class="minilesson_result">
                        <li><div class="mod_minilesson_question_text"><b>{{#str}}questiontext, mod_minilesson{{/str}}: </b><br/>{{{questext}}}</div></li>
                        <li><div class="mod_minilesson_result_score"><b>{{#str}}score, mod_minilesson{{/str}}: </b><br/>{{correctitems}}/{{totalitems}}</div></li>
                        <li><div class="mod_minilesson_result_grade"><b>{{#str}}grade, mod_minilesson{{/str}}: </b><br/>{{grade}}%</div></li>
                        {{#hascorrectanswer}}
                            <li>
                                <div class="mod_minilesson_result_correctanswer"><b>{{#str}}correctanswer, mod_minilesson{{/str}}</b><br/>
                                    {{#correctans}}<span class="mod_minilesson_finishedanswer">{{{sentence}}}</span>{{/correctans}}
                                </div>
                            </li>
                        {{/hascorrectanswer}}
                        {{#hasincorrectanswer}}
                            <li><div class="mod_minilesson_result_incorrectanswer"><b>{{#str}}incorrectanswer, mod_minilesson{{/str}} </b><br/>
                                {{#incorrectans}}<span class="mod_minilesson_finishedanswer">{{{sentence}}}</span>{{/incorrectans}}
                            </div>
                            </li>
                        {{/hasincorrectanswer}}
                        {{#hasanswerdetails}}
                        <li>
                            <div class="mod_minilesson_result_answerdetails"><b>{{#str}}answerdetails, mod_minilesson{{/str}}</b><br/>
                                <a class="mod_minilesson_finishedanswerdetailslink" data-target="ml_answerdetails_container_{{index}}" data-resultstemplate="{{resultstemplate}}" data-resultsdata="{{resultsdatajson}}" data-teacherreport="{{teacherreport}}" href="#">{{#str}}seeanswerdetails, mod_minilesson{{/str}}</a>
                            </div>
                        </li>
                        {{/hasanswerdetails}}
                        <li><div class="mod_minilesson_result_rating">
                            {{#yellowstars}}
                                <span><img src="{{{ config.wwwroot }}}/mod/minilesson/pix/yellow_star.png"/></span>
                            {{/yellowstars}}
                            {{#graystars}}
                                <span><img src="{{{ config.wwwroot }}}/mod/minilesson/pix/gray_star.png"/></span>
                            {{/graystars}}
                        </div>
                        </li>
                    </ul>
                    <div id="ml_answerdetails_container_{{index}}" class="ml_qf_itemresults" style="display: none"></div>
                </div>
            </div>
        </div>
    </div>
</div>
{{/results}}
</div>
{{#backtocourse}}
<div class="minilesson_actionbutton">
<a class="btn btn-secondary backtocourse center" href="{{{courseurl}}}">{{#str}}backtotop, mod_minilesson{{/str}}</a>
</div>
{{/backtocourse}}
{{#reattempturl}}
<div class="minilesson_actionbutton">
<a class="btn btn-secondary btn_finished_attempt center" href="{{{reattempturl}}}" data-href="{{{reattempturl}}}" data-action="reattempt">
    {{#str}}reattempt, mod_minilesson{{/str}}</a>
</div>
{{/reattempturl}}
{{^element.frozen}}
{{#js}}
    require(['jquery', 'mod_minilesson/quizfinished'], function($, quizfinished) {
      quizfinished.init();
    });
{{/js}}
{{/element.frozen}}
