Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 107

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 234

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 235

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 236

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 237

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 238

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 239
* @link https://themeum.com * @since 1.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; } use Tutor\Models\QuizModel; $enabled_hide_quiz_details = tutor_utils()->get_option( 'hide_quiz_details' ); if ( ! is_admin() && ! current_user_can( 'tutor_instructor' ) && true === $enabled_hide_quiz_details ) { exit; } //phpcs:ignore extract( $data ); // $user_id, $attempt_id, $attempt_data(nullable), $context(nullable) ! isset( $attempt_data ) ? $attempt_data = tutor_utils()->get_attempt( $attempt_id ) : 0; ! isset( $context ) ? $context = null : 0; if ( ! $attempt_id || ! $attempt_data || $user_id != $attempt_data->user_id ) { tutor_utils()->tutor_empty_state( __( 'Attempt not found or access permission denied', 'tutor' ) ); return; } if ( isset( $user_id ) && $user_id > 0 ) { $user = get_userdata( $user_id ); if ( ! $user ) { return; } } /** * Render answer list * * @param array $answers answers. * @param boolean $dump_data dump data. * * @return void */ function tutor_render_answer_list( $answers = array(), $dump_data = false ) { if ( ! empty( $answers ) ) { echo '
'; $multi_texts = array(); foreach ( $answers as $key => $ans ) { $type = isset( $ans->answer_view_format ) ? $ans->answer_view_format : 'text_image'; if ( isset( $ans->answer_two_gap_match ) ) { echo '
'; } switch ( $type ) { case 'text_image': echo '
'; if ( isset( $ans->image_id ) ) { $img_url = wp_get_attachment_image_url( $ans->image_id ); if ( $img_url ) { echo ''; } } if ( isset( $ans->answer_title ) ) { echo '' . esc_html( stripslashes( $ans->answer_title ) ) . ''; } echo '
'; break; case 'text': $ans_string = '' . esc_html( stripslashes( $ans->answer_title ) ) . ''; if ( isset( $ans->answer_title ) && ! isset( $ans->answer_two_gap_match ) ) { $multi_texts[ $ans->answer_title ] = $ans_string; } else { echo $ans_string; //phpcs:ignore -- contain safe data } break; case 'image': echo '
'; if ( isset( $ans->image_id ) ) { $img_url = wp_get_attachment_image_url( $ans->image_id ); if ( $img_url ) { echo ' '; } } echo '
'; break; } if ( isset( $ans->answer_two_gap_match ) ) { echo '
' . esc_html( stripslashes( $ans->answer_two_gap_match ) ) . '
'; echo '
'; } } //phpcs:ignore echo count( $multi_texts ) ? implode( ', ', wp_unslash( $multi_texts ) ) : ''; echo '
'; } } /** * Render fill in the blank answer * * @param mixed $get_db_answers_by_question get db answers by question. * @param mixed $answer_titles ans titles. * * @return void */ function tutor_render_fill_in_the_blank_answer( $get_db_answers_by_question, $answer_titles ) { $spaces = '        '; // Loop through the answers. foreach ( $get_db_answers_by_question as $db_answer ) { $count_dash_fields = substr_count( $db_answer->answer_title, '{dash}' ); if ( $count_dash_fields ) { $dash_string = array(); $input_data = array(); for ( $i = 0; $i < $count_dash_fields; $i++ ) { $ans_title = ( ! empty( $answer_titles[ $i ] ) && ! ctype_space( $answer_titles[ $i ] ) ) ? $answer_titles[ $i ] : null; $input_data[] = $ans_title ? "{$ans_title}" : $spaces; } $answer_title = $db_answer->answer_title; foreach ( $input_data as $index => $replace ) { $replace = '' . $replace . ''; $answer_title = preg_replace( '/{dash}/i', $replace, $answer_title, 1 ); } echo wp_kses( str_replace( '{dash}', "{$spaces}", stripslashes( $answer_title ) ), array( 'span' => array( 'style' => true, 'class' => true, ), ) ); } } } // Prepare student data. if ( ! isset( $user_data ) ) { $user_data = get_userdata( $user_id ); } // Prepare attempt meta info. extract( QuizModel::get_quiz_attempt_timing( $attempt_data ) ); // $attempt_duration, $attempt_duration_taken; // Prepare the correct/incorrect answer count for the first summary table. $answers = QuizModel::get_quiz_answers_by_attempt_id( $attempt_id ); $correct = 0; $incorrect = 0; if ( is_array( $answers ) && count( $answers ) > 0 ) { foreach ( $answers as $answer ) { if ( (bool) isset( $answer->is_correct ) ? $answer->is_correct : '' ) { $correct++; } elseif ( 'open_ended' === $answer->question_type || 'short_answer' === $answer->question_type ) { } else { $incorrect++; } } } // Prepare the column list for the first summary table. $page_key = 'attempt-details-summary'; $table_1_columns = include __DIR__ . '/contexts.php'; // Prepare the column list for the second table (eery single answer list). $page_key = 'attempt-details-answers'; $table_2_columns = include __DIR__ . '/contexts.php'; require __DIR__ . '/header.php'; $attempt_info = @unserialize( $attempt_data->attempt_info ); if ( is_array( $attempt_info ) ) { $attempt_type = ''; // Allowed duration. if ( isset( $attempt_info['time_limit'] ) ) { $attempt_duration = tutor_utils()->second_to_formated_time( $attempt_info['time_limit']['time_limit_seconds'], $attempt_info['time_limit']['time_type'] ); } if ( 'days' === $attempt_info['time_limit']['time_type'] ) { $attempt_type = 'hours'; } if ( 'hours' === $attempt_info['time_limit']['time_type'] ) { $attempt_type = 'minutes'; } if ( 'minutes' === $attempt_info['time_limit']['time_type'] ) { $attempt_type = 'minutes'; } // Taken duration. $seconds = strtotime( $attempt_data->attempt_ended_at ) - strtotime( $attempt_data->attempt_started_at ); $attempt_duration_taken = tutor_utils()->second_to_formated_time( $seconds, $attempt_type ); } ?> ' : ''; ?>
$column ) : ?> $column ) : ?>
get_tutor_avatar( $user_id ), tutor_utils()->allowed_avatar_tags() ); ?>
display_name : '' ); ?>
attempt_started_at ) ) ); ?> total_questions ); ?> total_marks ); ?> earned_marks ); $earned_percentage = $attempt_data->earned_marks > 0 ? ( number_format( ( $attempt_data->earned_marks * 100 ) / $attempt_data->total_marks ) ) : 0; echo esc_html( ' (' . $earned_percentage . '%)' ); ?> is_correct; } ) ); if ( $has_pending ) { echo '' . esc_html__( 'Pending', 'tutor' ) . ''; } elseif ( $earned_percentage >= $pass_mark_percent ) { echo '' . esc_html__( 'Pass', 'tutor' ) . ''; } else { echo '' . esc_html__( 'Fail', 'tutor' ) . ''; } ?>
query_vars; $page_name = isset( $query_vars['tutor_dashboard_page'] ) ? $query_vars['tutor_dashboard_page'] : ''; $attempt_info = unserialize( $attempt_data->attempt_info ); $feedback = is_array( $attempt_info ) && isset( $attempt_info['instructor_feedback'] ) ? $attempt_info['instructor_feedback'] : ''; // don't show on instructor quiz attempt since below already have feedback box area. if ( '' !== $feedback && 'my-quiz-attempts' === $page_name ) { ?>
' . esc_html__( 'Quiz Overview', 'tutor' ) . '' : ''; ?>
$column ) : ?> get_question_types( $answer->question_type ); $question_settings = maybe_unserialize( $answer->question_settings ); $is_image_matching = isset( $question_settings['is_image_matching'] ) && '1' === $question_settings['is_image_matching']; $answer_status = 'wrong'; // If already correct, then show it. if ( (bool) $answer->is_correct ) { $answer_status = 'correct'; } // Image answering also needs review since the answer texts are not meant to match exactly. elseif ( in_array( $answer->question_type, array( 'open_ended', 'short_answer', 'image_answering' ), true ) ) { $answer_status = null === $answer->is_correct ? 'pending' : 'wrong'; } ?> $column ) : ?>
get_question_types( $answer->question_type ); ?>
question_type ) { ?> image/svg+xml allowed_icon_tags() ); } ?> question_type ) { echo esc_html( 'H5P' ); } else { echo esc_html( $type['name'] ?? '' ); } ?>
question_title ) ); ?>
question_type ) { $get_answers = tutor_utils()->get_answer_by_id( $answer->given_answer ); tutor_render_answer_list( $get_answers ); } // True false or single choice. if ( 'true_false' === $answer->question_type ) { $get_answers = tutor_utils()->get_answer_by_id( $answer->given_answer ); $answer_titles = wp_list_pluck( $get_answers, 'answer_title' ); $answer_titles = array_map( 'stripslashes', $answer_titles ); echo '' . implode( '

', $answer_titles ) . //phpcs:ignore ''; } // Multiple choice. elseif ( 'multiple_choice' === $answer->question_type ) { $get_answers = tutor_utils()->get_answer_by_id( maybe_unserialize( $answer->given_answer ) ); tutor_render_answer_list( $get_answers ); } // Fill in the blank. elseif ( 'fill_in_the_blank' === $answer->question_type ) { $answer_titles = maybe_unserialize( $answer->given_answer ); $get_db_answers_by_question = QuizModel::get_answers_by_quiz_question( $answer->question_id ); echo tutor_render_fill_in_the_blank_answer( $get_db_answers_by_question, $answer_titles ); //phpcs:ignore --contain safe data } // Open ended or short answer. elseif ( 'open_ended' === $answer->question_type || 'short_answer' === $answer->question_type ) { if ( $answer->given_answer ) { echo wp_kses( wpautop( stripslashes( $answer->given_answer ) ), array( 'p' => true, 'span' => true, ) ); } } // Ordering. elseif ( 'ordering' === $answer->question_type ) { $ordering_ids = maybe_unserialize( $answer->given_answer ); foreach ( $ordering_ids as $ordering_id ) { $get_answers = tutor_utils()->get_answer_by_id( $ordering_id ); tutor_render_answer_list( $get_answers ); } } // Matching. elseif ( 'matching' === $answer->question_type ) { $ordering_ids = maybe_unserialize( $answer->given_answer ); $original_saved_answers = QuizModel::get_answers_by_quiz_question( $answer->question_id ); $answers = array(); foreach ( $original_saved_answers as $key => $original_saved_answer ) { $provided_answer_order_id = isset( $ordering_ids[ $key ] ) ? $ordering_ids[ $key ] : 0; $provided_answer_order = tutor_utils()->get_answer_by_id( $provided_answer_order_id ); if ( tutor_utils()->count( $provided_answer_order ) ) { foreach ( $provided_answer_order as $provided_answer_order ) { if ( $is_image_matching ) { $original_saved_answer->answer_view_format = 'text_image'; $original_saved_answer->answer_title = $provided_answer_order->answer_title; $original_saved_answer->answer_two_gap_match = ''; $answers[] = $original_saved_answer; } else { $original_saved_answer->answer_two_gap_match = $provided_answer_order->answer_two_gap_match; $answers[] = $original_saved_answer; } } } } tutor_render_answer_list( $answers ); } elseif ( 'image_matching' === $answer->question_type ) { $ordering_ids = maybe_unserialize( $answer->given_answer ); $original_saved_answers = QuizModel::get_answers_by_quiz_question( $answer->question_id ); $answers = array(); foreach ( $original_saved_answers as $key => $original_saved_answer ) { $provided_answer_order_id = isset( $ordering_ids[ $key ] ) ? $ordering_ids[ $key ] : 0; $provided_answer_order = tutor_utils()->get_answer_by_id( $provided_answer_order_id ); foreach ( $provided_answer_order as $p_answer ) { if ( $p_answer->answer_title ) { $original_saved_answer->answer_view_format = 'text_image'; $original_saved_answer->answer_title = $p_answer->answer_title; $answers[] = $original_saved_answer; } } } tutor_render_answer_list( $answers ); } elseif ( 'image_answering' === $answer->question_type ) { $ordering_ids = maybe_unserialize( $answer->given_answer ); $answers = array(); foreach ( $ordering_ids as $answer_id => $image_answer ) { $db_answers = tutor_utils()->get_answer_by_id( $answer_id ); foreach ( $db_answers as $db_answer ) { } $db_answer->answer_title = $image_answer; $db_answer->answer_view_format = 'text_image'; $answers[] = $db_answer; } tutor_render_answer_list( $answers ); } ?>

question_type != 'open_ended' && $answer->question_type != 'short_answer' ) ) { global $wpdb; // True false. if ( 'true_false' === $answer->question_type ) { $correct_answer = $wpdb->get_var( $wpdb->prepare( "SELECT answer_title FROM {$wpdb->prefix}tutor_quiz_question_answers WHERE belongs_question_id = %d AND belongs_question_type='true_false' AND is_correct = 1", $answer->question_id ) ); echo '' . esc_html( $correct_answer ) . ''; } // Single choice. elseif ( 'single_choice' === $answer->question_type ) { $correct_answer = $wpdb->get_results( $wpdb->prepare( "SELECT answer_title, image_id, answer_view_format FROM {$wpdb->prefix}tutor_quiz_question_answers WHERE belongs_question_id = %d AND belongs_question_type='single_choice' AND is_correct = 1", $answer->question_id ) ); tutor_render_answer_list( $correct_answer ); } // Multiple choice. elseif ( 'multiple_choice' === $answer->question_type ) { $correct_answer = $wpdb->get_results( $wpdb->prepare( "SELECT answer_title, image_id, answer_view_format FROM {$wpdb->prefix}tutor_quiz_question_answers WHERE belongs_question_id = %d AND belongs_question_type='multiple_choice' AND is_correct = 1 ;", $answer->question_id ) ); tutor_render_answer_list( $correct_answer ); } // Fill in the blanks. elseif ( 'fill_in_the_blank' === $answer->question_type ) { $correct_answer = $wpdb->get_var( $wpdb->prepare( "SELECT answer_two_gap_match FROM {$wpdb->prefix}tutor_quiz_question_answers WHERE belongs_question_id = %d AND belongs_question_type='fill_in_the_blank'", $answer->question_id ) ); $answer_titles = explode( '|', stripslashes( $correct_answer ) ); $get_db_answers_by_question = QuizModel::get_answers_by_quiz_question( $answer->question_id ); echo tutor_render_fill_in_the_blank_answer( $get_db_answers_by_question, $answer_titles ); //phpcs:ignore --contain safe data } // Ordering. elseif ( 'ordering' === $answer->question_type ) { $correct_answer = $wpdb->get_results( $wpdb->prepare( "SELECT answer_title, image_id, answer_view_format FROM {$wpdb->prefix}tutor_quiz_question_answers WHERE belongs_question_id = %d AND belongs_question_type='ordering' ORDER BY answer_order ASC;", $answer->question_id ) ); foreach ( $correct_answer as $ans ) { tutor_render_answer_list( array( $ans ) ); } } // Matching. elseif ( 'matching' === $answer->question_type ) { $correct_answer = $wpdb->get_results( $wpdb->prepare( "SELECT answer_title, image_id, answer_two_gap_match, answer_view_format FROM {$wpdb->prefix}tutor_quiz_question_answers WHERE belongs_question_id = %d AND belongs_question_type='matching' ORDER BY answer_order ASC;", $answer->question_id ) ); if ( $is_image_matching ) { array_map( function( $ans ) { $ans->answer_view_format = 'text_image'; $ans->answer_two_gap_match = ''; }, $correct_answer ); } tutor_render_answer_list( $correct_answer ); } // Image matching. elseif ( 'image_matching' === $answer->question_type ) { $correct_answer = $wpdb->get_results( $wpdb->prepare( "SELECT answer_title, image_id, answer_two_gap_match FROM {$wpdb->prefix}tutor_quiz_question_answers WHERE belongs_question_id = %d AND belongs_question_type='image_matching' ORDER BY answer_order ASC;", $answer->question_id ) ); tutor_render_answer_list( $correct_answer, true ); } // Image Answering. elseif ( 'image_answering' === $answer->question_type ) { $correct_answer = $wpdb->get_results( $wpdb->prepare( "SELECT answer_title, image_id, answer_two_gap_match FROM {$wpdb->prefix}tutor_quiz_question_answers WHERE belongs_question_id = %d AND belongs_question_type='image_answering' ORDER BY answer_order ASC;", $answer->question_id ) ); ! is_array( $correct_answer ) ? $correct_answer = array() : 0; echo '
'; foreach ( $correct_answer as $image_answer ) { ?>

answer_title ); ?>

'; } } ?>
question_type ) { switch ( $answer_status ) { case 'correct': echo '' . esc_html__( 'Correct', 'tutor' ) . ''; break; case 'pending': echo '' . esc_html__( 'Pending', 'tutor' ) . ''; break; case 'wrong': echo '' . esc_html__( 'Incorrect', 'tutor' ) . ''; break; } } ?>
' : ''; ?>