PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.1
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.1
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 4.2.1 All 138 releases
learnpress / inc / admin / views / question / editor.php

editor.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.1, at inc/admin/views/question/editor.php

102 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Admin question editor: editor template.
4 *
5 * @since 3.0.0
6 */
7
8 $question = LP_Question::get_question();
9
10 learn_press_admin_view( 'question/actions' );
11 learn_press_admin_view( 'question/answer' );
12 learn_press_admin_view( 'question/fill-in-blanks' );
13 ?>
14
15 <div id="admin-editor-lp_question">
16 <div class="lp-place-holder">
17 <div class="line-heading"></div>
18
19 <div class="line-sm"></div>
20 <div class="line-xs"></div>
21
22 <div class="line-df"></div>
23 <div class="line-lgx"></div>
24 <div class="line-lg"></div>
25
26 <div class="line-df"></div>
27 <div class="line-lg"></div>
28 <div class="line-lgx"></div>
29 </div>
30 </div>
31
32 <script type="text/x-template" id="tmpl-lp-question-editor">
33 <div>
34 <template v-if="!supportAnswerOptions">
35 <?php do_action( 'learn-press/question-editor/question-js-component', $question ); ?>
36 </template>
37 <template v-else>
38 <div id="admin-editor-lp_question" :class="['lp-admin-editor learn-press-box-data', type]">
39 <lp-question-actions :type="type" @changeType="changeType"></lp-question-actions>
40
41 <template v-if="isFillInBlank">
42 <lp-fib-question-answer :type="type" :answers="answers"></lp-fib-question-answer>
43 </template>
44 <template v-else>
45 <lp-question-answer :type="type" :answers="answers"></lp-question-answer>
46 </template>
47 </div>
48 </template>
49 </div>
50 </script>
51
52 <script type="text/javascript">
53 jQuery( function($) {
54 var $store = window.LP_Question_Store;
55
56 window.$Vue = window.$Vue || Vue;
57
58 $Vue.component('lp-question-editor', {
59 template: '#tmpl-lp-question-editor',
60 mounted: function() {
61 var vm = this;
62
63 vm.$watch('type', function() {
64 });
65
66 if(lpAdminSettings.screen.action === 'add') {
67 $store.dispatch('changeQuestionType', {
68 type: vm.type
69 });
70 }
71 },
72 computed: {
73 type: function() {
74 return $store.getters['type']['key'];
75 },
76 isFillInBlank: function() {
77 return this.type === 'fill_in_blanks';
78 },
79 supportAnswerOptions: function () {
80 return $store.getters['supportAnswerOptions'].indexOf( this.type ) !== -1;
81 },
82 answers: function() {
83 return $store.getters['answers'];
84 }
85 },
86 created: function() {
87 },
88 methods: {
89 changeType: function (type) {
90 $store.dispatch('changeQuestionType', {
91 question: {
92 title: $('input[name=post_title]').val(),
93 content: $('textarea[name=content]').val()
94 },
95 type: type
96 });
97 }
98 }
99 });
100 });
101 </script>
102