diff --git a/app/routers/reports.py b/app/routers/reports.py index ec768bb..bb3e568 100644 --- a/app/routers/reports.py +++ b/app/routers/reports.py @@ -2,6 +2,7 @@ from fastapi.templating import Jinja2Templates from fastapi import HTTPException from collections import OrderedDict +from urllib.parse import unquote from models.student_quiz_report import StudentQuizReportController @@ -46,6 +47,10 @@ def student_quiz_report(request: Request, session_id: str, user_id: str): status_code=400, detail="Session ID and User ID have to be specified", ) + # decoding URL encoded values. As this information is coming through a URL, + # it's possible that the strings are URL encoded. + session_id = unquote(session_id) + user_id = unquote(user_id) try: data = self.__student_quiz_reports_controller.get_student_quiz_report( session_id=session_id, user_id=user_id