Class-scoped students, unified quiz editor, select fix, deps - #39
Merged
Conversation
- Bump version of `shadcn` to 3.8.4. - Update `@ianvs/prettier-plugin-sort-imports` to 4.7.1. - Upgrade `@tailwindcss/postcss` to 4.1.18. - Update `@types/node` to 20.19.33, `@types/react` to 19.2.13, and `@types/react-dom` to 19.2.3. - Upgrade `eslint` to 9.39.2 and `typescript` to 5.9.3. - Update `express` and `express-rate-limit` versions in bun.lock for improved functionality and security.
## Summary Refactors the quiz editor flow by unifying quiz details, question editing, and JSON import into a single **QuizEditorForm**, and adds bulk JSON import plus UX improvements. ## What changed - **QuizEditorForm** - Single “Quiz Builder” card now holds title, description, questions, and **Import from JSON** in one place. - **Bulk import**: JSON can be a single quiz object or an array of quizzes; multiple quizzes are merged into the current draft with clear feedback. - Validation and error handling for JSON import improved (parse errors, invalid shape) with toast and inline messages. - Optional **description** field for quizzes added; state and app reducer updated accordingly. - Height tracking on the builder card for more consistent layout. - **QuizImportCard removed** - Its behavior is folded into `QuizEditorForm`; no separate import step. - **App store / reducer** - New actions and state for quiz description; tests added in `context/__tests__/app-reducer.test.ts`. - **Other** - `quiz-editor-skeleton` and loading behavior updated for better loading feedback. - Docs: `components.md` and `routes.md` updated for the new flow. - `lib/models`, `lib/type-guards`, and `lib/page-info` updated as needed for descriptions and quiz shape. ## Why - One place to edit quiz metadata and questions and to import JSON reduces context switching and simplifies the UI. - Bulk import from JSON arrays supports faster setup when migrating or creating many quizzes. - Clear validation and errors make import failures easier to fix. ## Tests - **QuizEditorForm** (`components/quizzes/__tests__/quiz-editor-form.test.tsx`): Renders unified builder, imports valid JSON (single and array), shows errors for invalid JSON, and verifies “Save Quiz” behavior. - **App reducer** (`context/__tests__/app-reducer.test.ts`): Covers student and quiz actions (including description); existing tests extended/added as needed. No additional E2E tests: changes are form and state logic covered by the above unit tests. ## Checklist - [x] Changes limited to quiz editor refactor and related state/docs (no unrelated features). - [x] Tests added/updated for new and touched behavior. - [x] Documentation updated where the flow or components changed.
# Enhance student and class management features ## Summary This PR refactors student and class handling so that students are consistently **class-scoped**. Class selection is integrated across student management, generator, breakout rooms, projects, and quiz play. The app state and storage layer are updated to support class-scoped rosters and a shared class selector. ## What changed - **Class-scoped students**: Students are associated with a class. The active class is selected via a shared **ClassSelector**; all student operations (add, edit, import, view) apply to the selected class. - **New `lib/classes.ts`**: Utilities for class names (normalize, key, parse), and for parsing class import text (`Class Name: Student A, Student B`). - **ClassSelector component** (`components/classes/class-selector.tsx`): Reusable dropdown for choosing the active class; used on `/students`, `/generator`, `/breakout-rooms`, `/projects`, and `/play`. - **Student form & table**: Refactored to work with the selected class (create/edit/delete scoped to that class). Student table and form UI/layout improved for responsiveness. - **App store & storage**: State and persistence updated for class-based rosters; storage API and type guards adjusted accordingly. - **Feature parity**: Generator, breakout groups, project lists, and quiz play all use the active class from the class selector. - **Docs**: README and project docs updated for class-scoped flows and usage examples. ## Why - **Single source of truth**: One active class drives all features that use students. - **Clearer UX**: Users pick a class once and all tools (draw, breakout, projects, play) use that class’s roster. - **Consistent data model**: Students and classes are modeled and stored in a consistent way for future features. ## Tests - **Updated**: `context/__tests__/app-reducer.test.ts`, `components/students/__tests__/student-form.test.tsx`, `lib/__tests__/storage.test.ts`, `lib/__tests__/type-guards.test.ts` to match new state shape and class-scoped behavior. - **Added**: `lib/__tests__/classes.test.ts` for `lib/classes.ts` (normalize, parse, import parsing). - No new tests were skipped; existing coverage was adjusted for the refactor. ## Checklist - [x] Students are class-scoped; ClassSelector used where needed. - [x] Storage and app state support class-scoped rosters. - [x] Tests updated/added; `lib/classes` covered. - [x] README and project docs updated.
Summary - normalize the shared `SelectContent` default so option popups size to their content while keeping the override prop for trigger-aligned behavior, and document it alongside new tests - pass `package.json`’s version through `layout.tsx` into `AppShell` so the sidebar label becomes `v1.1.5` without hardcoding and bump the package version accordingly - add the new 1.1.5 changelog entry and refresh component docs to cover the select behavior update
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What changes and why
This PR brings
devup to date withmainby merging five commits that deliver class-scoped student management, a unified quiz editor with bulk JSON import, select dropdown and version display fixes, and dependency updates.Class-scoped students (Enhance student and class management features #37)
Students are now associated with a class. A shared ClassSelector lets users pick the active class; all student operations (add, edit, import, view) and features (generator, breakout rooms, projects, quiz play) use that class’s roster. This gives a single source of truth and clearer UX.
Unified quiz editor + bulk JSON import (Refactor: unified quiz editor with bulk JSON import #36)
Quiz details, question editing, and JSON import live in one QuizEditorForm. Support for importing a single quiz or an array of quizzes (bulk merge) was added, with better validation and error handling. The separate quiz import card was removed.
Select dropdown and version display (Fix select dropdown sizing and auto-version display #38)
Shared
SelectContentdefaults to content-fit sizing with an override for trigger-aligned behavior; tests and docs were added. App version is read frompackage.jsonand shown in the sidebar (e.g.v1.1.5) instead of being hardcoded.Other
Question list card behavior was adjusted; dependencies and versions were updated (e.g. shadcn, Prettier sort imports, Tailwind PostCSS, TypeScript, ESLint, express).
Related issues
Scope
Focused on the above feature and fix set. No unrelated changes.
Tests
lib/__tests__/classes.test.ts,components/quizzes/__tests__/quiz-editor-form.test.tsx,components/ui/__tests__/select.test.tsx.context/__tests__/app-reducer.test.ts,components/students/__tests__/student-form.test.tsx,lib/__tests__/storage.test.ts,lib/__tests__/type-guards.test.tsfor class-scoped state and new behavior.