header-context
4 years ago
attempt-details.php
4 years ago
attempt-table.php
4 years ago
contexts.php
4 years ago
header.php
4 years ago
instructor-feedback.php
4 years ago
header.php
31 lines
| 1 | <?php |
| 2 | // Load header based on context |
| 3 | if ( $context && file_exists( $file_path = __DIR__ . '/header-context/' . $context . '.php' ) ) { |
| 4 | // Prepare header data |
| 5 | $course_title = get_the_title( $attempt_data->course_id ); |
| 6 | $course_url = get_permalink( $attempt_data->course_id ); |
| 7 | |
| 8 | $quiz_title = get_the_title( $attempt_data->quiz_id ); |
| 9 | $quiz_url = get_permalink( $attempt_data->quiz_id ); |
| 10 | |
| 11 | $user_data = get_userdata( $attempt_data->user_id ); |
| 12 | $student_name = $user_data->display_name; |
| 13 | $student_url = '#'; |
| 14 | |
| 15 | extract( tutor_utils()->get_quiz_attempt_timing( $attempt_data ) ); // $attempt_duration, $attempt_duration_taken; |
| 16 | |
| 17 | $quiz_time = $attempt_duration; |
| 18 | $attempt_time = $attempt_duration_taken; |
| 19 | |
| 20 | $question_count = $attempt_data->total_questions; |
| 21 | $total_marks = $attempt_data->total_marks; |
| 22 | $earned_marks = $attempt_data->earned_marks; |
| 23 | $unserialize_attempt = unserialize( $attempt_data->attempt_info ); |
| 24 | $pass_marks = ''; |
| 25 | $passing_grade = isset( $unserialize_attempt['passing_grade'] ) ? $unserialize_attempt['passing_grade'] : 0; |
| 26 | $back_url = isset( $back_url ) ? $back_url : ( isset( $_GET['view_quiz_attempt_id'] ) ? remove_query_arg( 'view_quiz_attempt_id', tutor()->current_url ) : null ); |
| 27 | |
| 28 | include $file_path; |
| 29 | } |
| 30 | |
| 31 |