PluginProbe
Tutor LMS – eLearning and online course solution / 3.9.14
Tutor LMS – eLearning and online course solution v3.9.14
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 3.9.15 3.9.14 3.9.13 3.9.12 3.9.11 trunk 1.0.0 1.0.0-alpha 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 All 191 releases
tutor / views / quiz / header.php
header.php
43 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Quiz header
4 *
5 * @package Tutor\Views
6 * @subpackage Tutor\Quiz
7 * @author Themeum <support@themeum.com>
8 * @link https://themeum.com
9 * @since 1.0.0
10 */
11
12 // Load header based on context.
13 $file_path = __DIR__ . '/header-context/' . $context . '.php';
14 if ( $context && file_exists( $file_path ) ) {
15 // Prepare header data.
16 $course_title = get_the_title( $attempt_data->course_id );
17 $course_url = get_permalink( $attempt_data->course_id );
18
19 $quiz_title = get_the_title( $attempt_data->quiz_id );
20 $quiz_url = get_permalink( $attempt_data->quiz_id );
21
22 $user_data = get_userdata( $attempt_data->user_id );
23 $student_name = $user_data->display_name;
24 $student_url = '#';
25
26 //phpcs:ignore
27 extract( \Tutor\Models\QuizModel::get_quiz_attempt_timing( $attempt_data ) ); // $attempt_duration, $attempt_duration_taken;
28
29 $quiz_time = $attempt_duration;
30 $attempt_time = $attempt_duration_taken;
31
32 $question_count = $attempt_data->total_questions;
33 $total_marks = $attempt_data->total_marks;
34 $earned_marks = $attempt_data->earned_marks;
35 $unserialize_attempt = maybe_unserialize( $attempt_data->attempt_info );
36 $pass_marks = '';
37 $passing_grade = isset( $unserialize_attempt['passing_grade'] ) ? $unserialize_attempt['passing_grade'] : 0;
38 $back_url = isset( $back_url ) ? $back_url : ( isset( $_GET['view_quiz_attempt_id'] ) ? remove_query_arg( 'view_quiz_attempt_id', is_admin() ? admin_url( 'admin.php?page=tutor_quiz_attempts' ) : tutor()->current_url ) : null );
39
40 include $file_path;
41 }
42
43