Skip to content

Commit

Permalink
adding timeout param to the frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
ooemperor committed Jun 23, 2024
1 parent 8891c5e commit e74cd43
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions codeGrader/frontend/admin/handlers/Task.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def post(self, id_: int) -> Response:
task_data["tag"] = self.get_value("tag")
task_data["description"] = self.get_value("description")
task_data["exercise_id"] = self.get_value("exercise")
task_data["timeout"] = self.get_value("timeout")

# getting the data from the form provided in the request
self.api.put(f"/task/{id_}", body=task_data)
Expand Down Expand Up @@ -175,6 +176,7 @@ def post(self) -> Response:
task_data["tag"] = self.get_value("tag")
task_data["description"] = self.get_value("description")
task_data["exercise_id"] = self.get_value("exercise")
task_data["timeout"] = self.get_value("timeout")

self.api.post("/task/add", body=task_data)

Expand Down
6 changes: 6 additions & 0 deletions codeGrader/frontend/admin/templates/addTask.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ <h1 class="header1">Task</h1>
cols="100">{{ description }}</textarea>
</td>
</tr>
<tr>
<td class=" data">Tag</td>
<td>
<input class="input" type="text" id="input_timeout" name="timeout" placeholder="Timeout in seconds">
</td>
</tr>
<tr>
<td class=" data">Tag</td>
<td>
Expand Down
7 changes: 7 additions & 0 deletions codeGrader/frontend/admin/templates/task.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ <h1 class="header1">Task {{ name }}</h1>
name="description" rows="3" cols="100">{{ description }}</textarea>
</td>
</tr>
<tr>
<td>Timeout</td>
<td>
<input class="input" {% if not editable %} readonly {% endif %} type="text" id="input_timeout"
name="tag" value="{{ timeout }}">
</td>
</tr>
<tr>
<td>Tag</td>
<td>
Expand Down

0 comments on commit e74cd43

Please sign in to comment.