Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
etchirag committed Oct 4, 2024
1 parent 533a9c5 commit 8169a2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion php/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ function qsm_rest_get_questions( WP_REST_Request $request ) {
$linked_question_ids = array_filter( isset( $question['linked_question'] ) ? explode(',', $question['linked_question']) : array() );
if ( ! empty($linked_question_ids) ) {
$quiz_results = $wpdb->get_results( "SELECT `quiz_id`, `question_id` FROM `{$wpdb->prefix}mlw_questions` WHERE `question_id` IN (" . implode( ',', $linked_question_ids ) . ")" );
foreach ( $quiz_results as $key => $value ) {
foreach ( $quiz_results as $value ) {
if ( ! in_array($value->question_id, $procesed_question_ids) ) {
$quiz_name_in_loop = $wpdb->get_row( $wpdb->prepare( "SELECT quiz_name FROM {$wpdb->prefix}mlw_quizzes WHERE quiz_id = %d", $value->quiz_id ), ARRAY_A );
$quiz_name_in_loop = isset( $quiz_name_in_loop['quiz_name'] ) ? $quiz_name_in_loop['quiz_name'] : '';
Expand Down

0 comments on commit 8169a2d

Please sign in to comment.