PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.2.1
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.2.1
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / assets / src / apps / js / admin / editor / getters / question.js

question.js in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.2.1, at assets/src/apps/js/admin/editor/getters/question.js

59 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const Question = {
2 id: function( state ) {
3 return state.id;
4 },
5 type: function( state ) {
6 return state.type;
7 },
8 code: function( state ) {
9 return Date.now();
10 },
11 autoDraft: function( state ) {
12 return state.auto_draft;
13 },
14 answers: function( state ) {
15 return Object.values( state.answers ) || [];
16 },
17 settings: function( state ) {
18 return state.setting;
19 },
20 types: function( state ) {
21 return state.questionTypes || [];
22 },
23 numberCorrect: function( state ) {
24 var correct = 0;
25 Object.keys( state.answers ).forEach( function( key ) {
26 if ( state.answers[key].is_true === 'yes' ) {
27 correct += 1;
28 }
29 } );
30 return correct;
31 },
32 status: function( state ) {
33 return state.status;
34 },
35 currentRequest: function( state ) {
36 return state.countCurrentRequest || 0;
37 },
38 action: function( state ) {
39 return state.action;
40 },
41 nonce: function( state ) {
42 return state.nonce;
43 },
44 externalComponent: function( state ) {
45 return state.externalComponent || [];
46 },
47 supportAnswerOptions: function( state ) {
48 return state.supportAnswerOptions || [];
49 },
50 state: function( state ) {
51 return state;
52 },
53 i18n: function( state ) {
54 return state.i18n;
55 },
56 };
57
58 export default Question;
59