Ethan's 5th PR / Jose's 9th PR: (#182) Assignment & Quiz Backend Frontend Link#184
Ethan's 5th PR / Jose's 9th PR: (#182) Assignment & Quiz Backend Frontend Link#184
Conversation
…nction and add logic to jsx.
…r increment option
…nd it works on mock Data.
…orm for adding a question.
…is is used within the connecting/linking
… CSS. Also created a frontend edit quiz form, using Jose's structure and CSS. Linked quiz with backend & created a QuizServices file.
…estion view (added a way to update & delete a question). Also linked question backend model/views.
…ile to help connect.
…ices to help connect.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #184 +/- ##
=======================================
Coverage 81.16% 81.16%
=======================================
Files 17 17
Lines 775 775
Branches 51 51
=======================================
Hits 629 629
Misses 123 123
Partials 23 23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ed but never used.
Assignment & Quiz Backend–Frontend IntegrationProvide Axios/API Endpoint Guidance and UI Enhancements for AssignmentCreate OverviewThis PR focuses on bridging the frontend-backend collaboration for the AssignmentCreate component by providing guidance on Axios usage and API endpoint integration. In addition, several UI enhancements were made to improve user interaction and prepare the component for seamless backend connectivity. Key Features & Changes
Why This Is Needed
Related Issue🔗https://github.com//issues/182 Implementation Details
How to Test This PR
Files Added/Modified
AI Code UsageYes — 2 Minimal Checklist for Reviewers
Special Contribution Note🔔 Major Contribution: 🙏 Special Thanks: Next Steps & Future Enhancements
Final NotesThank you for reviewing! Please leave any comments or feedback if adjustments are needed. Author: Jose Alarcon |
aviendha-andrus
left a comment
There was a problem hiding this comment.
🔍 Peer Review: Great Job on This PR!
Hey Ethan and Jose! 👋 — just finished reviewing your PR titled "Assignment & Quiz Backend–Frontend Integration". Here’s my feedback:
✅ What Looks Great
- The core feature (Assignment & Quiz integration) has been implemented cleanly — functionality aligns perfectly with Issue #182 - Create Frontend Services for Assignment and Quiz API Integration.
- Really appreciate the service abstraction — creating modular
Service.jsfiles makes future maintenance and expansion much easier. - Your backend adjustments (new views, URLs, tests) are lightweight, well-placed, and don’t introduce unnecessary complexity.
- The PR description is excellent — the detailed testing instructions and file change breakdown are super helpful for reviewers.
- Great job making the UX smooth: intuitive navigation ("Back" buttons), proper form validation, truncated text previews, etc.
- Backend logic looks excellently transitioned to a frontend environment
💡 Suggestions for Improvement
- Consider adding a sidebar that has all the view/manage quiz options on it. While it makes sense to traverse view/manage quiz -> manage questions -> create questions -> add solution, it gets a bit lengthy. A drop down menu might be a bit easier to navigate for quick fixes.
- Frontend appearance looks a little too much like plain datasets, perfect for an initial development, but eventually maybe the ID doesn't have to be displayed, or the information can be displayed in a usable layout.
- I feel like the solution logic might need more work, as you can only edit the question but not the solution.
🧪 Tested This Feature
I ran the following test steps:
- ✅ Launched both backend and frontend successfully.
- ✅ Logged in as an Admin/Tutor (tested user creation flow via Django Admin).
- ✅ Navigated to
/tutor/assignment_create. - ✅ Verified Assignment creation, listing, editing, and deletion.
- ✅ Verified "Manage Quiz" functionality — created quizzes, edited quiz info, and linked questions/choices/solutions.
- ✅ Verified state changes (e.g., loading indicators) and correct API requests.
- ✅ Checked responsiveness and proper JWT authentication headers.
Everything worked smoothly! 🚀
🔄 Next Steps
- Once choice/solution deletion UIs are added, make sure those new features update the frontend state immediately after a successful DELETE call.
- Brainstorm layout so that it is more accessible
🚀 Final Thoughts
This is absolutely fantastic! I'm really impressed, this was a big task and a lot went into it, great job!
SameerIssa
left a comment
There was a problem hiding this comment.
Peer Review: Great Job on This PR!
Hey Ethan and Jose — just finished reviewing your PR titled "Assignment & Quiz Backend–Frontend Integration". Here’s my feedback:
What Looks Great
- The core feature has been implemented cleanly — functionality aligns with the related issue.
- Extremely well-structured and modular service layer abstractions for Assignments, Quizzes, Questions, Choices, and Solutions.
- Love the attention to UI/UX details — loading states, navigation back buttons, and dynamic form handling make the flow intuitive.
- Your component structure and modularity make the codebase very scalable and easy to maintain.
- Backend updates were smartly scoped, permission checks (
IsAdminOrTutor) were added appropriately, and API endpoints were expanded without introducing breaking changes. - The PR description is thorough — clearly walks through the purpose, changes, and testing instructions.
Suggestions for Improvement (if any)
- Consider adding success and error toast notifications after create/update/delete operations for even better UX feedback.
- It might be helpful to add slight loading spinners/buttons especially during form submission to prevent double-submit risks.
- Eventually, consider batching Choice and Solution management into combined API endpoints to reduce multiple round trips per save.
- For more complex workflows later, a sequence diagram for the CRUD flow could be helpful during onboarding of new developers.
Tested This Feature
I ran the following test steps:
- Navigated to the Assignment Create page and verified assignment listing worked.
- Created a new assignment and verified backend creation.
- Edited quiz information, questions, choices, and solutions end-to-end.
- Tried deleting questions and verified it removed child choices/solutions.
- Confirmed that JWT auth headers are attached correctly through service layers.
- Resized window, tested UX responsiveness on desktop and mobile.
Everything behaved exactly as expected
Next Steps
- Would be awesome to polish up the UI for deleting Choices and Solutions (currently noted as future work).
- Keep me posted when you implement the enhanced Return Button refactor; I can review that too.
Final Thoughts
Fantastic job on this integration! This is a huge step toward fully operationalizing LessonConnect's assignment/quiz system. The modular design choices will pay off tremendously when scaling to Submissions, Grades, or Rubrics later. Thanks for your detailed, thoughtful work — this was a really strong PR to review, approved!
- Sameer
|
Thanks so much for the thoughtful and detailed review @aviendha-andrus and @SameerIssa. I really appreciate you both taking the time to thoroughly review and test my PR. I completely agree with the points you raised. A more streamlined navigation (like a sidebar or dropdown), cleaner data layouts, and improved solution editing are definitely areas that need more planning and work. Same for the UX polish with loading states, and more immediate frontend updates after DELETE operations. Your suggestions really help validate the next steps I had in mind, especially around brainstorming a more accessible layout and eventually batching Choice/Solution management to make saves more efficient. For now, my focus is on finalizing a stable MVP that gets the core creation, editing, updating, and deletion workflows working. After that, I’ll start layering on these UI/UX refinements and broader architecture improvements you mentioned. Thanks again for the excellent insights. -- Ethan |
Assignment & Quiz Backend–Frontend Integration
Added Frontend Assignment, Quiz, Question, Choices, and Solution Services for API Integration
Overview
What does this PR do?
This PR wires up our LessonConnect frontend components to the Django REST API for Assignments, Quizzes, Questions, Choices and Solutions. It introduces five modular service layers that encapsulate all HTTP calls, updates URL patterns and view logic on the backend, and adds react-side state management for full Create / Read / Update / Delete workflows. I also created a extra 'quiz info' + 'edit quiz form' view from Jose's Frontend structure and CSS. This was done cause of a few missing fields.
Key Features & Changes
What has been added or changed?
✔ Service Abstractions
AssignmentService.js,QuizService.js,QuestionService.js,ChoiceService.js,SolutionService.jsget,create,updateanddeletemethods with automatic JWT header injection✔ React Component Enhancements
AssignmentCreate.jsxnow supports:✔ Backend Updates
AssignmentListView& corresponding URL:AssignmentIsAdminOrTutorpermissions where appropriate✔ State Management & UX
useState+useEffect<input type="number" min />enforcementWhy This Is Needed
What problem does this solve?
This service centralizes all lesson-related API calls, preventing code duplication across components and ensuring consistent authentication handling. With this service, components can easily interact with Assignment, Quiz, Question, Choice, and Solution data without needing to understand the underlying API structure or authentication requirements. Furthermore, this provides a scalable structure, making it easier to add new endpoints (e.g. future “Submissions” or “Grades”).
Related Issue
🔗 This PR addresses [Issue #182 - Create Frontend Services for Assignment and Quiz API Integration]
Implementation Details
How was this feature developed?
IsAuthenticated,IsAdminOrTutoruseStateanduseEffectfor state managementHow to Test This PR
Step-by-step testing guide
http://localhost:5173/)2.1. If you need to make a tutor account head to the Django admin panel (
http://127.0.0.1:8000/admin) and create a user. Then under Users create a profile (http://127.0.0.1:8000/admin/users/profile/) for the user you created and give them the role of a Tutor.http://localhost:5173/tutor/assignment_createFiles Added/Modified
📂 List of important files changed in this PR
Services/AssignmentServices.jsServices/QuizServices.jsServices/QuestionServices.jsServices/ChoiceServices.jsServices/SolutionServices.jsComponents/AssignmentCreate.jsxlessons/views.pylessons/urls.pylessons/tests.pyAI Code Usage
🤖 Was AI-generated code used in this PR?
ChoiceServices.js&SolutionServices.js. Alongside a few helper method implementations inAssignmentCreate.jsx)Checklist for Reviewers
Things to check before approving this PR:
Next Steps & Future Enhancements
What improvements can be made after merging?
Final Notes
Thank you for reviewing! Please leave feedback if you have any suggestions or concerns. Special thanks to @Jose-Alarcon1! As this was a team effort with @Jose-Alarcon1, who was there from the beginning helping with the assignment create frontend scaffolding, CSS, and general feedback.