Repository navigation
Add Assigned Exam feature - #154
Merged
Merged
Conversation
…ructor.html description wording
Copilot
AI
changed the title
[WIP] Add new exam feature for assigned quizzes
Add Assigned Exam feature
Jun 8, 2026
kristofer
marked this pull request as ready for review
June 8, 2026 21:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Transforms the unused Assigned Quizzes concept into a fully functional Assigned Exam system. Admins generate named exams of N random questions (default 30) filtered by category and difficulty level (1/2/3), assign them to students via a unique URL, and view per-student scores in a results table. Students take exams via token URL with live progress tracking and a per-question score breakdown on completion.
Backend
006_assigned_exams): three new tables —exams,exam_assignments,exam_attemptsExam,ExamAssignment,ExamAttempt,ExamStudentResult,ExamStatus,ExamInfo(withAccessTokenfield for student URL generation)ExamRepositoryinterface added toDatabase; implemented by bothSQLiteDBandInMemoryDBapi/exam.go):GenerateExam,ListExams,AssignToStudents,GetStatus,GetAssignedExams,StartExam,SubmitExam,GetCategories/assigned-exams,/exam/start,/exam/submit) and instructor (/instructor/exams/...)Exam generation builds a dynamic SQL query filtering questions by topic category join and difficulty range mapping (Level 1 → easy, Level 2 → medium, Level 3 → hard), then randomly selects up to the requested count:
Answer order is randomized per attempt via
math/rand.Shuffle(auto-seeded in Go 1.20+). Grading computes score as(correct / total) * 100and stores per-question correctness inquestion_results map[string]bool.Frontend
instructor.html: new "Assigned Exams" section — generate form (name + dynamic category checkboxes + difficulty checkboxes + question count), assign form (exam dropdown + student list + URL copy), status table with per-exam "View Scores" drill-down showing each student's completion and scoredashboard.html/dashboard.js: "Assigned Exams" button with pending-count badge; collapsible list with Start/Retake per examexam.html(new): token-based student exam page — requires login, loads questions viaPOST /exam/start, shows all questions with shuffled radio-button answers and a live progress bar, submits viaPOST /exam/submit, renders score with pass/warn/fail coloring and per-question ✅/❌ breakdown