interface-ldlms-answer.php
1.08 KB
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
<?php
/**
* Interface for every answer type.
*
* This would be used in REST API quiz-statistics/<id>/questions
* endpoint in order to get answer data from various question types.
*
* @since 3.3.0
* @package Learndash
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Interface LDLMS_Answer
*
* @package Learndash
*/
if ( ! interface_exists( 'LDLMS_Answer' ) ) {
interface LDLMS_Answer {
/**
* All necessary actions for the object like
* adding hooks, calling internal methods etc.
*
* @since 3.3.0
*
* @return mixed
*/
public function setup();
/**
* Answer key. questionID + position.
* Example: '12-2'
*
* @since 3.3.0
*
* @param string $pos position of the answer in answer set.
*
* @return mixed
*/
public function get_answer_key( $pos );
/**
* Get answers data in the form of array.
*
* @since 3.3.0
*
* @return array
*/
public function get_answers();
/**
* Get submitted answers data in form of array.
*
* @since 3.3.0
*
* @return array
*/
public function get_student_answers();
}
}