Skip to content

Conversation

EdJones
Copy link
Contributor

@EdJones EdJones commented Mar 14, 2025

No description provided.

Quizset viewer layout & its integration with quizItem editor.

Also add contributor badge to user widget, a new contributions modal, and a summary of contributions to the user widget.
Quizset viewer layout & its integration with quizItem editor.  Also add contributor badge to user widget
quizSets.js to order quizSets in quiztreeview.
Cursor says this should have broken the editor functions, and offered changes. But none showed up.

This did fix the "Learning Science" quiz set preview.
EdJones added 30 commits April 12, 2025 15:25
updated the CustomDropdown component to add fork buttons for items that aren't owned by the current user. Here are the key changes:
Added fork buttons to:
Pending Review items
Other Draft Items
Permanent Quiz Items
The fork button only appears if the item's userId doesn't match the current user's ID
Added proper styling for the fork button:
Blue background with hover effect
Rounded corners
Proper spacing and alignment
Smooth transitions
Added the handleFork function that:
Prevents the dropdown from closing when clicking the fork button
Calls the store's forkQuizEntry method
Handles errors appropriately
Improved the overall component structure:
Better organization of imports
Proper type definitions
Improved event handling
Better styling organization
Added loading state:
Added isForking ref to track the forking state
Added a loading spinner animation
Disabled the fork button while forking
Changed button text to "Forking..." during the operation
Added success/error feedback:
Added success message that appears after successful fork
Added error message display for failed forks
Both messages appear at the bottom of the dropdown
Improved dropdown behavior:
Reset fork states when opening the dropdown
Automatically close dropdown after successful fork (with a 1.5s delay to show success message)
Properly handle error states without closing the dropdown
Enhanced button styling:
Added disabled state styling
Improved button layout with flex and gap
Added loading spinner animation
Maintained consistent styling across all fork buttons
Added the import for quizEntries from '../data/quiz-items' to access the static quiz entries.
Modified the function to first check the static quizEntries array for the quiz with the given ID.
If found in the static array, it creates a forked entry with the appropriate metadata.
If not found in the static array, it then tries the Firestore collections as before.
Added better error handling and logging throughout the process.
The function now follows this flow:
Check the static quizEntries array first
If not found, check the quizEntries Firestore collection
If not found, check the permanentQuizEntries Firestore collection
If still not found, try searching both collections by integer ID
If the entry is found in any of these locations, create a forked version with appropriate metadata
If not found anywhere, throw an error
added a new section documenting the forking mechanism, which is a crucial part of the system's workflow. The new diagram shows:
The decision point for forking (based on isPermanent)
The fork creation process
The editing workflow for forks
The review and approval process
The merge/rejection paths
modified the saveDraftQuizEntry function to handle both new and existing drafts. Here are the key changes:
Removed the requirement for an existing document ID
Added logic to handle both new and existing drafts:
If there's an existing ID, it updates the document and increments the version
If there's no ID, it creates a new document with version 1
Properly handles the document ID in both cases
Maintains consistent state updates for both the draft and last saved entries
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.

1 participant