Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 21c3779

Browse files
committed
Fix: modify remove timestamp
1 parent f8d87e9 commit 21c3779

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

bookserver/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# -------------------
2121
from fastapi import FastAPI, Request, status
2222
from fastapi.encoders import jsonable_encoder
23-
from fastapi.responses import RedirectResponse, JSONResponse
23+
from fastapi.responses import JSONResponse
2424
from fastapi.staticfiles import StaticFiles
2525
from pydantic.error_wrappers import ValidationError
2626

bookserver/routers/assessment.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,17 @@ async def get_assessment_results(
8383
# Otherwise if the user is an instructor then use the provided
8484
# sid (it could be any student in the class). If none is provided then
8585
# use the user objects username
86+
sid = ""
8687
if await is_instructor(request):
8788
if not request_data.sid:
88-
request_data.sid = user.username
89+
sid = user.username
8990
else:
9091
if request_data.sid:
9192
# someone is attempting to spoof the api
9293
return make_json_response(
9394
status=status.HTTP_401_UNAUTHORIZED, detail="not an instructor"
9495
)
95-
request_data.sid = user.username
96+
sid = user.username
9697

9798
row = await fetch_last_answer_table_entry(request_data)
9899
# mypy complains that ``row.id`` doesn't exist (true, but the return type wasn't exact and this does exist).
@@ -109,9 +110,7 @@ async def get_assessment_results(
109110
ret.update(await rcd.grader(row, feedback))
110111

111112
# get grade and instructor feedback if Any
112-
grades = await fetch_question_grade(
113-
request_data.sid, request_data.course, request_data.div_id
114-
)
113+
grades = await fetch_question_grade(sid, request_data.course, request_data.div_id)
115114
if grades:
116115
ret["comment"] = grades.comment
117116
ret["score"] = grades.score

0 commit comments

Comments
 (0)