{{!
    @template local_kid/eval_grid_student

    Student-mode fragment of local_kid/eval_grid, extracted so it can be
    re-rendered on its own by the AJAX student-switch endpoint
    (classes/external/get_grid_student_view.php) without re-rendering the
    "<h2>titre</h2>" or the summary-mode table.

    Context: same as local_kid/eval_grid's student-mode branch, plus
    studentnav (see templates/student_nav.mustache), plus hasmoodlefeedback,
    moodlefeedbacktext (already format_text()-ed), moodlefeedbackchanged,
    moodlefeedbacklastsync, canimport, templateoneurl.

    Note: this partial is the CONTENT of [data-region="kid-grid-student"],
    not the wrapper itself — the wrapper div lives in local_kid/eval_grid so
    amd/src/student_nav.js can replace this partial's output via
    innerHTML without nesting an extra wrapper on every student switch.
}}
<p class="fr-mb-2w"><a class="fr-link" href="{{backurl}}" data-kid-guard-nav="1">{{#str}}entry_back_to_summary, local_kid{{/str}}</a></p>
{{#studentnav}}{{> local_kid/student_nav}}{{/studentnav}}
{{> local_kid/workflow_stepper}}
<div class="kid-publication fr-mb-2w">
    <ul class="fr-btns-group fr-btns-group--inline-md fr-mb-0">
        {{#canvalidate}}<li><a class="fr-btn fr-btn--secondary" href="{{validateurl}}">{{#str}}workflow_action_validate, local_kid{{/str}}</a></li>{{/canvalidate}}
        {{#canfinalise}}<li><a class="fr-btn fr-btn--secondary" href="{{finaliseurl}}">{{#str}}workflow_action_finalise, local_kid{{/str}}</a></li>{{/canfinalise}}
        {{#canreopen}}<li><a class="fr-btn fr-btn--secondary" href="{{reopenurl}}">{{#str}}workflow_action_reopen, local_kid{{/str}}</a></li>{{/canreopen}}
    </ul>
    {{#ispublished}}<span class="fr-badge fr-badge--success">{{#str}}published_yes, local_kid{{/str}}</span>{{/ispublished}}
</div>

{{#canimport}}
<p class="fr-mb-2w"><a class="fr-link" href="{{templateoneurl}}">{{#str}}eval_template_student, local_kid{{/str}}</a></p>
{{/canimport}}

{{#fichestudenturl_docx}}
<ul class="fr-btns-group fr-btns-group--inline-md fr-btns-group--sm fr-mb-2w">
    <li><a class="fr-btn fr-btn--tertiary fr-btn--sm" href="{{fichestudenturl_docx}}">{{#str}}fiche_download_student, local_kid{{/str}} ({{#str}}fiche_format_docx, local_kid{{/str}})</a></li>
    <li><a class="fr-btn fr-btn--tertiary fr-btn--sm" href="{{fichestudenturl_pdf}}">{{#str}}fiche_download_student, local_kid{{/str}} ({{#str}}fiche_format_pdf, local_kid{{/str}})</a></li>
</ul>
{{/fichestudenturl_docx}}

{{#hasmoodlefeedback}}
<div class="fr-card fr-mb-2w">
    <div class="fr-card__body">
        <div class="fr-card__content">
            <h3 class="fr-card__title">{{#str}}eval_feedback_heading, local_kid{{/str}}</h3>
            {{#moodlefeedbackchanged}}
            <p class="fr-badge fr-badge--warning">{{#str}}eval_feedback_changed_notice, local_kid{{/str}}</p>
            {{/moodlefeedbackchanged}}
            {{#moodlefeedbacktext}}
                <div class="kid-feedback-moodle__text">{{{moodlefeedbacktext}}}</div>
            {{/moodlefeedbacktext}}
            {{^moodlefeedbacktext}}
                <p class="fr-text--sm">{{#str}}eval_feedback_empty, local_kid{{/str}}</p>
            {{/moodlefeedbacktext}}
            <p class="fr-text--sm">{{#str}}eval_sync_last, local_kid, {{moodlefeedbacklastsync}}{{/str}}</p>
        </div>
    </div>
</div>
{{/hasmoodlefeedback}}

<div class="fr-card" data-region="kid-entry-form">
    <div class="fr-card__body">
        <div class="fr-card__content">
            {{{formhtml}}}
        </div>
    </div>
</div>
