Skip to content

Feat: Add quiz type pin image#2363

Merged
shewa12 merged 25 commits into
4.0.0-devfrom
feat/quiz-type-pin-image
Apr 3, 2026
Merged

Feat: Add quiz type pin image#2363
shewa12 merged 25 commits into
4.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.
Comment thread classes/Quiz.php Outdated
Comment thread classes/Quiz.php Outdated
@saadman30 saadman30 marked this pull request as draft March 3, 2026 05:43
saadman30 added 13 commits March 3, 2026 11:57
…ctions and enhance UI elements for pin image questions
- 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.
…include new question type. This change enhances the quiz functionality by adding support for 'pin-image' questions while cleaning up unused templates.
@saadman30 saadman30 marked this pull request as ready for review April 3, 2026 06:03
… and 'pin_image' question types. This change simplifies the quiz functionality by focusing on supported question types and enhancing code maintainability.
Comment thread classes/QuizBuilder.php
$legacy_draw_image_message = __( 'Draw on Image questions are not available when Legacy learning mode is enabled.', 'tutor' );
throw new \Exception( $legacy_draw_image_message );
}
if ( 'pin_image' === $question_type && tutor_utils()->is_legacy_learning_mode() ) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the constant for Quiz Type

@shewa12 shewa12 merged commit de170b6 into 4.0.0-dev Apr 3, 2026
5 of 8 checks passed
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.

4 participants