{if $action===""}
  <h3>Štatistika</h3>
  <div class="indent">
    <div class="underline">Štatistika podľa úspešnosti:</div>
    <form action="index.php" method="get">
      <input name="site" type="hidden" value="statistics" />
      <input name="action" type="hidden" value="showBySuccess" />
      <input name="courseID" type="hidden" value="{$courseID}" />
      <table>
        <tr>
          <td>Zobraz</td>
          <td>
            <select name="showWhat">
              <option value="answerSets">sady odpovedí</option>
              <option value="questions">otázky</option>
              <option value="domains">okruhy tém</option>
              <option value="students">študentov</option>
              <option value="terms">termíny</option>
            </select>
          </td>
          <td colspan="2">podľa úspešnosti</td>
        </tr>
        <tr>
          <td>od</td>
          <td><input name="statisticsDateFrom" type="text" value="{$statisticsDateFrom}" /></td>
          <td>do</td>
          <td><input name="statisticsDateTo" type="text" value="{$statisticsDateTo}" /></td>
        </tr>
        <tr>
          <td>trieď</td>
          <td>
            <select name="sort">
              <option value="ascending">vzostupne</option>
              <option value="descending">zostupne</option>
            </select>
          </td>
          <td></td>
          <td><input type="submit" value="OK" /></td>
        </tr>
      </table>
    </form>
    <br /><br />
    <div class="underline">Štatistika zastúpenia známok</div>
    <form action="index.php" method="get">
      <input name="site" type="hidden" value="statistics" />
      <input name="action" type="hidden" value="showRepresentationOfMarks" />
      <input name="courseID" type="hidden" value="{$courseID}" />
      Zobraz zastúpenia známok v termíne
      <select name="examID">
        <option value="dontCare">nezáleží</option>
        {foreach from=$examList item=menuItem}
          <option value="{$menuItem.id}">{$menuItem.date}</option>
        {/foreach}
      </select>
      <input type="submit" value="OK" />
    </form>
  </div>
{elseif $action==="showBySuccess"}
  <h3>Štatistika podľa úspešnosti</h3>
  <div class="indent">
    <form action="index.php" method="get">
      <input name="site" type="hidden" value="statistics" />
      <input name="action" type="hidden" value="showBySuccess" />
      <input name="courseID" type="hidden" value="{$courseID}" />
      <table>
        <tr>
          <td>Zobraz</td>
          <td>
            <select name="showWhat">
              <option value="answerSets"{if $showWhat==="answerSets"} selected="selected"{/if}>sady odpovedí</option>
              <option value="questions"{if $showWhat==="questions"} selected="selected"{/if}>otázky</option>
              <option value="domains"{if $showWhat==="domains"} selected="selected"{/if}>okruhy tém</option>
              <option value="students"{if $showWhat==="students"} selected="selected"{/if}>študentov</option>
              <option value="terms"{if $showWhat==="terms"} selected="selected"{/if}>termíny</option>
            </select>
          </td>
          <td colspan="2">podľa úspešnosti</td>
        </tr>
        <tr>
          <td>od</td>
          <td><input name="statisticsDateFrom" type="text" value="{$statisticsDateFrom}" /></td>
          <td>do</td>
          <td><input name="statisticsDateTo" type="text" value="{$statisticsDateTo}" /></td>
        </tr>
        <tr>
          <td>trieď</td>
          <td>
            <select name="sort">
              <option value="ascending"{if $sort==="ascending"} selected="selected"{/if}>vzostupne</option>
              <option value="descending"{if $sort==="descending"} selected="selected"{/if}>zostupne</option>
            </select>
          </td>
          <td></td>
          <td><input type="submit" value="OK" /></td>
        </tr>
      </table>
    </form>
    <br />
    {if $showWhat==="answerSets"}
      <table>
        <tr>
          <td><div class="bold">Sada odpovedí</div></td>
          <td><div class="bold">Priemer. # bodov</div></td>
        </tr>
        {foreach from=$answerSets item=menuItem}
          <tr>
            <td>{$menuItem.text}</td>
            <td>{$menuItem.avg}</td>
            <td><a href="index.php?site=questionDB&amp;action=editAnswerSet&amp;courseID={$courseID}&amp;domainID={$menuItem.id_domain}&amp;questionID={$menuItem.id_question}&amp;answerSetID={$menuItem.id}">[editovať]</a></td>
            <td><a href="javascript: Ask('Naozaj chcete sadu odpovedí vymazať?', 'index.php?site=questionDB&amp;action=deleteAnswerSet&amp;courseID={$courseID}&amp;domainID={$menuItem.id_domain}&amp;questionID={$menuItem.id_question}&amp;answerSetID={$menuItem.id}&amp;redirect=1&amp;redsite=statistics&amp;redaction=showBySuccess&amp;redcourseID={$courseID}&amp;redshowWhat={$showWhat}&amp;redstatisticsDateFrom={$statisticsDateFrom}&amp;redstatisticsDateTo={$statisticsDateTo}&amp;redsort={$sort}');">[odstrániť]</a></td>
          </tr>
        {/foreach}
      </table>
    {elseif $showWhat==="questions"}
      <table>
        <tr>
          <td><div class="bold">Otázka</div></td>
          <td><div class="bold">Priemer. # bodov</div></td>
        </tr>
        {foreach from=$questions item=menuItem}
          <tr>
            <td><a href="index.php?site=questionDB&amp;action=browseAnswerSets&amp;courseID={$courseID}&amp;domainID={$menuItem.id_domain}&amp;questionID={$menuItem.id}">{$menuItem.question}</a></td>
            <td>{$menuItem.avg}</td>
            <td><a href="index.php?site=questionDB&amp;action=editQuestion&amp;courseID={$courseID}&amp;domainID={$menuItem.id_domain}&amp;questionID={$menuItem.id}">[editovať]</a></td>
            <td><a href="javascript: Ask('Naozaj chcete otázku vymazať?', 'index.php?site=questionDB&amp;action=deleteQuestion&amp;courseID={$courseID}&amp;domainID={$menuItem.id_domain}&amp;questionID={$menuItem.id}&amp;redirect=1&amp;redsite=statistics&amp;redaction=showBySuccess&amp;redcourseID={$courseID}&amp;redshowWhat={$showWhat}&amp;redstatisticsDateFrom={$statisticsDateFrom}&amp;redstatisticsDateTo={$statisticsDateTo}&amp;redsort={$sort}');">[odstrániť]</a></td>
          </tr>
        {/foreach}
      </table>
    {elseif $showWhat==="domains"}
      <table>
        <tr>
          <td><div class="bold">Doména</div></td>
          <td><div class="bold">Priemer. # bodov</div></td>
        </tr>
        {foreach from=$domains item=menuItem}
          <tr>
            <td><a href="index.php?site=questionDB&amp;action=browseDomain&amp;courseID={$courseID}&amp;domainID={$menuItem.id}">{$menuItem.subject}</a></td>
            <td>{$menuItem.avg}</td>
            <td><a href="index.php?site=questionDB&amp;action=editDomain&amp;courseID={$courseID}&amp;domainID={$menuItem.id}">[editovať]</a></td>
            <td><a href="javascript: Ask('Naozaj chcete okruh tém vymazať?', 'index.php?site=questionDB&amp;action=deleteDomain&amp;courseID={$courseID}&amp;domainID={$menuItem.id}&amp;redirect=1&amp;redsite=statistics&amp;redaction=showBySuccess&amp;redcourseID={$courseID}&amp;redshowWhat={$showWhat}&amp;redstatisticsDateFrom={$statisticsDateFrom}&amp;redstatisticsDateTo={$statisticsDateTo}&amp;redsort={$sort}');">[odstrániť]</a></td>
          </tr>
        {/foreach}
      </table>
    {elseif $showWhat==="students"}
      <table>
        <tr>
          <td><div class="bold">Meno</div></td>
          <td><div class="bold">Priemer. # bodov</div></td>
        </tr>
        {foreach from=$students item=menuItem}
          <tr>
            <td>{$menuItem.name}</td>
            <td>{$menuItem.avg}</td>
            <td><a href="index.php?site=userInformation&amp;action=showStudent&amp;courseID={$courseID}&amp;userID={$menuItem.id}&amp;menuSet=2&amp;menuIndex=7">[detaily]</a></td>
          </tr>
        {/foreach}
      </table>
    {elseif $showWhat==="terms"}
      <table>
        <tr>
          <td><div class="bold">Dátum</div></td>
          <td><div class="bold">Priemer. # bodov</div></td>
        </tr>
        {foreach from=$terms item=menuItem}
          <tr>
            <td>{$menuItem.date}</td>
            <td>{$menuItem.avg}</td>
            <td><a href="index.php?site=examTerms&amp;action=listOfStudents&amp;courseID={$courseID}&amp;examID={$menuItem.id}">[zoznam študentov]</a></td>
          </tr>
        {/foreach}
      </table>
    {/if}
    <br />
    <a href="index.php?site=statistics&amp;courseID={$courseID}">Naspät</a>
  </div>
{elseif $action==="showRepresentationOfMarks"}
  <h3>Štatistika zastúpenia známok</h3>
  <div class="indent">
    <form action="index.php" method="get">
      <input name="site" type="hidden" value="statistics" />
      <input name="action" type="hidden" value="showRepresentationOfMarks" />
      <input name="courseID" type="hidden" value="{$courseID}" />
      Zobraz zastúpenia známok v termíne
      <select name="examID">
        <option value="dontCare"{if $examID==="dontCare"} selected="selected"{/if}>nezáleží</option>
        {foreach from=$examList item=menuItem}
          <option value="{$menuItem.id}"{if $menuItem.id==$examID} selected="selected"{/if}>{$menuItem.date}</option>
        {/foreach}
      </select>
      <input type="submit" value="OK" />
    </form>
    <br />
    <div class="underline">Termín: {$examDate}</div>
    <table>
      {foreach from=$marks item=menuItem}
        <tr>
          <td>{$menuItem.mark}:</td>
          <td>{$menuItem.count}</td>
        </tr>
      {/foreach}
    </table>
    <br />
    <a href="index.php?site=statistics&amp;courseID={$courseID}">Naspät</a>
  </div>
{/if}
