{{!
    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_verbalfeedback/report_download

    Moodle report download template.

    The purpose of this template is to render a report for download.

    Classes required for JS:
    * none

    Data attributes required for JS:
    * none

    Context variables required for this template:
    * none

    Example context (json):
    {
        "lang": "en",
        "coursestart": 1734704760,
        "courseend": 0,
        "instancename": "Test Verbal Feedback",
        "teachers": "John Doe",
        "student": "Mel Foo",
        "font_base": "Noto_Sans",
        "font_student": "inherit",
        "font_teacher": "inherit",
        "report": {
          "categories": []
        }
    }
}}
<!DOCTYPE html>
<html lang="{{ lang }}">

<head>
  <title>Titel</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <style>
    body {
      font-family: {{ font_base }}, Helvetica, sans-serif;
      font-size: 9pt;
    }

    table {
      border: 1px solid black;
    }

    tr {
      border: 1px solid black;
    }

    th {
      border: 1px solid black;
    }

    td {
      border: 1px solid black;
    }
    .student {
      font-family: {{ font_student }};
    }
    .teacher {
      font-family: {{ font_teacher }};
    }
  </style>
</head>

<body>
  <br>
  <table style="width: 420px;">
    <tr>
      <td style="width: 80px;">{{#str}}course, mod_verbalfeedback{{/str}}</td>
      <td>{{ course }}</td>
    </tr>
    <tr>
      <td>{{#str}}startend, mod_verbalfeedback{{/str}}</td>
      <td>{{ coursestart }} -<br>{{courseend}}</td>
    </tr>
    <tr>
      <td>{{#str}}activity, mod_verbalfeedback{{/str}}</td>
      <td>{{ instancename }}</td>
    </tr>
    <tr>
      <td>{{#str}}teachers, mod_verbalfeedback{{/str}}</td>
      <td class="teacher">{{ teachers }}</td>
    </tr>
    <tr>
      <td>{{#str}}student, mod_verbalfeedback{{/str}}</td>
      <td class="student">{{ student }}</td>
    </tr>
  </table>
  <br><br>
  <table style="width: 420px;">
    <tr>
      <td style="width: 80px;">{{#str}}percentage, mod_verbalfeedback{{/str}}</td>
      <td>{{ report.resultpercentage }}</td>
    </tr>
    <tr>
      <td>{{#str}}weightedaverage, mod_verbalfeedback{{/str}}</td>
      <td>{{ report.resultvsmax }}</td>
    </tr>
  </table>
  <br><br><br><br><br><br><br><br><br>
  {{# report.categories }}
  <table style="page-break-inside:avoid">
    <tr>
      <th width="400">
        <strong>{{ name }}</strong>{{avg}}
      </th>
      <th colspan="3" width="230">
        <span><b>{{#str}}weightedaverage, mod_verbalfeedback{{/str}}: {{average}}</b></span><br>
        <span><b>{{#str}}categoryweight, mod_verbalfeedback{{/str}}: {{percentage}}</b></span>
      </th>
    </tr>
    <tr>
      <td>
      </td>
      <td>{{#str}}valuation, mod_verbalfeedback{{/str}}</td>
      <td>{{#str}}value, mod_verbalfeedback{{/str}}</td>
      <td>{{#str}}factor, mod_verbalfeedback{{/str}}</td>
    </tr>

    {{# criteria }}
    <tr>
      <td>
        <div>{{text}}</div>
        {{# comments }}
          <br>
          <strong>{{#str}}comments, mod_verbalfeedback{{/str}}:</strong>
          {{# texts }}
            <div>{{{.}}}</div>
          {{/texts}}
        {{/comments}}
        {{^comments}}
          <br>
        {{/comments}}
      </td>
      <td>{{scaletext}}</td>
      <td>{{averagerating}}</td>
      <td>{{multiplier}}</td>
    </tr>
    {{/criteria}}
  </table>
  <br><br>
    {{/ report.categories }}
</body>

</html>