Skip to content

Conversation

@ahmad0509
Copy link
Collaborator

Summary of changes:

  • Added an endpoint in student_quiz_reports.py to list students and their marks by session ID.
    -Test using reports/session_students/{session_id}

@ahmad0509 ahmad0509 requested a review from suryabulusu April 23, 2025 16:38
try:
table = self.__db.Table("student_quiz_reports")
all_items = []
last_evaluated_key = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this variable for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Earlier I used a simple query approach, but that was returning incomplete list of students for many session id's that I tested with. I searched and figured out that this a pagination issue. So, I used the pagination approach as mentioned here: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.Pagination.html

# urllib3==1.26.10
# uvicorn==0.18.2
# virtualenv==20.24.5
annotated-types
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? Let's not mess with requirements.txt

Copy link
Collaborator Author

@ahmad0509 ahmad0509 Apr 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this. I had to add modify some dependencies for running on my local. Failed to remove them

{"request": request, "report_data": report_data},
)

@api_router.get("/session_students/{session_id}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be in student_quiz_reports.py . Move it to session_quiz_reports since it is a session level report.

Also the route should be /session_report, not session_students

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted. Changing this.

"user_id": item["user_id-section"].split("#")[0],
"marks_scored": item.get("marks_scored", 0),
"percentage": item.get("percentage", 0),
"rank": item.get("rank", None),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a report link here too.

Copy link
Collaborator Author

@ahmad0509 ahmad0509 Apr 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have already added links in the html file. The student id links to the individual students reports.

@@ -0,0 +1,129 @@
{% extends "layout.html" %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to session_report.html

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted.

@ahmad0509 ahmad0509 requested a review from pritamps April 25, 2025 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants