{{!
    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_offlinequiz/edit_buttons

    the buttons on the edit.php

    Example context (json):
    {
        "uploadfurtherfileslink": "https://moodle.org/mod/offlinequiz/report/rimport/report.php?offlinequizid=5",
        "groupchoiceoptions": [
            {
                "number": "1",
                "selected": "true",
                "letter": "A"
            }
        ],
        "informationquestioncount": "1",
        "informationcurrentstatus": "This offline quiz is open",
        "warningsempty": "true",
        "maxgradeinputsize": "20",
        "groupchoiceactionurl": "https://moodle.org/mod/offlinequiz/edit.php?cmid=8",
        "addtogroupformurl": "https://moodle.org/mod/offlinequiz/edit.php?cmid=8"
    }
}}
<div>
  <div class="offlinequizeditsection row">
    <div class="groupchoice col-7">
      <div class="single-select d-inline-block">
        <form method="get" action="{{groupchoiceactionurl}}" class="d-flex flex-wrap align-items-center">
          <input type="hidden" name="cmid" value="{{cmid}}">
          <select class="custom-select single-select" name="groupnumber" onchange="this.form.submit()">
            {{#groupchoiceoptions}}
              <option value="{{number}}" {{#selected}}selected{{/selected}}>{{#str}} questionsingroup, mod_offlinequiz {{/str}} {{letter}}</option>
            {{/groupchoiceoptions}}
          </select>
        </form>
      </div>
      <div class="offlinequizinformation statusbar">
        <span class="numberofquestions">
          {{#str}} numquestionsx, mod_offlinequiz {{/str}} {{informationquestioncount}}
        </span>
        <span>
          |
        </span>
        <span class="offlinequizopeningstatus" title="{{informationexplanation}}">
         {{informationcurrentstatus}}
        </span>
      </div>
    </div>
    <div class="maxgrade col-5 ms-auto">
      <form class="row ms-auto">
        <input type="hidden" name="cmid" value="{{cmid}}">
        <input type="hidden" name="sesskey" value="{{sesskey}}">
        <input type="hidden" name="groupnumber" value="{{groupnumber}}">
        <div class="inputmaxgradelabel col-5 pe-0">
          <label for="inputmaxgrade">
            {{#str}} maximumgradex,  {{/str}}
          </label>
        </div>
        <div class="col-4">
          <input type="text" id="inputmaxgrade" name="maxgrade" size="{{maxgradeinputsize}}" value="{{maxgradevalue}}">
        </div>
        <button type="submit" name="savechanges" value="true" class="btn btn-secondary savechanges col-3">
          {{#str}} save, mod_offlinequiz {{/str}}
        </button>
      </form>
      <div class="sumgrades row ms-auto">
        <span class="totalpoints col-5 pe-0">
          {{#str}} totalmarksx, mod_offlinequiz {{/str}}
        </span>
        <span class="mod_offlinequiz_summarks col-4">{{sumgrades}}</span>
        <div class="col-3" > </div>
      </div>
    </div>
    <div class="warnings col-12">
      {{#warningsempty}}
        <div class="emptystatusdisplay box"></div>
      {{/warningsempty}}
      {{#warningsexist}}
        <div class="statusdisplay box">
          {{#warnings}}
            <p>{{{text}}}</p>
          {{/warnings}}
        </div>
      {{/warningsexist}}
    </div>
    <div class="repaginatebutton col-12">
      {{{repaginatebutton}}}
    </div>
    <div class="col-12 editquestionsform">
      <form method="post" action="{{addtogroupformurl}}" id="offlinequizbulkcopyform" class="offlinequizbulkcopyform">
        <input type="hidden" name="sesskey" value="{{sesskey}}" >
        <input type="hidden" name="fromofflinegroup" value="{{groupid}}" >
        <div class="copyselected">
          <span class="addselectedtogrouptext">{{#str}} copyselectedtogroup, mod_offlinequiz {{/str}} </span>
          <select id="menucopyselectedtogrouptop" class="select form-select menucopyselectedtogrouptop" name="copyselectedtogrouptop">
            <option value="0" selected> {{#str}} selectagroup, mod_offlinequiz {{/str}}</option>
            {{#addtogroupotpions}}
              <option value="{{number}}">{{#str}} questionsingroup, mod_offlinequiz {{/str}} {{letter}}</option>
            {{/addtogroupotpions}}
          </select>
          <input class="btn btn-secondary" type="submit" name="savechanges"  {{#addtogroupdisabled}} disabled="disabled" {{/addtogroupdisabled}} value="{{#str}} add {{/str}}" >
          <div class="removeselected">
            <input type="submit"  name="offlinequizdeleteselected" id="removeselectedcommand"  {{#addtogroupdisabled}} disabled="disabled" {{/addtogroupdisabled}}
               onclick="return confirm('{{#str}} areyousureremoveselected, mod_offlinequiz {{/str}}');" value="{{#str}} removeselected, mod_offlinequiz {{/str}}" class="btn btn-secondary">
          </div>
        </div>
        <div class="btn-toolbar" role="toolbar" aria-label="{{#str}} selectmultipletoolbar, mod_offlinequiz {{/str}}">
          <div class="btn-group selectmultiplecommandbuttons">
            <a role="button" class="btn btn-link selectall" href="#">{{#str}} selectall, mod_offlinequiz {{/str}}</a>
            <a role="button" class="btn btn-link deselectall" href="#">{{#str}} selectnone, mod_offlinequiz {{/str}}</a>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>