Skip to content

Automatic result calculation for Image answering type quiz#2897

Merged
shewa12 merged 2 commits into
devfrom
image-answering-result
Jul 14, 2026
Merged

Automatic result calculation for Image answering type quiz#2897
shewa12 merged 2 commits into
devfrom
image-answering-result

Conversation

@harunollyo

Copy link
Copy Markdown
Collaborator

Currently, the Image Answering quiz type is treated as a manual review question. However, when creating this quiz type, instructors are required to define the correct answer, which means the system already has the necessary information to evaluate submissions automatically.

This change updates the behavior so that Image Answering quizzes are graded automatically based on the stored correct answer, eliminating the need for manual review for this quiz type.

@harunollyo harunollyo requested a review from shewa12 July 10, 2026 10:02
@harunollyo harunollyo self-assigned this Jul 10, 2026
@harunollyo harunollyo added the 4.0.0 Tutor v4.w0w label Jul 13, 2026
@harunollyo harunollyo changed the base branch from 4.0.0-dev to dev July 13, 2026 06:01
Comment thread classes/Quiz.php
$user_answer = isset( $image_inputs[ $stored_answer->answer_id ] ) ? trim( wp_unslash( $image_inputs[ $stored_answer->answer_id ] ) ) : '';
$correct_answer = trim( wp_unslash( $stored_answer->answer_title ) );

if ( 0 !== strcasecmp( $user_answer, $correct_answer ) ) {

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.

Why compare in a case-insensitive manner?

@shewa12 shewa12 merged commit bc7e466 into dev Jul 14, 2026
10 of 13 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.

2 participants