Skip to content

Commit

Permalink
Merge pull request #46 from ooemperor/dev
Browse files Browse the repository at this point in the history
Hotfix for wrong file download in testcases, switched columns in task submission view and adding github repo link to overview page
  • Loading branch information
ooemperor authored Mar 17, 2024
2 parents 106982a + ea029c7 commit 1f2c2c8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions codeGrader/frontend/admin/handlers/TestCase.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ def get(self, id_: int) -> Union[str, Response]:
task_id = testcase["task"]["profile"]["id"]

if self.admin.check_permission('r', task_profile_id): # when admin is allowed to view this File
input_file_id = testcase["input_file_id"]
file_id = testcase[self.file_id_name]

req = self.api.get_file(f"/file/{input_file_id}")
req = self.api.get_file(f"/file/{file_id}")
filename = testcase[self.file_type_name]["filename"]
req.headers['Content-Disposition'] = f"attachment;filename={filename}"
return Response(stream_with_context(req.iter_content(chunk_size=2048)),
Expand Down
6 changes: 6 additions & 0 deletions codeGrader/frontend/admin/templates/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ <h5>Password Reset</h5>
</form>
</div>
</div>
<div class="row">
<div id="source_code">
<h2>Source Code</h2>
<p>The Source code to this application is avaiable in this <a href="https://github.com/ooemperor/CodeGrader">GitHub</a> Repository. </p>
</div>
</div>
<script>
// script for the password visibility
// getting the elements on which we will operate
Expand Down
6 changes: 3 additions & 3 deletions codeGrader/frontend/admin/templates/task.html
Original file line number Diff line number Diff line change
Expand Up @@ -461,15 +461,15 @@ <h2 class="accordion-header">
{{ sub["user"]["username"] }}
</a>
</td>
<td>
{{ sub["state"] }}
</td>
<td>
<a href="{{ url_for('SubmissionFile', id_ = sub['id']) }}" target="_blank"
download="{{ sub['file']['filename'] }}">
{{ sub["file"]["filename"]}}
</a>
</td>
<td>
{{ sub["state"] }}
</td>
<td>
{{ sub["max_score"] }}
</td>
Expand Down
6 changes: 6 additions & 0 deletions codeGrader/frontend/user/templates/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ <h5 class="card-title">
</div>
</div>
</div>
<div class="row">
<div id="source_code">
<h2>Source Code</h2>
<p>The Source code to this application is avaiable in this <a href="https://github.com/ooemperor/CodeGrader">GitHub</a> Repository. </p>
</div>
</div>
<script>
// script for the password visibility
// getting the elements on which we will operate
Expand Down

0 comments on commit 1f2c2c8

Please sign in to comment.