Skip to content

Feat: Add quiz type pin image#2363

Draft
saadman30 wants to merge 35 commits into4.0.0-devfrom
feat/quiz-type-pin-image
Draft

Feat: Add quiz type pin image#2363
saadman30 wants to merge 35 commits into4.0.0-devfrom
feat/quiz-type-pin-image

Conversation

@saadman30
Copy link
Copy Markdown
Collaborator

No description provided.

- Introduced a new question type 'pin_image' to the quiz system, allowing students to drop a pin on an image as an answer.
- Updated the quiz handling logic to support validation and processing of pin coordinates.
- Enhanced the frontend components to include the new pin_image type, ensuring proper rendering and interaction.
- Improved backend handling for pin_image answers, including file path management and answer validation.
- Updated relevant views to display pin submissions and instructor references correctly.
@saadman30 saadman30 self-assigned this Feb 9, 2026
@saadman30 saadman30 added the 4.0.0 Tutor v4.w0w label Feb 9, 2026
…e image handling

- Removed unnecessary field value assignment in PinImage component.
- Enhanced FormPinImage to ensure proper handling of image uploads by checking for the presence of the option before accessing its properties.
- Updated the TutorCore API reference for drawing on images to ensure compatibility with the latest changes.
- Added a TODO comment indicating that the icon for the 'Pin on Image' quiz type is not final, to ensure future updates address this aspect.
@saadman30 saadman30 marked this pull request as ready for review February 17, 2026 09:44
…n image handling

- Removed the add_pin_image_quiz_file_paths_for_deletion method and its associated documentation as it is no longer needed.
- Simplified the process_pin_image_question_answer method by removing unnecessary parameters to streamline its functionality.
- Updated comments for clarity regarding the handling of pin image questions.
- Updated variable names from 'w' and 'h' to 'width' and 'height' for better readability and understanding of their purpose in the FormPinImage component.
- Ensured consistent naming conventions to enhance code maintainability.
@saadman30 saadman30 marked this pull request as draft March 3, 2026 05:43
saadman30 added 13 commits March 3, 2026 11:57
- Introduced a new threshold selection for draw image questions, allowing instructors to set a required coverage percentage.
- Updated the DrawImage component to include a FormSelectInput for threshold options.
- Default threshold value is set to 70% if not specified.
- Enhanced quiz data payload to include draw_image_threshold_percent.
- Adjusted utility functions to handle the new threshold setting appropriately.
…on control

- Refactored the DrawImage component to enhance readability and maintainability.
- Integrated precision control for draw image questions, allowing instructors to set a precision level.
- Updated the FormDrawImage component to accept a new `precisionControl` prop for better modularity.
- Simplified the rendering logic for threshold selection and draw image functionality.
…ctions and enhance UI elements for pin image questions
…w template for rendering and review. Update TypeScript definitions and React component to support drawing features and state management. Add SCSS styles for review display of correct and student masks.
…g. Update quiz ID retrieval logic for better type safety and remove unused inline styles for cleaner code.
…e quiz attempt display. Enhance clarity by eliminating redundant markup related to answer zones and student drawings.
…lors for student mask to a more vibrant red and adjust mask background opacity for better visibility. Ensure student mask style aligns with the correct mask approach for consistency in quiz display.
…and display. Implement logic to show uploaded image or upload prompt based on image URL presence. Update styles for better responsiveness and user interaction.
… and accessibility. Replace Button component with a native button element, enhancing the user experience and aligning with design tokens for consistent styling.
…sses

- Introduced `is_legacy_learning_mode` boolean in TypeScript declarations and configurations.
- Updated `QuestionList` component to conditionally filter question types based on legacy mode.
- Enhanced `Assets` and `QuizBuilder` classes to utilize the new legacy mode setting.
- Implemented a method in `Utils` to check if legacy learning mode is active.
- Updated draw-image question template to handle legacy mode restrictions for question types.
- Added 'Draw on Image' option to the question type options in the QuestionList component.
- Updated the component to include the corresponding label, value, icon, and pro status for the new question type.
- Introduced a new variable to handle 'pin_image' question type in the review answers template.
- This enhancement allows for better handling of different question types during quiz attempts.
- Updated the QuestionList component to filter out both 'Draw on Image' and 'Pin on Image' question types when legacy learning mode is enabled.
- Added exception handling in the QuizBuilder class to throw appropriate messages when attempting to use 'Pin on Image' questions in legacy mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0.0 Tutor v4.w0w

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants