<!doctype html>
<head>
  <title>ngshare</title>
  <style>
    a {
        color: blue
    }
  </style>
</head>
<body>
<h1>
  Hello, world! from
  <a style="color: black; text-decoration: none"
     href="https://github.com/lxylxy123456/ngshare">
    ngshare
    <img src="favicon.ico" style="height: 1em" />
  </a>
</h1>
{% if debug %}
<h2>Debug actions</h2>
<p>
  <a href="initialize-Data6ase?action=dump&user=root">dump database</a>
  (<a href="initialize-Data6ase?action=dump&human-readable=true&user=root">human readable</a>) /
  <a href="initialize-Data6ase?action=clear&user=root">clear database</a> /
  <a href="initialize-Data6ase?action=init&user=root">init with test data</a>
</p>
{% end %}
<h2>Here are some sample uses of our APIs</h2>
<p>
  GET
  <a href="courses{% if vngshare %}?user=eric{% end %}">
    /api/courses</a>:
  List courses
</p>
<form id="form0" action="course/course3" method="POST">
  {% if vngshare %}<input type="hidden" name="user" value="root" />{% end %}
  <input type="hidden" name="instructors" value="[&quot;kevin&quot;, &quot;abigail&quot;, &quot;lawrence&quot;, &quot;eric&quot;]" />
  <p>
    POST
      <a href="" onclick="document.getElementById('form0').submit(); event.preventDefault();">/api/course/&lt;course_id&gt;</a>:
    Create course (see HTML form)
  </p>
</form>
<p>
  DELETE
  <u>
    /api/course/&lt;course_id&gt;</u>:
  Delete course
</p>
<form id="form4" action="instructor/course2/kevin" method="POST">
  <input type="hidden" name="first_name" value="kevin_first_name" />
  <input type="hidden" name="last_name" value="kevin_last_name" />
  <input type="hidden" name="email" value="kevin_email" />
  {% if vngshare %}<input type="hidden" name="user" value="root" />{% end %}
  <p>
    POST
      <a href="" onclick="document.getElementById('form4').submit(); event.preventDefault();">/api/instructor/&lt;course_id&gt;/&lt;instructor_id&gt;</a>:
    Add course instructor (see HTML form)
  </p>
</form>
<p>
  GET
  <a href="instructor/course2/abigail{% if vngshare %}?user=eric{% end %}">
    /api/instructor/&lt;course_id&gt;/&lt;instructor_id&gt;</a>:
  Get course instructor
</p>
<p>
  DELETE
  <u>
    /api/instructor/&lt;course_id&gt;/&lt;instructor_id&gt;</u>:
  Remove course instructor
</p>
<p>
  GET
  <a href="instructors/course2{% if vngshare %}?user=eric{% end %}">
    /api/instructors/&lt;course_id&gt;</a>:
  Get course instructors
</p>
<form id="form5" action="student/course2/kevin" method="POST">
  <input type="hidden" name="first_name" value="kevin_first_name" />
  <input type="hidden" name="last_name" value="kevin_last_name" />
  <input type="hidden" name="email" value="kevin_email" />
  {% if vngshare %}<input type="hidden" name="user" value="abigail" />{% end %}
  <p>
    POST
      <a href="" onclick="document.getElementById('form5').submit(); event.preventDefault();">/api/student/&lt;course_id&gt;/&lt;student_id&gt;</a>:
    Add course student (see HTML form)
  </p>
</form>
<p>
  GET
  <a href="student/course2/eric{% if vngshare %}?user=abigail{% end %}">
    /api/student/&lt;course_id&gt;/&lt;student_id&gt;</a>:
  Get course student
</p>
<p>
  DELETE
  <u>
    /api/student/&lt;course_id&gt;/&lt;student_id&gt;</u>:
  Remove course student
</p>
<form id="form6" action="students/course2" method="POST">
  <input type="hidden" name="students" value="[{&quot;username&quot;: &quot;kevin&quot;, &quot;first_name&quot;: &quot;kevin_first_name&quot;, &quot;last_name&quot;: &quot;kevin_last_name&quot;, &quot;email&quot;: &quot;kevin_email&quot;}]" />
  {% if vngshare %}<input type="hidden" name="user" value="abigail" />{% end %}
  <p>
    POST
      <a href="" onclick="document.getElementById('form6').submit(); event.preventDefault();">/api/students/&lt;course_id&gt;</a>:
    Add multiple students to course (see HTML form)
  </p>
</form>
<p>
  GET
  <a href="students/course2{% if vngshare %}?user=abigail{% end %}">
    /api/students/&lt;course_id&gt;</a>:
  Get course students
</p>
<p>
  GET
  <a href="assignments/course2{% if vngshare %}?user=abigail{% end %}">
    /api/assignments/&lt;course_id&gt;</a>:
  List assignments
</p>
<p>
  GET
  <a href="assignment/course1/challenge{% if vngshare %}?user=lawrence{% end %}">
    /api/assignment/&lt;course_id&gt;/&lt;assignment_id&gt;</a>:
  Download assignment
</p>
<form id="form1" action="assignment/course1/challenger" method="POST">
  <input type="hidden" name="files" value="[{&quot;path&quot;: &quot;a&quot;, &quot;content&quot;: &quot;amtsCg==&quot;}]" />
  <!-- [{"path": "a", "content": "amtsCg=="}] -->
  {% if vngshare %}<input type="hidden" name="user" value="kevin" />{% end %}
  <p>
    POST
      <a href="" onclick="document.getElementById('form1').submit(); event.preventDefault();">/api/assignment/&lt;course_id&gt;/&lt;assignment_id&gt;</a>:
    Release assignment (see HTML form)
  </p>
</form>
<p>
  DELETE
  <u>
    /api/assignment/&lt;course_id&gt;/&lt;assignment_id&gt;</u>:
  Remove assignment
</p>
<p>
  GET
    <a href="submissions/course1/challenge{% if vngshare %}?user=kevin{% end %}">
      /api/submissions/&lt;course_id&gt;/&lt;assignment_id&gt;</a>:
  List submissions
</p>
<p>
  GET
    <a href="submissions/course1/challenge/lawrence{% if vngshare %}?user=kevin{% end %}">
      /api/submissions/&lt;course_id&gt;/&lt;assignment_id&gt;/&lt;student_id&gt;</a>:
  List student's submissions
</p>
<form id="form2" action="submission/course2/assignment2a" method="POST">
  <input type="hidden" name="files" value="[{&quot;path&quot;: &quot;a&quot;, &quot;content&quot;: &quot;amtsCg==&quot;}]" />
  <!-- [{"path": "a", "content": "amtsCg=="}] -->
  {% if vngshare %}<input type="hidden" name="user" value="eric" />{% end %}
  <p>
    POST
      <a href="" onclick="document.getElementById('form2').submit(); event.preventDefault();">/api/submission/&lt;course_id&gt;/&lt;assignment_id&gt;</a>:
    Submit assignment (see HTML form)
  </p>
</form>
<p>
  GET
    <a href="submission/course1/challenge/lawrence{% if vngshare %}?user=kevin{% end %}">
      /api/submission/&lt;course_id&gt;/&lt;assignment_id&gt;/&lt;student_id&gt;</a>:
  Download submission
</p>
<form id="form3" action="feedback/course1/challenge/lawrence" method="POST">
  <input type="hidden" name="timestamp" value="2020-01-01 00:00:00.000000 " />
  <input type="hidden" name="files" value="[{&quot;path&quot;: &quot;a&quot;, &quot;content&quot;: &quot;amtsCg==&quot;}]" />
  <!-- [{"path": "a", "content": "amtsCg=="}] -->
  {% if vngshare %}<input type="hidden" name="user" value="kevin" />{% end %}
  <p>
    POST
      <a href="" onclick="document.getElementById('form3').submit(); event.preventDefault();">/api/feedback/&lt;course_id&gt;/&lt;assignment_id&gt;/&lt;student_id&gt;</a>:
    Upload feedback (see HTML form)
  </p>
</form>
<p>
  GET
    <a href="feedback/course1/challenge/lawrence?timestamp=2020-01-01 00:00:00.000000 {% if vngshare %}&user=lawrence{% end %}">
      /api/feedback/&lt;course_id&gt;/&lt;assignment_id&gt;/&lt;student_id&gt;</a>:
  Download feedback
</p>
</body>
