-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathQuizAttempts.php
84 lines (74 loc) · 1.07 KB
/
QuizAttempts.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* Handle quiz attempt cache data
*
* @package Tutor\Cache
* @author Themeum <support@themeum.com>
* @link https://themeum.com
* @since 2.0.6
*/
namespace Tutor\Cache;
use Tutor\Cache\AbstractCache;
if ( ! defined( 'ABSPATH' ) ) {
return;
}
/**
* User data caching
* Get Set & check
*
* @since 2.0.6
*/
class QuizAttempts extends AbstractCache {
/**
* Key for cache identifier
*
* @var string
*
* @since 2.0.6
*/
const KEY = 'tutor_quiz_attempts_count';
/**
* Cache expire time
*
* @var string
*
* @since 2.0.6
*/
const HOUR_IN_SECONDS = 1800;
/**
* Data for caching
*
* @var string
*
* @since 2.0.6
*/
public $data;
/**
* Key
*
* @since 2.0.6
* @return string
*/
public function key(): string {
return self::KEY;
}
/**
* Cache data
*
* @since 2.0.6
* @return object
*/
public function cache_data() {
return $this->data;
}
/**
* Cache time
*
* @since 2.0.6
* @return int
*/
public function cache_time(): int {
$cache_time = self::HOUR_IN_SECONDS;
return $cache_time;
}
}