From 21204d2682ceb9b618e2b737f3a674fc572695cf Mon Sep 17 00:00:00 2001 From: Ruben Ramirez Date: Fri, 4 Apr 2025 08:04:40 -0500 Subject: [PATCH] Updated quiztech-assessment-platform/public/templates/assessment-shell.php to fix the incorrect meta key (_quiztech_question_type) and align the question type handling in the switch statement with the types defined in QuestionMetaboxes.php (textarea, text, multiple-choice, checkbox, numeric) --- public/templates/assessment-shell.php | 44 +++++++++++++++++++++------ 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/public/templates/assessment-shell.php b/public/templates/assessment-shell.php index c6108ea..5dcfce3 100644 --- a/public/templates/assessment-shell.php +++ b/public/templates/assessment-shell.php @@ -156,7 +156,7 @@ $show_pre_screening = ! empty( $pre_screening_questions ) && is_array( $pre_scre } $question_title = get_the_title( $question_post ); $question_content = apply_filters('the_content', $question_post->post_content); // Get question content - $question_type = get_post_meta( $question_id, 'question_type', true ); + $question_type = get_post_meta( $question_id, '_quiztech_question_type', true ); // CORRECTED META KEY $is_first_question = ( $index === 0 ); // Check if it's the first question ?>
+ case 'textarea': // Changed from 'text' to match metabox 'Text Area (Multi-line)' ?> - + + + + + $choice_text ) : $choice_value = esc_attr( $choice_text ); // Use text as value for simplicity @@ -200,13 +204,35 @@ $show_pre_screening = ! empty( $pre_screening_questions ) && is_array( $pre_scre - -
- + + $choice_text ) : + $choice_value = esc_attr( $choice_text ); // Use text as value for simplicity + $choice_id = 'choice_' . esc_attr( $question_id ) . '_' . esc_attr( $choice_index ); + ?> +
+ + +

+ - -

+ + + + + + + +