Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions server/controllers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,16 @@ def grading_view(backup, form=None, is_composition=False):
backup=backup, group=group, files=files, diff_type=diff_type,
task=task, form=form, is_composition=is_composition)

@admin.route('/delete_backup/<hashid:bid>', methods=["POST"])
@is_staff()
def delete_backup(bid):
backup = Backup.query.get(bid)
if not backup:
abort(404)

db.session.delete(backup)
db.session.commit()

@admin.route('/grading/<hashid:bid>')
@is_staff()
def grading(bid):
Expand Down
7 changes: 6 additions & 1 deletion server/templates/staff/student/assignment.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ <h3 class="box-title">Backups/Submissions</h3>
<th>Submitter</th>
<th>ID</th>
<th>Scores</th>
<th>Action</th>
<th>Actions</th>
<th>Flag</th>
</thead>
<tbody>
Expand Down Expand Up @@ -231,6 +231,11 @@ <h3 class="box-title">Backups/Submissions</h3>
<a href="{{ url_for('.grading', bid=item.id, diff='short') }}" class="btn btn-primary btn-flat">
Grade
</a>
{% call forms.render_form_bare(csrf_form, action_url=url_for('.delete_backup', bid=item.id), class_='') %}
<button class="btn btn-danger btn-flat" type="submit" value="remove">
Delete
</button>
{% endcall %}
</div>
</td>
<td>
Expand Down