Version Description
(August 05, 2020) = * Enhancement: Added option to set items per page while adding questions from question bank. * Enhancement: Hide question description by default or when empty. * Enhancement: Fixed the question number position while displaying questions. * Enhancement: Added new option to skip validations when timer expires. * Enhancement: Redesigned addons setting page. * Enhancement: Renamed the question type for better understanding Read Documentation. * Bug: Fixed issue with storing results when questions are more than 100. * Bug: Fixed issue with force submit option after timer expiry. * Bug: Fixed incorrect data issue in email when using %QUESTIONS_ANSWERS%. * Bug: Fixed broken layout when editing or adding question. * Bug: Fixed security vulnerability (discovered by Wordfence).
Release Info
Developer | expresstech |
Plugin | Quiz And Survey Master (Formerly Quiz Master Next) |
Version | 7.0.1 |
Comparing to | |
See all releases |
Code changes from version 7.0.0 to 7.0.1
- README.md +1 -1
- css/admin-dashboard.css +2 -0
- css/common.css +23 -3
- css/qsm-admin-question.css +19 -2
- css/qsm-admin.css +159 -9
- js/admin.js +10 -0
- js/qsm-admin-question.js +27 -3
- js/qsm-quiz.js +86 -79
- mlw_quizmaster2.php +3 -3
- php/admin/addons-page.php +172 -60
- php/admin/admin-dashboard.php +18 -9
- php/admin/functions.php +30 -1
- php/admin/help-page.php +35 -35
- php/admin/options-page-email-tab.php +16 -16
- php/admin/options-page-questions-tab.php +24 -21
- php/admin/options-page-results-page-tab.php +14 -14
- php/admin/options-page-text-tab.php +1 -1
- php/admin/quizzes-page.php +2 -2
- php/admin/settings-page.php +18 -0
- php/admin/stats-page.php +4 -4
- php/admin/tools-page.php +1 -1
- php/classes/class-qmn-quiz-manager.php +124 -82
- php/classes/class-qsm-install.php +19 -1
- php/classes/class-qsm-settings.php +1 -1
- php/question-types.php +6 -5
- php/rest-api.php +14 -9
- php/shortcodes.php +1 -1
- php/template-variables.php +53 -46
- readme.txt +15 -2
- templates/qmn_primary.css +0 -13
- uninstall.php +1 -0
@@ -19,4 +19,4 @@ See [the list of contributors](https://github.com/QuizandSurveyMaster/quiz_maste
|
|
19 |
This project is licensed under the GPLv2 License - see the [LICENSE.md file](https://github.com/QuizandSurveyMaster/quiz_master_next/blob/master/LICENSE.md) for details.
|
20 |
|
21 |
## Support ##
|
22 |
-
This is a developer's portal for Quiz And Survey Master and should _not_ be used for support. Please create a support ticket [here](
|
19 |
This project is licensed under the GPLv2 License - see the [LICENSE.md file](https://github.com/QuizandSurveyMaster/quiz_master_next/blob/master/LICENSE.md) for details.
|
20 |
|
21 |
## Support ##
|
22 |
+
This is a developer's portal for Quiz And Survey Master and should _not_ be used for support. Please create a support ticket [here](https://quizandsurveymaster.com/contact-support/).
|
@@ -3,6 +3,8 @@
|
|
3 |
color: #606a73;
|
4 |
font-size: 23px;
|
5 |
margin-right: 5px;
|
|
|
|
|
6 |
}
|
7 |
.welcome-panel .qsm-welcome-panel-close{
|
8 |
position: absolute;
|
3 |
color: #606a73;
|
4 |
font-size: 23px;
|
5 |
margin-right: 5px;
|
6 |
+
position: relative;
|
7 |
+
top: -3px;
|
8 |
}
|
9 |
.welcome-panel .qsm-welcome-panel-close{
|
10 |
position: absolute;
|
@@ -13,7 +13,11 @@
|
|
13 |
.MJXc-display{
|
14 |
display: inline-block !important;
|
15 |
}
|
16 |
-
.mlw_qmn_question{
|
|
|
|
|
|
|
|
|
17 |
display: block;
|
18 |
}
|
19 |
|
@@ -126,12 +130,14 @@ footer.qsm-popup__footer button.qsm-popup-secondary-button:hover{
|
|
126 |
}
|
127 |
.quiz_section .mlw_qmn_new_question{
|
128 |
font-weight: bold;
|
129 |
-
display: block;
|
130 |
-
width:
|
131 |
margin-bottom: 10px;
|
132 |
}
|
133 |
.quiz_section .mlw_qmn_question.qsm_remove_bold{
|
134 |
font-weight: normal;
|
|
|
|
|
135 |
}
|
136 |
.quiz_section iframe{
|
137 |
width: 100% !important;
|
@@ -147,6 +153,20 @@ footer.qsm-popup__footer button.qsm-popup-secondary-button:hover{
|
|
147 |
font-weight: bold;
|
148 |
color: rgb(52, 152, 219);
|
149 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
@media screen and (max-width: 767px){
|
151 |
.question-type-polar-s .left-polar-title,
|
152 |
.question-type-polar-s .slider-main-wrapper,
|
13 |
.MJXc-display{
|
14 |
display: inline-block !important;
|
15 |
}
|
16 |
+
body .quiz_section .mlw_qmn_question{
|
17 |
+
display: inline-block;
|
18 |
+
}
|
19 |
+
|
20 |
+
body .quiz_section .qsm_contact_div .mlw_qmn_question{
|
21 |
display: block;
|
22 |
}
|
23 |
|
130 |
}
|
131 |
.quiz_section .mlw_qmn_new_question{
|
132 |
font-weight: bold;
|
133 |
+
display: inline-block;
|
134 |
+
width: auto;
|
135 |
margin-bottom: 10px;
|
136 |
}
|
137 |
.quiz_section .mlw_qmn_question.qsm_remove_bold{
|
138 |
font-weight: normal;
|
139 |
+
display: block;
|
140 |
+
margin-bottom: 10px;
|
141 |
}
|
142 |
.quiz_section iframe{
|
143 |
width: 100% !important;
|
153 |
font-weight: bold;
|
154 |
color: rgb(52, 152, 219);
|
155 |
}
|
156 |
+
.quiz_section .mlw-file-upload-error-msg{
|
157 |
+
color: red;
|
158 |
+
display: block;
|
159 |
+
}
|
160 |
+
|
161 |
+
.quiz_section .remove-uploaded-file{
|
162 |
+
color: red;
|
163 |
+
border: 1px solid red;
|
164 |
+
width: 31px;
|
165 |
+
padding: 5px 5px 0px 5px;
|
166 |
+
display: inline-block;
|
167 |
+
cursor: pointer;
|
168 |
+
}
|
169 |
+
|
170 |
@media screen and (max-width: 767px){
|
171 |
.question-type-polar-s .left-polar-title,
|
172 |
.question-type-polar-s .slider-main-wrapper,
|
@@ -195,12 +195,16 @@
|
|
195 |
}
|
196 |
|
197 |
.qsm-row {
|
198 |
-
display:
|
199 |
width: 100%;
|
200 |
margin-bottom: 13px;
|
201 |
font-size: 16px;
|
202 |
}
|
203 |
|
|
|
|
|
|
|
|
|
204 |
#post-body-content .qsm-row{
|
205 |
margin-bottom: 20px;
|
206 |
}
|
@@ -596,7 +600,13 @@ a.import-button.button.disable_import::before {
|
|
596 |
font-size: 15px;
|
597 |
line-height: 21px;
|
598 |
text-align: center;
|
599 |
-
margin: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
600 |
}
|
601 |
|
602 |
#delete-action .deletion{
|
@@ -626,6 +636,13 @@ a#qsm-category-add-toggle {
|
|
626 |
#qsm-question-id{
|
627 |
float: right;
|
628 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
629 |
@media screen and (max-width: 575px){
|
630 |
.qsm-popup__container{
|
631 |
min-width: auto;
|
195 |
}
|
196 |
|
197 |
.qsm-row {
|
198 |
+
display: block;
|
199 |
width: 100%;
|
200 |
margin-bottom: 13px;
|
201 |
font-size: 16px;
|
202 |
}
|
203 |
|
204 |
+
div#correct_answer_info_area {
|
205 |
+
float: left;
|
206 |
+
}
|
207 |
+
|
208 |
#post-body-content .qsm-row{
|
209 |
margin-bottom: 20px;
|
210 |
}
|
600 |
font-size: 15px;
|
601 |
line-height: 21px;
|
602 |
text-align: center;
|
603 |
+
margin: 0 0 20px 0;
|
604 |
+
}
|
605 |
+
|
606 |
+
.qsm-show-question-desc-box{
|
607 |
+
display: inline-block;
|
608 |
+
margin-bottom: 10px !important;
|
609 |
+
font-size: 15px;
|
610 |
}
|
611 |
|
612 |
#delete-action .deletion{
|
636 |
#qsm-question-id{
|
637 |
float: right;
|
638 |
}
|
639 |
+
|
640 |
+
.qsm-show-question-desc-box{
|
641 |
+
background: #fff;
|
642 |
+
}
|
643 |
+
.qsm-show-question-desc-box span.dashicons{
|
644 |
+
line-height: 29px;
|
645 |
+
}
|
646 |
@media screen and (max-width: 575px){
|
647 |
.qsm-popup__container{
|
648 |
min-width: auto;
|
@@ -125,6 +125,152 @@ span.qsm-quiz-name {
|
|
125 |
float: left;
|
126 |
}
|
127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
.quizzes-surveys_page_qmn_addons .qsm-news-ads{
|
129 |
width: 15%;
|
130 |
float: right;
|
@@ -249,6 +395,11 @@ Results Pages & Emails Tab
|
|
249 |
margin-bottom: 10px;
|
250 |
}
|
251 |
|
|
|
|
|
|
|
|
|
|
|
252 |
.results-page-content-header h4,
|
253 |
.results-page-content-header p,
|
254 |
.email-content-header h4,
|
@@ -274,7 +425,7 @@ Results Pages & Emails Tab
|
|
274 |
.delete-condition-button {
|
275 |
background: none;
|
276 |
border: 1px solid #1DD969;
|
277 |
-
color: #
|
278 |
cursor: pointer;
|
279 |
transition-duration: 200ms;
|
280 |
padding: 6px;
|
@@ -512,21 +663,20 @@ Misc.
|
|
512 |
/* Info Bar */
|
513 |
.qsm-info-box {
|
514 |
display: block;
|
515 |
-
text-align:center;
|
516 |
-
background: #
|
517 |
-
border:
|
518 |
-
color: #000;
|
519 |
font-weight: bold;
|
520 |
-
font-size: 14px;
|
|
|
|
|
521 |
}
|
522 |
|
523 |
.qsm-info-box p {
|
524 |
font-size: 14px;
|
525 |
}
|
526 |
|
527 |
-
.qsm-info-box a {
|
528 |
-
color: yellow;
|
529 |
-
}
|
530 |
|
531 |
/* Info Widget */
|
532 |
.qsm-quiz-page-addon .qsm-info-widget {
|
125 |
float: left;
|
126 |
}
|
127 |
|
128 |
+
.qsm-addon-browse-addons{
|
129 |
+
background: #fff;
|
130 |
+
padding: 15px 25px;
|
131 |
+
width: 100%;
|
132 |
+
display: inline-block;
|
133 |
+
box-sizing: border-box;
|
134 |
+
}
|
135 |
+
.qsm-addon-browse-addons .qsm-addon-anchor-left{
|
136 |
+
float: left;
|
137 |
+
}
|
138 |
+
.qsm-addon-browse-addons .qsm-addon-list-right{
|
139 |
+
float: right;
|
140 |
+
}
|
141 |
+
.qsm-addon-browse-addons .qsm-addon-list-right > span{
|
142 |
+
margin-right: 10px;
|
143 |
+
font-size: 16px;
|
144 |
+
}
|
145 |
+
.qsm-addon-browse-addons .qsm-addon-anchor-left a.active{
|
146 |
+
font-weight: bold;
|
147 |
+
}
|
148 |
+
.qsm-addon-browse-addons .qsm-addon-anchor-left a{
|
149 |
+
display: inline-block;
|
150 |
+
font-size: 16px;
|
151 |
+
color: #474444;
|
152 |
+
text-decoration: none;
|
153 |
+
margin-top: 5px;
|
154 |
+
margin-right: 30px;
|
155 |
+
}
|
156 |
+
.qsm_popular_addons div.popuar-addon-ul{
|
157 |
+
width: 100%;
|
158 |
+
display: inline-block;
|
159 |
+
}
|
160 |
+
.qsm_popular_addons div.popuar-addon-ul > div{
|
161 |
+
background: #fff;
|
162 |
+
padding: 5px;
|
163 |
+
width: 30%;
|
164 |
+
margin-right: 2%;
|
165 |
+
float: left;
|
166 |
+
margin-bottom: 30px;
|
167 |
+
}
|
168 |
+
.qsm_popular_addons div.popuar-addon-ul > div:nth-child(3n+4){
|
169 |
+
clear: both;
|
170 |
+
}
|
171 |
+
.qsm_popular_addons div.popuar-addon-ul > div .description-wrap{
|
172 |
+
padding: 20px;
|
173 |
+
}
|
174 |
+
.qsm_popular_addons div.popuar-addon-ul > div .description-wrap .description{
|
175 |
+
display: block;
|
176 |
+
width: 100%;
|
177 |
+
margin-bottom: 15px;
|
178 |
+
font-size: 14px;
|
179 |
+
font-style: normal;
|
180 |
+
}
|
181 |
+
.qsm_popular_addons div.popuar-addon-ul > div img{
|
182 |
+
max-width: 100%;
|
183 |
+
}
|
184 |
+
.qsm-quiz-page-addon.qsm-addon-page-list{
|
185 |
+
width: 75%;
|
186 |
+
float: left;
|
187 |
+
margin-top: 40px;
|
188 |
+
}
|
189 |
+
.qsm-addon-news-ads{
|
190 |
+
width: 25%;
|
191 |
+
float: right;
|
192 |
+
background: #fff;
|
193 |
+
padding: 7px;
|
194 |
+
box-sizing: border-box;
|
195 |
+
margin-top: 40px;
|
196 |
+
}
|
197 |
+
.qsm-addon-news-ads .qsm-news-ads-title{
|
198 |
+
border-bottom: 0;
|
199 |
+
margin-top: 25px;
|
200 |
+
}
|
201 |
+
.qsm-addon-news-ads .qsm-info-widget{
|
202 |
+
text-align: left;
|
203 |
+
padding: 30px;
|
204 |
+
}
|
205 |
+
.qsm-addon-news-ads .qsm-info-widget h3{
|
206 |
+
color: #fff;
|
207 |
+
}
|
208 |
+
.qsm-addon-news-ads .qsm-info-widget a.button-primary{
|
209 |
+
margin-top: 0;
|
210 |
+
background: #fff;
|
211 |
+
color: #444;
|
212 |
+
}
|
213 |
+
.qsm-addon-news-ads .qsm-info-widget .button.button-default{
|
214 |
+
background: #fff;
|
215 |
+
color: #444;
|
216 |
+
}
|
217 |
+
.qsm-addon-news-ads .qsm-info-widget{
|
218 |
+
transform: none !important;
|
219 |
+
max-width: 100%;
|
220 |
+
}
|
221 |
+
.qsm-addon-news-ads .qsm-info-widget:nth-child(2){
|
222 |
+
background: #00BB57;
|
223 |
+
color: #fff;
|
224 |
+
}
|
225 |
+
.qsm-addon-news-ads .qsm-info-widget:nth-child(3){
|
226 |
+
background: #0073AF;
|
227 |
+
color: #fff;
|
228 |
+
}
|
229 |
+
.qsm-active-addons .installed_title{
|
230 |
+
background: #fff;
|
231 |
+
margin: 0;
|
232 |
+
padding: 15px;
|
233 |
+
border: 1px solid #ccd0d4;
|
234 |
+
color: #007cba;
|
235 |
+
font-size: 16px;
|
236 |
+
}
|
237 |
+
.qsm-active-addons .installed_addons_wrapper,
|
238 |
+
.qsm-active-addons .no_addons_installed{
|
239 |
+
border: 1px solid #ccd0d4;
|
240 |
+
border-top: medium none;
|
241 |
+
}
|
242 |
+
.qsm-active-addons .no_addons_installed{
|
243 |
+
padding: 30px 25%;
|
244 |
+
background: #fff;
|
245 |
+
text-align: center;
|
246 |
+
font-style: italic;
|
247 |
+
font-size: 16px;
|
248 |
+
line-height: 22px;
|
249 |
+
}
|
250 |
+
.qsm-active-addons .installed_addons_wrapper .installed_addon{
|
251 |
+
padding: 15px 15px 27px 15px;
|
252 |
+
background: #FAFAFA;
|
253 |
+
}
|
254 |
+
.qsm-active-addons .installed_addons_wrapper .installed_addon:nth-child(2n){
|
255 |
+
background: #fff;
|
256 |
+
}
|
257 |
+
.qsm-active-addons .installed_addons_wrapper .installed_addon .installed_addon_name{
|
258 |
+
font-size: 14px;
|
259 |
+
font-weight: bold;
|
260 |
+
position: relative;
|
261 |
+
top: 5px;
|
262 |
+
}
|
263 |
+
.qsm-active-addons .installed_addons_wrapper .installed_addon .installed_addon_link{
|
264 |
+
float: right;
|
265 |
+
}
|
266 |
+
.qsm-active-addons .installed_addons_wrapper .installed_addon .installed_addon_link span.dashicons{
|
267 |
+
margin-top: 4px;
|
268 |
+
}
|
269 |
+
.qsm-active-addons{
|
270 |
+
width: 100%;
|
271 |
+
box-sizing: border-box;
|
272 |
+
margin-bottom: 30px;
|
273 |
+
}
|
274 |
.quizzes-surveys_page_qmn_addons .qsm-news-ads{
|
275 |
width: 15%;
|
276 |
float: right;
|
395 |
margin-bottom: 10px;
|
396 |
}
|
397 |
|
398 |
+
.email-show label{
|
399 |
+
margin-bottom: 5px;
|
400 |
+
display: block;
|
401 |
+
}
|
402 |
+
|
403 |
.results-page-content-header h4,
|
404 |
.results-page-content-header p,
|
405 |
.email-content-header h4,
|
425 |
.delete-condition-button {
|
426 |
background: none;
|
427 |
border: 1px solid #1DD969;
|
428 |
+
color: #dc3232;
|
429 |
cursor: pointer;
|
430 |
transition-duration: 200ms;
|
431 |
padding: 6px;
|
663 |
/* Info Bar */
|
664 |
.qsm-info-box {
|
665 |
display: block;
|
666 |
+
text-align: center;
|
667 |
+
background: #fff;
|
668 |
+
border: 1px solid #dfd4d4;
|
669 |
+
/* color: #000; */
|
670 |
font-weight: bold;
|
671 |
+
/* font-size: 14px; */
|
672 |
+
margin-bottom: 20px;
|
673 |
+
margin-top: 10px;
|
674 |
}
|
675 |
|
676 |
.qsm-info-box p {
|
677 |
font-size: 14px;
|
678 |
}
|
679 |
|
|
|
|
|
|
|
680 |
|
681 |
/* Info Widget */
|
682 |
.qsm-quiz-page-addon .qsm-info-widget {
|
@@ -140,6 +140,7 @@ var QSMAdmin;
|
|
140 |
icons: icons,
|
141 |
heightStyle: "content"
|
142 |
});
|
|
|
143 |
jQuery('.template-list .template-list-inner:first-child').trigger('click');
|
144 |
}
|
145 |
});
|
@@ -160,6 +161,7 @@ var QSMAdmin;
|
|
160 |
jQuery('#recomm_addons_wrapper').html('');
|
161 |
jQuery('#recomm_addons_wrapper').html(diff_html[1]);
|
162 |
jQuery( "#accordion" ).accordion();
|
|
|
163 |
$( '#quiz_settings_wrapper select' ).each(function(){
|
164 |
var name = $(this).attr('name');
|
165 |
var value = $(this).val();
|
@@ -306,5 +308,13 @@ var QSMAdmin;
|
|
306 |
this_par.text('').text(button_txt);
|
307 |
}, 1000);
|
308 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
});
|
310 |
}(jQuery));
|
140 |
icons: icons,
|
141 |
heightStyle: "content"
|
142 |
});
|
143 |
+
jQuery('#accordion h3.ui-accordion-header').next().slideDown();
|
144 |
jQuery('.template-list .template-list-inner:first-child').trigger('click');
|
145 |
}
|
146 |
});
|
161 |
jQuery('#recomm_addons_wrapper').html('');
|
162 |
jQuery('#recomm_addons_wrapper').html(diff_html[1]);
|
163 |
jQuery( "#accordion" ).accordion();
|
164 |
+
jQuery('#accordion h3.ui-accordion-header').next().slideDown();
|
165 |
$( '#quiz_settings_wrapper select' ).each(function(){
|
166 |
var name = $(this).attr('name');
|
167 |
var value = $(this).val();
|
308 |
this_par.text('').text(button_txt);
|
309 |
}, 1000);
|
310 |
});
|
311 |
+
$(document).on('click', '.qsm-addon-anchor-left > a', function(e){
|
312 |
+
e.preventDefault();
|
313 |
+
var href = $(this).attr('href');
|
314 |
+
$('.qsm-addon-anchor-left').find('a').removeClass('active');
|
315 |
+
$(this).addClass('active');
|
316 |
+
$('.qsm-quiz-page-addon > .qsm_popular_addons').hide();
|
317 |
+
$( href ).show();
|
318 |
+
});
|
319 |
});
|
320 |
}(jQuery));
|
@@ -15,7 +15,7 @@ var import_button;
|
|
15 |
quizID: 1,
|
16 |
type: '0',
|
17 |
name: '',
|
18 |
-
question_title: '
|
19 |
answerInfo: '',
|
20 |
comments: '1',
|
21 |
hint: '',
|
@@ -315,7 +315,11 @@ var import_button;
|
|
315 |
//Do nothing
|
316 |
}else{
|
317 |
questionName = new_question_title;
|
318 |
-
}
|
|
|
|
|
|
|
|
|
319 |
$( '.page:nth-child(' + page + ')' ).append( template( { id: model.id, category : model.get('category'), question: questionName } ) );
|
320 |
setTimeout( QSMQuestion.removeNew, 250 );
|
321 |
},
|
@@ -511,7 +515,11 @@ var import_button;
|
|
511 |
wp.editor.remove( question_content );
|
512 |
QSMQuestion.prepareEditor();
|
513 |
question_editor = tinyMCE.get( 'question-text' );
|
514 |
-
}
|
|
|
|
|
|
|
|
|
515 |
if ($('#wp-question-text-wrap').hasClass('html-active')) {
|
516 |
jQuery( "#question-text" ).val( questionText );
|
517 |
} else if ( question_editor ) {
|
@@ -868,6 +876,22 @@ var import_button;
|
|
868 |
$( '#qsm-category-add' ).slideDown('slow');
|
869 |
}
|
870 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
871 |
});
|
872 |
var decodeEntities = (function () {
|
873 |
//create a new html document (doesn't execute script tags in child elements)
|
15 |
quizID: 1,
|
16 |
type: '0',
|
17 |
name: '',
|
18 |
+
question_title: '',
|
19 |
answerInfo: '',
|
20 |
comments: '1',
|
21 |
hint: '',
|
315 |
//Do nothing
|
316 |
}else{
|
317 |
questionName = new_question_title;
|
318 |
+
}
|
319 |
+
|
320 |
+
if( questionName == '' )
|
321 |
+
questionName = 'Your new question!';
|
322 |
+
|
323 |
$( '.page:nth-child(' + page + ')' ).append( template( { id: model.id, category : model.get('category'), question: questionName } ) );
|
324 |
setTimeout( QSMQuestion.removeNew, 250 );
|
325 |
},
|
515 |
wp.editor.remove( question_content );
|
516 |
QSMQuestion.prepareEditor();
|
517 |
question_editor = tinyMCE.get( 'question-text' );
|
518 |
+
}
|
519 |
+
if( questionText != '' && questionText != null ){
|
520 |
+
jQuery('.qsm-show-question-desc-box').hide();
|
521 |
+
jQuery('.qsm-show-question-desc-box').next('.qsm-row').show();
|
522 |
+
}
|
523 |
if ($('#wp-question-text-wrap').hasClass('html-active')) {
|
524 |
jQuery( "#question-text" ).val( questionText );
|
525 |
} else if ( question_editor ) {
|
876 |
$( '#qsm-category-add' ).slideDown('slow');
|
877 |
}
|
878 |
});
|
879 |
+
|
880 |
+
//Hide/show quesion description
|
881 |
+
$( document ).on('click', '.qsm-show-question-desc-box', function(e){
|
882 |
+
e.preventDefault();
|
883 |
+
if( $(this).next('.qsm-row').is(':visible') ){
|
884 |
+
$(this).html('').html('<span class="dashicons dashicons-plus-alt2"></span> ' + qsmQuestionSettings.show_desc_text);
|
885 |
+
$(this).next('.qsm-row').slideUp();
|
886 |
+
}else{
|
887 |
+
$(this).hide();
|
888 |
+
var question_description = wp.editor.getContent( 'question-text' );
|
889 |
+
if( question_description == '' || question_description == null ){
|
890 |
+
tinyMCE.get( 'question-text' ).setContent( 'Add description here!' );
|
891 |
+
}
|
892 |
+
$(this).next('.qsm-row').slideDown();
|
893 |
+
}
|
894 |
+
});
|
895 |
});
|
896 |
var decodeEntities = (function () {
|
897 |
//create a new html document (doesn't execute script tags in child elements)
|
@@ -1,9 +1,9 @@
|
|
1 |
/**************************
|
2 |
-
* Quiz And Survey Master
|
3 |
*************************/
|
4 |
|
5 |
/**************************
|
6 |
-
* This object contains the newer functions. All global functions under are slowly
|
7 |
* being deprecated and replaced with rewritten newer functions
|
8 |
**************************/
|
9 |
|
@@ -17,7 +17,7 @@ var QSMPageTimer;
|
|
17 |
init: function() {
|
18 |
// Makes sure we have quizzes on this page
|
19 |
if ( typeof qmn_quiz_data != 'undefined' && qmn_quiz_data) {
|
20 |
-
// hide the recaptcha by default
|
21 |
$( '.g-recaptcha' ).hide();
|
22 |
// Cycle through all quizzes
|
23 |
_.each( qmn_quiz_data, function( quiz ) {
|
@@ -35,7 +35,7 @@ var QSMPageTimer;
|
|
35 |
|
36 |
/**
|
37 |
* Sets up timer for a quiz
|
38 |
-
*
|
39 |
* @param int quizID The ID of the quiz
|
40 |
*/
|
41 |
initTimer: function( quizID ) {
|
@@ -64,10 +64,10 @@ var QSMPageTimer;
|
|
64 |
QSM.activateTimer(quizID);
|
65 |
$('#quizForm' + quizID).closest('.qmn_quiz_container').find('.stoptimer-p').show();
|
66 |
}
|
67 |
-
}
|
68 |
});
|
69 |
// ...else, activate the timer on page load.
|
70 |
-
} else {
|
71 |
QSM.activateTimer(quizID);
|
72 |
$('#quizForm' + quizID).closest('.qmn_quiz_container').find('.stoptimer-p').show();
|
73 |
}
|
@@ -102,7 +102,7 @@ var QSMPageTimer;
|
|
102 |
* @param int quizID The ID of the quiz.
|
103 |
*/
|
104 |
activateTimer: function( quizID ) {
|
105 |
-
|
106 |
// Gets our form.
|
107 |
var $timer = QSM.getTimer( quizID );
|
108 |
|
@@ -119,10 +119,10 @@ var QSMPageTimer;
|
|
119 |
seconds = parseFloat( qmn_quiz_data[ quizID ].timer_limit ) * 60;
|
120 |
}
|
121 |
qmn_quiz_data[ quizID ].timerRemaning = seconds;
|
122 |
-
|
123 |
//hidden timer
|
124 |
jQuery(".hiddentimer").html(seconds);
|
125 |
-
|
126 |
// Makes the timer appear.
|
127 |
$timer.show();
|
128 |
$timer.text( QSM.secondsToTimer( seconds ) );
|
@@ -151,8 +151,8 @@ var QSMPageTimer;
|
|
151 |
var $timer = QSM.getTimer( quizID );
|
152 |
$timer.text( display );
|
153 |
document.title = display + ' ' + qsmTitleText;
|
154 |
-
|
155 |
-
/*CUSTOM TIMER*/
|
156 |
if(qmn_quiz_data[quizID].hasOwnProperty('advanced_timer') && qmn_quiz_data[quizID].advanced_timer.timer_design == 'big_timer'){
|
157 |
$(".second.circle").parent('.mlw_quiz_form').addClass('qsm_big_timer');
|
158 |
$(".second.circle").show();
|
@@ -165,14 +165,14 @@ var QSMPageTimer;
|
|
165 |
fill: {gradient: ["#00bb40", "#00511c"]}
|
166 |
});
|
167 |
}
|
168 |
-
|
169 |
var $quizForm = QSM.getQuizForm( quizID );
|
170 |
var total_seconds = parseFloat( qmn_quiz_data[ quizID ].timer_limit ) * 60;
|
171 |
var ninety_sec = total_seconds - ( total_seconds * 90 / 100 );
|
172 |
if(ninety_sec == secondsRemaining){
|
173 |
$quizForm.closest( '.qmn_quiz_container' ).find('.qsm_ninety_warning').fadeIn();
|
174 |
}
|
175 |
-
|
176 |
// If timer is run out, disable fields.
|
177 |
if ( 0 >= secondsRemaining ) {
|
178 |
clearInterval( qmn_quiz_data[ quizID ].timerInterval );
|
@@ -182,12 +182,12 @@ var QSMPageTimer;
|
|
182 |
$( ".mlw_qmn_question_comment" ).attr( 'disabled', true );
|
183 |
$( ".mlw_answer_open_text" ).attr( 'disabled', true );
|
184 |
$( ".mlw_answer_number" ).attr( 'disabled', true );
|
185 |
-
|
186 |
$quizForm.closest( '.qmn_quiz_container' ).addClass( 'qsm_timer_ended' );
|
187 |
$quizForm.closest( '.qmn_quiz_container' ).prepend('<p style="color: red;">Quiz time is over</p>');
|
188 |
//$( ".qsm-submit-btn" ).remove();
|
189 |
if(qmn_ajax_object.enable_result_after_timer_end == 1){
|
190 |
-
$quizForm.closest( '.qmn_quiz_container' ).find('
|
191 |
}else{
|
192 |
MicroModal.show( 'modal-3' );
|
193 |
}
|
@@ -258,7 +258,7 @@ var QSMPageTimer;
|
|
258 |
},
|
259 |
/**
|
260 |
* Sets up pagination for a quiz
|
261 |
-
*
|
262 |
* @param int quizID The ID of the quiz.
|
263 |
*/
|
264 |
initPagination: function( quizID ) {
|
@@ -266,7 +266,7 @@ var QSMPageTimer;
|
|
266 |
if ( 0 < $quizForm.children( '.qsm-page' ).length ) {
|
267 |
$quizForm.children( '.qsm-page' ).hide();
|
268 |
template = wp.template( 'qsm-pagination' );
|
269 |
-
$quizForm.append( template() );
|
270 |
if( $quizForm.find( '.qsm-pagination > .current_page_hidden' ).length == 0){
|
271 |
$quizForm.find( '.qsm-pagination' ).append( '<input type="hidden" value="0" name="current_page" class="current_page_hidden" />');
|
272 |
}
|
@@ -314,7 +314,7 @@ var QSMPageTimer;
|
|
314 |
var $container = jQuery( '#quizForm' + quizID ).closest( '.qmn_quiz_container' );
|
315 |
qsmScrollTo( $container );
|
316 |
});
|
317 |
-
}
|
318 |
},
|
319 |
/**
|
320 |
* Navigates quiz to specific page
|
@@ -351,20 +351,20 @@ var QSMPageTimer;
|
|
351 |
$quizForm.find( '.qsm-previous' ).hide();
|
352 |
}
|
353 |
if ( '1' == qmn_quiz_data[ quizID ].progress_bar ) {
|
354 |
-
var current_page = jQuery('#quizForm' + quizID).find('.current_page_hidden').val();
|
355 |
-
var total_page_length = $pages.length - 1;
|
356 |
if( qmn_quiz_data[ quizID ].contact_info_location == 0 ){
|
357 |
//Do nothing.
|
358 |
}else if( qmn_quiz_data[ quizID ].contact_info_location == 1 ){
|
359 |
if($quizForm.children( '.qsm-page' ).find('.qsm_contact_div ').length > 0){
|
360 |
//total_page_length = total_page_length - 1;
|
361 |
}
|
362 |
-
}
|
363 |
var animate_value = current_page / total_page_length;
|
364 |
if( animate_value <= 1){
|
365 |
qmn_quiz_data[ quizID ].bar.animate( animate_value );
|
366 |
var old_text = jQuery( '#quizForm' + quizID ).find( '.progressbar-text' ).text().replace(' %', '');
|
367 |
-
var new_text = Math.round(animate_value * 100);
|
368 |
jQuery({
|
369 |
Counter: old_text
|
370 |
}).animate({
|
@@ -375,7 +375,7 @@ var QSMPageTimer;
|
|
375 |
step: function () {
|
376 |
jQuery( '#quizForm' + quizID ).find( '.progressbar-text' ).text(Math.round(this.Counter) + ' %');
|
377 |
}
|
378 |
-
});
|
379 |
}
|
380 |
}
|
381 |
QSM.savePage( quizID, pageNumber );
|
@@ -394,7 +394,7 @@ var QSMPageTimer;
|
|
394 |
nextPage: function( quizID ) {
|
395 |
if ( qmnValidatePage( 'quizForm' + quizID ) ) {
|
396 |
QSM.changePage( quizID, 1 );
|
397 |
-
}
|
398 |
},
|
399 |
prevPage: function( quizID ) {
|
400 |
QSM.changePage( quizID, -1 );
|
@@ -415,10 +415,10 @@ var QSMPageTimer;
|
|
415 |
* @param jQueryObject The jQuery version of an element. i.e. $('#quizForm3')
|
416 |
*/
|
417 |
scrollTo: function( $element ) {
|
418 |
-
jQuery( 'html, body' ).animate(
|
419 |
-
{
|
420 |
scrollTop: $element.offset().top - 150
|
421 |
-
},
|
422 |
1000 );
|
423 |
},
|
424 |
/**
|
@@ -426,7 +426,7 @@ var QSMPageTimer;
|
|
426 |
*/
|
427 |
getQuizForm: function( quizID ) {
|
428 |
return $( '#quizForm' + quizID );
|
429 |
-
}
|
430 |
};
|
431 |
|
432 |
QSMPageTimer = {
|
@@ -578,9 +578,9 @@ var QSMPageTimer;
|
|
578 |
qmnInit();
|
579 |
|
580 |
// Call main initialization.
|
581 |
-
QSM.init();
|
582 |
});
|
583 |
-
|
584 |
jQuery("input[name='timer_ms']").each(function(){
|
585 |
var timems = qsmTimeInMS();
|
586 |
jQuery(this).val(timems);
|
@@ -592,7 +592,7 @@ var qsmTitleText = document.title;
|
|
592 |
|
593 |
/**
|
594 |
* Validates an email ID.
|
595 |
-
*
|
596 |
* @param email The Email Id to validate.
|
597 |
* @returns Boolean
|
598 |
*/
|
@@ -611,7 +611,7 @@ function isEmail( email ) {
|
|
611 |
* @returns {undefined}
|
612 |
*/
|
613 |
function qsmCheckMR(event, limit){
|
614 |
-
var checked = jQuery(event).parents('.quiz_section').find(':checkbox:checked').length;
|
615 |
if (checked > limit) {
|
616 |
event.checked = false;
|
617 |
}
|
@@ -665,7 +665,7 @@ function qmnValidation( element, quiz_form_id ) {
|
|
665 |
var number_error = qmn_quiz_data[ quiz_id ].error_messages.number;
|
666 |
var empty_error = qmn_quiz_data[ quiz_id ].error_messages.empty;
|
667 |
var incorrect_error = qmn_quiz_data[ quiz_id ].error_messages.incorrect;
|
668 |
-
qmnResetError( quiz_form_id );
|
669 |
jQuery( element ).each(function(){
|
670 |
if ( jQuery( this ).attr( 'class' )) {
|
671 |
if( jQuery( this ).attr( 'class' ).indexOf( 'mlwEmail' ) !== -1 && this.value !== "" ) {
|
@@ -676,13 +676,18 @@ function qmnValidation( element, quiz_form_id ) {
|
|
676 |
result = false;
|
677 |
}
|
678 |
}
|
679 |
-
|
|
|
|
|
|
|
|
|
|
|
680 |
|
681 |
if( jQuery( this ).attr( 'class' ).indexOf( 'mlwRequiredNumber' ) > -1 && this.value === "" && +this.value != NaN ) {
|
682 |
qmnDisplayError( number_error, jQuery( this ), quiz_form_id );
|
683 |
result = false;
|
684 |
}
|
685 |
-
|
686 |
if( jQuery( this ).attr( 'class' ).indexOf( 'mlwRequiredText' ) > -1 && this.value === "" ) {
|
687 |
qmnDisplayError( empty_error, jQuery( this ), quiz_form_id );
|
688 |
result = false;
|
@@ -710,7 +715,7 @@ function qmnValidation( element, quiz_form_id ) {
|
|
710 |
}
|
711 |
}
|
712 |
if( jQuery( this ).attr( 'class' ).indexOf( 'qsmRequiredSelect' ) > -1 ) {
|
713 |
-
check_val = jQuery( this ).val();
|
714 |
if ( check_val == "No Answer Provided" ) {
|
715 |
qmnDisplayError( empty_error, jQuery( this ), quiz_form_id );
|
716 |
result = false;
|
@@ -727,7 +732,7 @@ function qmnValidation( element, quiz_form_id ) {
|
|
727 |
if(grecaptcha.getResponse() == "") {
|
728 |
alert('ReCaptcha is missing');
|
729 |
result = false;
|
730 |
-
}
|
731 |
}
|
732 |
}
|
733 |
}
|
@@ -764,7 +769,7 @@ function qmnFormSubmit( quiz_form_id ) {
|
|
764 |
jQuery( '.mlw_qmn_quiz select' ).attr( 'disabled', false );
|
765 |
jQuery( '.mlw_qmn_question_comment' ).attr( 'disabled', false );
|
766 |
jQuery( '.mlw_answer_open_text' ).attr( 'disabled', false );
|
767 |
-
|
768 |
//Convert serialize data into index array
|
769 |
var unindexed_array = jQuery( '#' + quiz_form_id ).serializeArray();
|
770 |
var fd = new FormData();
|
@@ -772,8 +777,8 @@ function qmnFormSubmit( quiz_form_id ) {
|
|
772 |
fd.append(input.name,input.value);
|
773 |
});
|
774 |
fd.append("action", 'qmn_process_quiz');
|
775 |
-
|
776 |
-
|
777 |
qsmEndTimeTakenTimer();
|
778 |
if (qmn_quiz_data[quizID].hasOwnProperty('advanced_timer')) {
|
779 |
QSMPageTimer.endPageTimer(quiz_id);
|
@@ -794,7 +799,7 @@ function qmnFormSubmit( quiz_form_id ) {
|
|
794 |
qmnDisplayResults( JSON.parse( response ), quiz_form_id, $container );
|
795 |
}
|
796 |
});
|
797 |
-
|
798 |
return false;
|
799 |
}
|
800 |
|
@@ -922,12 +927,12 @@ function qmnNextSlide( pagination, go_to_top, quiz_form_id ) {
|
|
922 |
page_number = parseInt(hiddem_page_number) + 1;
|
923 |
}
|
924 |
var total_questions = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('[class*="question-section-id-"]').length;
|
925 |
-
var total_page_number = Math.ceil(total_questions / pagination);
|
926 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val( page_number );
|
927 |
-
if(page_number > 0 && jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').length > 0){
|
928 |
if( page_number <= total_page_number ){
|
929 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').text('').text( page_number + ' out of ' + total_page_number);
|
930 |
-
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').show();
|
931 |
}else{
|
932 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
|
933 |
}
|
@@ -946,7 +951,7 @@ function qmnPrevSlide( pagination, go_to_top, quiz_form_id ) {
|
|
946 |
|
947 |
jQuery( quiz_form_id + " .quiz_section" ).hide();
|
948 |
jQuery( quiz_form_id + " .g-recaptcha" ).hide();
|
949 |
-
|
950 |
for (var i = 0; i < pagination; i++) {
|
951 |
if (i === 0 && previous === 0) {
|
952 |
slide_number = slide_number - pagination;
|
@@ -991,7 +996,7 @@ function qmnPrevSlide( pagination, go_to_top, quiz_form_id ) {
|
|
991 |
var hiddem_page_number = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val();
|
992 |
var page_number = parseInt(hiddem_page_number) - 1;
|
993 |
var total_questions = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('[class*="question-section-id-"]').length;
|
994 |
-
var total_page_number = Math.ceil(total_questions / pagination);
|
995 |
if(hiddem_page_number > 0 && jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').length > 0){
|
996 |
if( page_number <= total_page_number ){
|
997 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').text('').text( page_number + ' out of ' + total_page_number);
|
@@ -999,12 +1004,12 @@ function qmnPrevSlide( pagination, go_to_top, quiz_form_id ) {
|
|
999 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
|
1000 |
}else{
|
1001 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').show();
|
1002 |
-
}
|
1003 |
}else{
|
1004 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
|
1005 |
}
|
1006 |
}
|
1007 |
-
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val( page_number );
|
1008 |
qmnInitProgressbarOnClick(quiz_id, page_number, total_page_number);
|
1009 |
}
|
1010 |
|
@@ -1018,13 +1023,13 @@ function qmnPrevSlide( pagination, go_to_top, quiz_form_id ) {
|
|
1018 |
function qmnInitProgressbarOnClick(quiz_id, page_number, total_page_number){
|
1019 |
if ( '1' == qmn_quiz_data[ quiz_id ].progress_bar ) {
|
1020 |
var total_questions = jQuery( '#quizForm' + quiz_id ).closest( '.qmn_quiz_container' ).find('.quiz_section').length - 1;
|
1021 |
-
var pagination = qmn_quiz_data[quiz_id].pagination.amount;
|
1022 |
-
total_page_number = Math.ceil(total_questions / pagination);
|
1023 |
if(pagination === 1){
|
1024 |
total_page_number = total_page_number - 1;
|
1025 |
-
}
|
1026 |
-
var animate_value = page_number / total_page_number;
|
1027 |
-
if( animate_value <= 1){
|
1028 |
qmn_quiz_data[ quiz_id ].bar.animate( animate_value );
|
1029 |
var old_text = jQuery( '#qsm_progress_bar_' + quiz_id ).find( '.progressbar-text' ).text().replace(' %', '');
|
1030 |
var new_text = Math.round(animate_value * 100);
|
@@ -1074,7 +1079,7 @@ function qmnInitPagination( quiz_id ) {
|
|
1074 |
.append( '<div class="qmn_page_counter_message"></div>' )
|
1075 |
.append( '<div class="qsm-progress-bar" id="qsm_progress_bar_'+ quiz_id +'" style="display:none;"><div class="progressbar-text"></div></div>' )
|
1076 |
.append( '<a class="qmn_btn mlw_qmn_quiz_link mlw_next" href="#">' + qmn_quiz_data[quiz_id].pagination.next_text + '</a>' );
|
1077 |
-
|
1078 |
if ( '1' == qmn_quiz_data[ quiz_id ].progress_bar ) {
|
1079 |
jQuery('#quizForm' + quiz_id).closest( '.qmn_quiz_container' ).find('.qsm-progress-bar').show();
|
1080 |
qmn_quiz_data[ quiz_id ].bar = new ProgressBar.Line('#qsm_progress_bar_' + quiz_id, {
|
@@ -1101,11 +1106,11 @@ function qmnInitPagination( quiz_id ) {
|
|
1101 |
},
|
1102 |
from: {color: '#3498db'},
|
1103 |
to: {color: '#ED6A5A'},
|
1104 |
-
step: function(state, bar) {
|
1105 |
}
|
1106 |
});
|
1107 |
}
|
1108 |
-
|
1109 |
jQuery(".mlw_next").click(function(event) {
|
1110 |
event.preventDefault();
|
1111 |
var quiz_id = +jQuery( this ).closest( '.qmn_quiz_container' ).find( '.qmn_quiz_id' ).val();
|
@@ -1113,19 +1118,19 @@ function qmnInitPagination( quiz_id ) {
|
|
1113 |
qmnNextSlide( qmn_quiz_data[quiz_id].pagination.amount, 1, '#quizForm' + quiz_id );
|
1114 |
}
|
1115 |
});
|
1116 |
-
|
1117 |
jQuery(".mlw_previous").click(function(event) {
|
1118 |
event.preventDefault();
|
1119 |
var quiz_id = +jQuery( this ).closest( '.qmn_quiz_container' ).find( '.qmn_quiz_id' ).val();
|
1120 |
qmnPrevSlide( qmn_quiz_data[quiz_id].pagination.amount, 1, '#quizForm' + quiz_id );
|
1121 |
});
|
1122 |
-
|
1123 |
if ( qmn_quiz_data[quiz_id].first_page ) {
|
1124 |
qmnNextSlide( 1, 0, '#quizForm' + quiz_id );
|
1125 |
} else {
|
1126 |
qmnNextSlide( qmn_quiz_data[quiz_id].pagination.amount, 0, '#quizForm' + quiz_id );
|
1127 |
}
|
1128 |
-
|
1129 |
}
|
1130 |
|
1131 |
function qmnSocialShare( network, mlw_qmn_social_text, mlw_qmn_title, facebook_id, share_url ) {
|
@@ -1149,20 +1154,20 @@ function qmnSocialShare( network, mlw_qmn_social_text, mlw_qmn_title, facebook_i
|
|
1149 |
|
1150 |
jQuery(function() {
|
1151 |
jQuery( '.qmn_quiz_container' ).tooltip();
|
1152 |
-
|
1153 |
jQuery( '.qmn_quiz_container input' ).on( 'keypress', function ( e ) {
|
1154 |
if ( e.which === 13 ) {
|
1155 |
e.preventDefault();
|
1156 |
}
|
1157 |
});
|
1158 |
-
|
1159 |
// jQuery( '.qmn_quiz_form' ).on( "submit", function( event ) {
|
1160 |
jQuery(document).on( 'click', ".qsm-submit-btn", function( event ) {
|
1161 |
event.preventDefault();
|
1162 |
var form = jQuery(this).closest('form')[0];
|
1163 |
qmnFormSubmit( form.id );
|
1164 |
});
|
1165 |
-
|
1166 |
jQuery(document).on('click','.btn-reload-quiz',function(e){
|
1167 |
e.preventDefault();
|
1168 |
var quiz_id = jQuery(this).data('quiz_id');
|
@@ -1172,17 +1177,17 @@ jQuery(function() {
|
|
1172 |
type: 'POST',
|
1173 |
url: qmn_ajax_object.ajaxurl,
|
1174 |
data: {
|
1175 |
-
action: "qsm_get_quiz_to_reload",
|
1176 |
quiz_id: quiz_id,
|
1177 |
},
|
1178 |
-
success: function (response) {
|
1179 |
parent_div.replaceWith(response);
|
1180 |
// Restart the timer for retake quiz.
|
1181 |
setInterval( qmnTimeTakenTimer, 1000 );
|
1182 |
-
|
1183 |
// Reset the timer clock on retake quiz.
|
1184 |
QSM.initTimer( quiz_id );
|
1185 |
-
|
1186 |
QSM.initPagination( quiz_id );
|
1187 |
},
|
1188 |
error: function (errorThrown) {
|
@@ -1191,18 +1196,18 @@ jQuery(function() {
|
|
1191 |
}
|
1192 |
});
|
1193 |
});
|
1194 |
-
|
1195 |
jQuery(document).on('change','.qmn_radio_answers input',function(e){
|
1196 |
if(qmn_ajax_object.enable_quick_result_mc == 1){
|
1197 |
-
var question_id = jQuery(this).attr('name').split('question')[1],
|
1198 |
value = jQuery(this).val(),
|
1199 |
$this = jQuery(this).parents('.quiz_section');
|
1200 |
-
|
1201 |
jQuery.ajax({
|
1202 |
type: 'POST',
|
1203 |
url: qmn_ajax_object.ajaxurl,
|
1204 |
data: {
|
1205 |
-
action: "qsm_get_question_quick_result",
|
1206 |
question_id: question_id,
|
1207 |
answer: value,
|
1208 |
},
|
@@ -1212,7 +1217,7 @@ jQuery(function() {
|
|
1212 |
$this.append('<p style="color: green" class="quick-question-res-p">' + qmn_ajax_object.quick_result_correct_text + '</p>')
|
1213 |
}else if(response == 'incorrect'){
|
1214 |
$this.append('<p style="color: red" class="quick-question-res-p">' + qmn_ajax_object.quick_result_wrong_text + '</p>')
|
1215 |
-
}
|
1216 |
},
|
1217 |
error: function (errorThrown) {
|
1218 |
alert(errorThrown);
|
@@ -1220,9 +1225,9 @@ jQuery(function() {
|
|
1220 |
});
|
1221 |
}
|
1222 |
});
|
1223 |
-
|
1224 |
/*jQuery('.qmn_radio_answers > .qmn_mc_answer_wrap').on('click',function(event){
|
1225 |
-
var radButton = jQuery(this).find('input[type=radio]');
|
1226 |
if(event.target.className == 'qmn_quiz_radio'){
|
1227 |
return true;
|
1228 |
}
|
@@ -1242,6 +1247,7 @@ jQuery(function() {
|
|
1242 |
form_data.append('action', 'qsm_upload_image_fd_question');
|
1243 |
var question_id = $this.parent('.quiz_section').find('.mlw_file_upload_hidden_value').attr("name").replace('question','');
|
1244 |
form_data.append('question_id', question_id);
|
|
|
1245 |
jQuery.ajax({
|
1246 |
url: qmn_ajax_object.ajaxurl,
|
1247 |
type: 'POST',
|
@@ -1251,9 +1257,10 @@ jQuery(function() {
|
|
1251 |
processData: false,
|
1252 |
success: function (response) {
|
1253 |
var obj = jQuery.parseJSON(response);
|
|
|
1254 |
if(obj.type == 'success'){
|
1255 |
-
$this.next('.remove-uploaded-file').show();
|
1256 |
-
$this.next().next('.mlw_file_upload_hidden_value').val(obj.file_url);
|
1257 |
$this.parent('.quiz_section').find('.mlw_file_upload_hidden_path').val(obj.file_path);
|
1258 |
$this.parent('.quiz_section').find('.mlw-file-upload-error-msg').hide();
|
1259 |
}else{
|
@@ -1265,14 +1272,14 @@ jQuery(function() {
|
|
1265 |
});
|
1266 |
return false;
|
1267 |
});
|
1268 |
-
|
1269 |
//Ajax remove file code
|
1270 |
jQuery('.quiz_section .remove-uploaded-file').on('click', function(){
|
1271 |
var $this = jQuery(this);
|
1272 |
var file_data = jQuery(this).parent('.quiz_section').find('.mlw_file_upload_hidden_path').val();
|
1273 |
var form_data = new FormData();
|
1274 |
form_data.append('action', 'qsm_remove_file_fd_question');
|
1275 |
-
form_data.append('file_url', file_data);
|
1276 |
jQuery.ajax({
|
1277 |
url: qmn_ajax_object.ajaxurl,
|
1278 |
type: 'POST',
|
@@ -1296,13 +1303,13 @@ jQuery(function() {
|
|
1296 |
});
|
1297 |
return false;
|
1298 |
});
|
1299 |
-
|
1300 |
//Deselect all answer on select
|
1301 |
jQuery('.qsm-deselect-answer').click(function(e){
|
1302 |
e.preventDefault();
|
1303 |
jQuery(this).parents('.quiz_section').find('input[type="radio"]').prop('checked', false);
|
1304 |
});
|
1305 |
-
|
1306 |
//Submit the form on popup click
|
1307 |
jQuery(document).on( 'click', '.submit-the-form', function(e) {
|
1308 |
e.preventDefault();
|
1 |
/**************************
|
2 |
+
* Quiz And Survey Master
|
3 |
*************************/
|
4 |
|
5 |
/**************************
|
6 |
+
* This object contains the newer functions. All global functions under are slowly
|
7 |
* being deprecated and replaced with rewritten newer functions
|
8 |
**************************/
|
9 |
|
17 |
init: function() {
|
18 |
// Makes sure we have quizzes on this page
|
19 |
if ( typeof qmn_quiz_data != 'undefined' && qmn_quiz_data) {
|
20 |
+
// hide the recaptcha by default
|
21 |
$( '.g-recaptcha' ).hide();
|
22 |
// Cycle through all quizzes
|
23 |
_.each( qmn_quiz_data, function( quiz ) {
|
35 |
|
36 |
/**
|
37 |
* Sets up timer for a quiz
|
38 |
+
*
|
39 |
* @param int quizID The ID of the quiz
|
40 |
*/
|
41 |
initTimer: function( quizID ) {
|
64 |
QSM.activateTimer(quizID);
|
65 |
$('#quizForm' + quizID).closest('.qmn_quiz_container').find('.stoptimer-p').show();
|
66 |
}
|
67 |
+
}
|
68 |
});
|
69 |
// ...else, activate the timer on page load.
|
70 |
+
} else {
|
71 |
QSM.activateTimer(quizID);
|
72 |
$('#quizForm' + quizID).closest('.qmn_quiz_container').find('.stoptimer-p').show();
|
73 |
}
|
102 |
* @param int quizID The ID of the quiz.
|
103 |
*/
|
104 |
activateTimer: function( quizID ) {
|
105 |
+
|
106 |
// Gets our form.
|
107 |
var $timer = QSM.getTimer( quizID );
|
108 |
|
119 |
seconds = parseFloat( qmn_quiz_data[ quizID ].timer_limit ) * 60;
|
120 |
}
|
121 |
qmn_quiz_data[ quizID ].timerRemaning = seconds;
|
122 |
+
|
123 |
//hidden timer
|
124 |
jQuery(".hiddentimer").html(seconds);
|
125 |
+
|
126 |
// Makes the timer appear.
|
127 |
$timer.show();
|
128 |
$timer.text( QSM.secondsToTimer( seconds ) );
|
151 |
var $timer = QSM.getTimer( quizID );
|
152 |
$timer.text( display );
|
153 |
document.title = display + ' ' + qsmTitleText;
|
154 |
+
|
155 |
+
/*CUSTOM TIMER*/
|
156 |
if(qmn_quiz_data[quizID].hasOwnProperty('advanced_timer') && qmn_quiz_data[quizID].advanced_timer.timer_design == 'big_timer'){
|
157 |
$(".second.circle").parent('.mlw_quiz_form').addClass('qsm_big_timer');
|
158 |
$(".second.circle").show();
|
165 |
fill: {gradient: ["#00bb40", "#00511c"]}
|
166 |
});
|
167 |
}
|
168 |
+
|
169 |
var $quizForm = QSM.getQuizForm( quizID );
|
170 |
var total_seconds = parseFloat( qmn_quiz_data[ quizID ].timer_limit ) * 60;
|
171 |
var ninety_sec = total_seconds - ( total_seconds * 90 / 100 );
|
172 |
if(ninety_sec == secondsRemaining){
|
173 |
$quizForm.closest( '.qmn_quiz_container' ).find('.qsm_ninety_warning').fadeIn();
|
174 |
}
|
175 |
+
|
176 |
// If timer is run out, disable fields.
|
177 |
if ( 0 >= secondsRemaining ) {
|
178 |
clearInterval( qmn_quiz_data[ quizID ].timerInterval );
|
182 |
$( ".mlw_qmn_question_comment" ).attr( 'disabled', true );
|
183 |
$( ".mlw_answer_open_text" ).attr( 'disabled', true );
|
184 |
$( ".mlw_answer_number" ).attr( 'disabled', true );
|
185 |
+
|
186 |
$quizForm.closest( '.qmn_quiz_container' ).addClass( 'qsm_timer_ended' );
|
187 |
$quizForm.closest( '.qmn_quiz_container' ).prepend('<p style="color: red;">Quiz time is over</p>');
|
188 |
//$( ".qsm-submit-btn" ).remove();
|
189 |
if(qmn_ajax_object.enable_result_after_timer_end == 1){
|
190 |
+
$quizForm.closest( '.qmn_quiz_container' ).find('.qsm-submit-btn').trigger('click');
|
191 |
}else{
|
192 |
MicroModal.show( 'modal-3' );
|
193 |
}
|
258 |
},
|
259 |
/**
|
260 |
* Sets up pagination for a quiz
|
261 |
+
*
|
262 |
* @param int quizID The ID of the quiz.
|
263 |
*/
|
264 |
initPagination: function( quizID ) {
|
266 |
if ( 0 < $quizForm.children( '.qsm-page' ).length ) {
|
267 |
$quizForm.children( '.qsm-page' ).hide();
|
268 |
template = wp.template( 'qsm-pagination' );
|
269 |
+
$quizForm.append( template() );
|
270 |
if( $quizForm.find( '.qsm-pagination > .current_page_hidden' ).length == 0){
|
271 |
$quizForm.find( '.qsm-pagination' ).append( '<input type="hidden" value="0" name="current_page" class="current_page_hidden" />');
|
272 |
}
|
314 |
var $container = jQuery( '#quizForm' + quizID ).closest( '.qmn_quiz_container' );
|
315 |
qsmScrollTo( $container );
|
316 |
});
|
317 |
+
}
|
318 |
},
|
319 |
/**
|
320 |
* Navigates quiz to specific page
|
351 |
$quizForm.find( '.qsm-previous' ).hide();
|
352 |
}
|
353 |
if ( '1' == qmn_quiz_data[ quizID ].progress_bar ) {
|
354 |
+
var current_page = jQuery('#quizForm' + quizID).find('.current_page_hidden').val();
|
355 |
+
var total_page_length = $pages.length - 1;
|
356 |
if( qmn_quiz_data[ quizID ].contact_info_location == 0 ){
|
357 |
//Do nothing.
|
358 |
}else if( qmn_quiz_data[ quizID ].contact_info_location == 1 ){
|
359 |
if($quizForm.children( '.qsm-page' ).find('.qsm_contact_div ').length > 0){
|
360 |
//total_page_length = total_page_length - 1;
|
361 |
}
|
362 |
+
}
|
363 |
var animate_value = current_page / total_page_length;
|
364 |
if( animate_value <= 1){
|
365 |
qmn_quiz_data[ quizID ].bar.animate( animate_value );
|
366 |
var old_text = jQuery( '#quizForm' + quizID ).find( '.progressbar-text' ).text().replace(' %', '');
|
367 |
+
var new_text = Math.round(animate_value * 100);
|
368 |
jQuery({
|
369 |
Counter: old_text
|
370 |
}).animate({
|
375 |
step: function () {
|
376 |
jQuery( '#quizForm' + quizID ).find( '.progressbar-text' ).text(Math.round(this.Counter) + ' %');
|
377 |
}
|
378 |
+
});
|
379 |
}
|
380 |
}
|
381 |
QSM.savePage( quizID, pageNumber );
|
394 |
nextPage: function( quizID ) {
|
395 |
if ( qmnValidatePage( 'quizForm' + quizID ) ) {
|
396 |
QSM.changePage( quizID, 1 );
|
397 |
+
}
|
398 |
},
|
399 |
prevPage: function( quizID ) {
|
400 |
QSM.changePage( quizID, -1 );
|
415 |
* @param jQueryObject The jQuery version of an element. i.e. $('#quizForm3')
|
416 |
*/
|
417 |
scrollTo: function( $element ) {
|
418 |
+
jQuery( 'html, body' ).animate(
|
419 |
+
{
|
420 |
scrollTop: $element.offset().top - 150
|
421 |
+
},
|
422 |
1000 );
|
423 |
},
|
424 |
/**
|
426 |
*/
|
427 |
getQuizForm: function( quizID ) {
|
428 |
return $( '#quizForm' + quizID );
|
429 |
+
}
|
430 |
};
|
431 |
|
432 |
QSMPageTimer = {
|
578 |
qmnInit();
|
579 |
|
580 |
// Call main initialization.
|
581 |
+
QSM.init();
|
582 |
});
|
583 |
+
|
584 |
jQuery("input[name='timer_ms']").each(function(){
|
585 |
var timems = qsmTimeInMS();
|
586 |
jQuery(this).val(timems);
|
592 |
|
593 |
/**
|
594 |
* Validates an email ID.
|
595 |
+
*
|
596 |
* @param email The Email Id to validate.
|
597 |
* @returns Boolean
|
598 |
*/
|
611 |
* @returns {undefined}
|
612 |
*/
|
613 |
function qsmCheckMR(event, limit){
|
614 |
+
var checked = jQuery(event).parents('.quiz_section').find(':checkbox:checked').length;
|
615 |
if (checked > limit) {
|
616 |
event.checked = false;
|
617 |
}
|
665 |
var number_error = qmn_quiz_data[ quiz_id ].error_messages.number;
|
666 |
var empty_error = qmn_quiz_data[ quiz_id ].error_messages.empty;
|
667 |
var incorrect_error = qmn_quiz_data[ quiz_id ].error_messages.incorrect;
|
668 |
+
qmnResetError( quiz_form_id );
|
669 |
jQuery( element ).each(function(){
|
670 |
if ( jQuery( this ).attr( 'class' )) {
|
671 |
if( jQuery( this ).attr( 'class' ).indexOf( 'mlwEmail' ) !== -1 && this.value !== "" ) {
|
676 |
result = false;
|
677 |
}
|
678 |
}
|
679 |
+
var by_pass = true;
|
680 |
+
if( qmn_quiz_data[quiz_id].hasOwnProperty('skip_validation_time_expire') && qmn_quiz_data[quiz_id].skip_validation_time_expire == 0 ){
|
681 |
+
by_pass = false;
|
682 |
+
}
|
683 |
+
|
684 |
+
if ( localStorage.getItem( 'mlw_time_quiz' + quiz_id ) === null || localStorage.getItem( 'mlw_time_quiz'+quiz_id ) > 0.08 || by_pass === false ) {
|
685 |
|
686 |
if( jQuery( this ).attr( 'class' ).indexOf( 'mlwRequiredNumber' ) > -1 && this.value === "" && +this.value != NaN ) {
|
687 |
qmnDisplayError( number_error, jQuery( this ), quiz_form_id );
|
688 |
result = false;
|
689 |
}
|
690 |
+
|
691 |
if( jQuery( this ).attr( 'class' ).indexOf( 'mlwRequiredText' ) > -1 && this.value === "" ) {
|
692 |
qmnDisplayError( empty_error, jQuery( this ), quiz_form_id );
|
693 |
result = false;
|
715 |
}
|
716 |
}
|
717 |
if( jQuery( this ).attr( 'class' ).indexOf( 'qsmRequiredSelect' ) > -1 ) {
|
718 |
+
check_val = jQuery( this ).val();
|
719 |
if ( check_val == "No Answer Provided" ) {
|
720 |
qmnDisplayError( empty_error, jQuery( this ), quiz_form_id );
|
721 |
result = false;
|
732 |
if(grecaptcha.getResponse() == "") {
|
733 |
alert('ReCaptcha is missing');
|
734 |
result = false;
|
735 |
+
}
|
736 |
}
|
737 |
}
|
738 |
}
|
769 |
jQuery( '.mlw_qmn_quiz select' ).attr( 'disabled', false );
|
770 |
jQuery( '.mlw_qmn_question_comment' ).attr( 'disabled', false );
|
771 |
jQuery( '.mlw_answer_open_text' ).attr( 'disabled', false );
|
772 |
+
|
773 |
//Convert serialize data into index array
|
774 |
var unindexed_array = jQuery( '#' + quiz_form_id ).serializeArray();
|
775 |
var fd = new FormData();
|
777 |
fd.append(input.name,input.value);
|
778 |
});
|
779 |
fd.append("action", 'qmn_process_quiz');
|
780 |
+
|
781 |
+
|
782 |
qsmEndTimeTakenTimer();
|
783 |
if (qmn_quiz_data[quizID].hasOwnProperty('advanced_timer')) {
|
784 |
QSMPageTimer.endPageTimer(quiz_id);
|
799 |
qmnDisplayResults( JSON.parse( response ), quiz_form_id, $container );
|
800 |
}
|
801 |
});
|
802 |
+
|
803 |
return false;
|
804 |
}
|
805 |
|
927 |
page_number = parseInt(hiddem_page_number) + 1;
|
928 |
}
|
929 |
var total_questions = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('[class*="question-section-id-"]').length;
|
930 |
+
var total_page_number = Math.ceil(total_questions / pagination);
|
931 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val( page_number );
|
932 |
+
if(page_number > 0 && jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').length > 0){
|
933 |
if( page_number <= total_page_number ){
|
934 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').text('').text( page_number + ' out of ' + total_page_number);
|
935 |
+
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').show();
|
936 |
}else{
|
937 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
|
938 |
}
|
951 |
|
952 |
jQuery( quiz_form_id + " .quiz_section" ).hide();
|
953 |
jQuery( quiz_form_id + " .g-recaptcha" ).hide();
|
954 |
+
|
955 |
for (var i = 0; i < pagination; i++) {
|
956 |
if (i === 0 && previous === 0) {
|
957 |
slide_number = slide_number - pagination;
|
996 |
var hiddem_page_number = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val();
|
997 |
var page_number = parseInt(hiddem_page_number) - 1;
|
998 |
var total_questions = jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('[class*="question-section-id-"]').length;
|
999 |
+
var total_page_number = Math.ceil(total_questions / pagination);
|
1000 |
if(hiddem_page_number > 0 && jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').length > 0){
|
1001 |
if( page_number <= total_page_number ){
|
1002 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').text('').text( page_number + ' out of ' + total_page_number);
|
1004 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
|
1005 |
}else{
|
1006 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').show();
|
1007 |
+
}
|
1008 |
}else{
|
1009 |
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.pages_count').hide();
|
1010 |
}
|
1011 |
}
|
1012 |
+
jQuery( quiz_form_id ).closest( '.qmn_quiz_container' ).find('.current_page_hidden').val( page_number );
|
1013 |
qmnInitProgressbarOnClick(quiz_id, page_number, total_page_number);
|
1014 |
}
|
1015 |
|
1023 |
function qmnInitProgressbarOnClick(quiz_id, page_number, total_page_number){
|
1024 |
if ( '1' == qmn_quiz_data[ quiz_id ].progress_bar ) {
|
1025 |
var total_questions = jQuery( '#quizForm' + quiz_id ).closest( '.qmn_quiz_container' ).find('.quiz_section').length - 1;
|
1026 |
+
var pagination = qmn_quiz_data[quiz_id].pagination.amount;
|
1027 |
+
total_page_number = Math.ceil(total_questions / pagination);
|
1028 |
if(pagination === 1){
|
1029 |
total_page_number = total_page_number - 1;
|
1030 |
+
}
|
1031 |
+
var animate_value = page_number / total_page_number;
|
1032 |
+
if( animate_value <= 1){
|
1033 |
qmn_quiz_data[ quiz_id ].bar.animate( animate_value );
|
1034 |
var old_text = jQuery( '#qsm_progress_bar_' + quiz_id ).find( '.progressbar-text' ).text().replace(' %', '');
|
1035 |
var new_text = Math.round(animate_value * 100);
|
1079 |
.append( '<div class="qmn_page_counter_message"></div>' )
|
1080 |
.append( '<div class="qsm-progress-bar" id="qsm_progress_bar_'+ quiz_id +'" style="display:none;"><div class="progressbar-text"></div></div>' )
|
1081 |
.append( '<a class="qmn_btn mlw_qmn_quiz_link mlw_next" href="#">' + qmn_quiz_data[quiz_id].pagination.next_text + '</a>' );
|
1082 |
+
|
1083 |
if ( '1' == qmn_quiz_data[ quiz_id ].progress_bar ) {
|
1084 |
jQuery('#quizForm' + quiz_id).closest( '.qmn_quiz_container' ).find('.qsm-progress-bar').show();
|
1085 |
qmn_quiz_data[ quiz_id ].bar = new ProgressBar.Line('#qsm_progress_bar_' + quiz_id, {
|
1106 |
},
|
1107 |
from: {color: '#3498db'},
|
1108 |
to: {color: '#ED6A5A'},
|
1109 |
+
step: function(state, bar) {
|
1110 |
}
|
1111 |
});
|
1112 |
}
|
1113 |
+
|
1114 |
jQuery(".mlw_next").click(function(event) {
|
1115 |
event.preventDefault();
|
1116 |
var quiz_id = +jQuery( this ).closest( '.qmn_quiz_container' ).find( '.qmn_quiz_id' ).val();
|
1118 |
qmnNextSlide( qmn_quiz_data[quiz_id].pagination.amount, 1, '#quizForm' + quiz_id );
|
1119 |
}
|
1120 |
});
|
1121 |
+
|
1122 |
jQuery(".mlw_previous").click(function(event) {
|
1123 |
event.preventDefault();
|
1124 |
var quiz_id = +jQuery( this ).closest( '.qmn_quiz_container' ).find( '.qmn_quiz_id' ).val();
|
1125 |
qmnPrevSlide( qmn_quiz_data[quiz_id].pagination.amount, 1, '#quizForm' + quiz_id );
|
1126 |
});
|
1127 |
+
|
1128 |
if ( qmn_quiz_data[quiz_id].first_page ) {
|
1129 |
qmnNextSlide( 1, 0, '#quizForm' + quiz_id );
|
1130 |
} else {
|
1131 |
qmnNextSlide( qmn_quiz_data[quiz_id].pagination.amount, 0, '#quizForm' + quiz_id );
|
1132 |
}
|
1133 |
+
|
1134 |
}
|
1135 |
|
1136 |
function qmnSocialShare( network, mlw_qmn_social_text, mlw_qmn_title, facebook_id, share_url ) {
|
1154 |
|
1155 |
jQuery(function() {
|
1156 |
jQuery( '.qmn_quiz_container' ).tooltip();
|
1157 |
+
|
1158 |
jQuery( '.qmn_quiz_container input' ).on( 'keypress', function ( e ) {
|
1159 |
if ( e.which === 13 ) {
|
1160 |
e.preventDefault();
|
1161 |
}
|
1162 |
});
|
1163 |
+
|
1164 |
// jQuery( '.qmn_quiz_form' ).on( "submit", function( event ) {
|
1165 |
jQuery(document).on( 'click', ".qsm-submit-btn", function( event ) {
|
1166 |
event.preventDefault();
|
1167 |
var form = jQuery(this).closest('form')[0];
|
1168 |
qmnFormSubmit( form.id );
|
1169 |
});
|
1170 |
+
|
1171 |
jQuery(document).on('click','.btn-reload-quiz',function(e){
|
1172 |
e.preventDefault();
|
1173 |
var quiz_id = jQuery(this).data('quiz_id');
|
1177 |
type: 'POST',
|
1178 |
url: qmn_ajax_object.ajaxurl,
|
1179 |
data: {
|
1180 |
+
action: "qsm_get_quiz_to_reload",
|
1181 |
quiz_id: quiz_id,
|
1182 |
},
|
1183 |
+
success: function (response) {
|
1184 |
parent_div.replaceWith(response);
|
1185 |
// Restart the timer for retake quiz.
|
1186 |
setInterval( qmnTimeTakenTimer, 1000 );
|
1187 |
+
|
1188 |
// Reset the timer clock on retake quiz.
|
1189 |
QSM.initTimer( quiz_id );
|
1190 |
+
|
1191 |
QSM.initPagination( quiz_id );
|
1192 |
},
|
1193 |
error: function (errorThrown) {
|
1196 |
}
|
1197 |
});
|
1198 |
});
|
1199 |
+
|
1200 |
jQuery(document).on('change','.qmn_radio_answers input',function(e){
|
1201 |
if(qmn_ajax_object.enable_quick_result_mc == 1){
|
1202 |
+
var question_id = jQuery(this).attr('name').split('question')[1],
|
1203 |
value = jQuery(this).val(),
|
1204 |
$this = jQuery(this).parents('.quiz_section');
|
1205 |
+
|
1206 |
jQuery.ajax({
|
1207 |
type: 'POST',
|
1208 |
url: qmn_ajax_object.ajaxurl,
|
1209 |
data: {
|
1210 |
+
action: "qsm_get_question_quick_result",
|
1211 |
question_id: question_id,
|
1212 |
answer: value,
|
1213 |
},
|
1217 |
$this.append('<p style="color: green" class="quick-question-res-p">' + qmn_ajax_object.quick_result_correct_text + '</p>')
|
1218 |
}else if(response == 'incorrect'){
|
1219 |
$this.append('<p style="color: red" class="quick-question-res-p">' + qmn_ajax_object.quick_result_wrong_text + '</p>')
|
1220 |
+
}
|
1221 |
},
|
1222 |
error: function (errorThrown) {
|
1223 |
alert(errorThrown);
|
1225 |
});
|
1226 |
}
|
1227 |
});
|
1228 |
+
|
1229 |
/*jQuery('.qmn_radio_answers > .qmn_mc_answer_wrap').on('click',function(event){
|
1230 |
+
var radButton = jQuery(this).find('input[type=radio]');
|
1231 |
if(event.target.className == 'qmn_quiz_radio'){
|
1232 |
return true;
|
1233 |
}
|
1247 |
form_data.append('action', 'qsm_upload_image_fd_question');
|
1248 |
var question_id = $this.parent('.quiz_section').find('.mlw_file_upload_hidden_value').attr("name").replace('question','');
|
1249 |
form_data.append('question_id', question_id);
|
1250 |
+
$this.next('.loading-uploaded-file').show();
|
1251 |
jQuery.ajax({
|
1252 |
url: qmn_ajax_object.ajaxurl,
|
1253 |
type: 'POST',
|
1257 |
processData: false,
|
1258 |
success: function (response) {
|
1259 |
var obj = jQuery.parseJSON(response);
|
1260 |
+
$this.next('.loading-uploaded-file').hide();
|
1261 |
if(obj.type == 'success'){
|
1262 |
+
$this.next().next('.remove-uploaded-file').show();
|
1263 |
+
$this.next().next().next('.mlw_file_upload_hidden_value').val(obj.file_url);
|
1264 |
$this.parent('.quiz_section').find('.mlw_file_upload_hidden_path').val(obj.file_path);
|
1265 |
$this.parent('.quiz_section').find('.mlw-file-upload-error-msg').hide();
|
1266 |
}else{
|
1272 |
});
|
1273 |
return false;
|
1274 |
});
|
1275 |
+
|
1276 |
//Ajax remove file code
|
1277 |
jQuery('.quiz_section .remove-uploaded-file').on('click', function(){
|
1278 |
var $this = jQuery(this);
|
1279 |
var file_data = jQuery(this).parent('.quiz_section').find('.mlw_file_upload_hidden_path').val();
|
1280 |
var form_data = new FormData();
|
1281 |
form_data.append('action', 'qsm_remove_file_fd_question');
|
1282 |
+
form_data.append('file_url', file_data);
|
1283 |
jQuery.ajax({
|
1284 |
url: qmn_ajax_object.ajaxurl,
|
1285 |
type: 'POST',
|
1303 |
});
|
1304 |
return false;
|
1305 |
});
|
1306 |
+
|
1307 |
//Deselect all answer on select
|
1308 |
jQuery('.qsm-deselect-answer').click(function(e){
|
1309 |
e.preventDefault();
|
1310 |
jQuery(this).parents('.quiz_section').find('input[type="radio"]').prop('checked', false);
|
1311 |
});
|
1312 |
+
|
1313 |
//Submit the form on popup click
|
1314 |
jQuery(document).on( 'click', '.submit-the-form', function(e) {
|
1315 |
e.preventDefault();
|
@@ -2,14 +2,14 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Quiz And Survey Master
|
4 |
* Description: Easily and quickly add quizzes and surveys to your website.
|
5 |
-
* Version: 7.0.
|
6 |
* Author: ExpressTech
|
7 |
* Author URI: https://quizandsurveymaster.com/
|
8 |
* Plugin URI: https://expresstech.io/
|
9 |
* Text Domain: quiz-master-next
|
10 |
*
|
11 |
* @author QSM Team
|
12 |
-
* @version 7.0.
|
13 |
* @package QSM
|
14 |
*/
|
15 |
|
@@ -37,7 +37,7 @@ class MLWQuizMasterNext {
|
|
37 |
* @var string
|
38 |
* @since 4.0.0
|
39 |
*/
|
40 |
-
public $version = '7.0.
|
41 |
|
42 |
/**
|
43 |
* QSM Alert Manager Object
|
2 |
/**
|
3 |
* Plugin Name: Quiz And Survey Master
|
4 |
* Description: Easily and quickly add quizzes and surveys to your website.
|
5 |
+
* Version: 7.0.1
|
6 |
* Author: ExpressTech
|
7 |
* Author URI: https://quizandsurveymaster.com/
|
8 |
* Plugin URI: https://expresstech.io/
|
9 |
* Text Domain: quiz-master-next
|
10 |
*
|
11 |
* @author QSM Team
|
12 |
+
* @version 7.0.1
|
13 |
* @package QSM
|
14 |
*/
|
15 |
|
37 |
* @var string
|
38 |
* @since 4.0.0
|
39 |
*/
|
40 |
+
public $version = '7.0.1';
|
41 |
|
42 |
/**
|
43 |
* QSM Alert Manager Object
|
@@ -20,8 +20,16 @@ function qmn_addons_page() {
|
|
20 |
wp_enqueue_style( 'qsm_admin_style', plugins_url( '../../css/qsm-admin.css', __FILE__ ), array(), $mlwQuizMasterNext->version );
|
21 |
?>
|
22 |
<div class="wrap qsm-addon-setting-wrap">
|
23 |
-
<h2
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
<?php
|
26 |
foreach ($tab_array as $tab) {
|
27 |
$active_class = '';
|
@@ -52,64 +60,168 @@ function qmn_addons_page() {
|
|
52 |
* @since 4.4.0
|
53 |
*/
|
54 |
function qsm_generate_featured_addons() {
|
55 |
-
|
|
|
|
|
56 |
?>
|
57 |
-
<
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
<?php
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
}
|
70 |
-
$cateory_arr[$category_addon][] = $value;
|
71 |
-
}
|
72 |
-
}
|
73 |
-
if ($cateory_arr) {
|
74 |
-
foreach ($cateory_arr as $cat_name => $cat_value) {
|
75 |
?>
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
|
|
|
|
85 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
}
|
87 |
-
|
88 |
-
|
89 |
</div>
|
90 |
-
<a href="http://quizandsurveymaster.com/addons/?utm_source=qsm-addons-page&utm_medium=plugin&utm_content=all-addons-bottom&utm_campaign=qsm_plugin" target="_blank" class="button-primary" style="margin-top: 20px !important;"><?php _e('Browse All Addons', 'quiz-master-next'); ?></a>
|
91 |
</div>
|
92 |
-
<div class="qsm-news-ads">
|
93 |
-
<h3 class="qsm-news-ads-title">QSM Bundle</h3>
|
94 |
<?php
|
95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
?>
|
97 |
-
<div class="qsm-info-widget">
|
98 |
-
<h3><?php echo $xml->qsm_bundle->starter_bundle->name; ?></h3>
|
99 |
-
<p><?php echo $xml->qsm_bundle->starter_bundle->desc; ?></p>
|
100 |
-
<button class="button button-default">$<?php echo $xml->qsm_bundle->starter_bundle->price; ?></button>
|
101 |
-
<a target="_blank" href="<?php echo $xml->qsm_bundle->starter_bundle->link; ?>?utm_source=qsm-addons-page&utm_medium=plugin&utm_content=all-addons-top&utm_campaign=qsm_plugin" class="button-primary">Get Now</a>
|
102 |
-
</div>
|
103 |
-
<div class="qsm-info-widget">
|
104 |
-
<h3><?php echo $xml->qsm_bundle->premium_bundle->name; ?></h3>
|
105 |
-
<p><?php echo $xml->qsm_bundle->premium_bundle->desc; ?></p>
|
106 |
-
<button class="button button-default">$<?php echo $xml->qsm_bundle->premium_bundle->price; ?></button>
|
107 |
-
<a target="_blank" href="<?php echo $xml->qsm_bundle->premium_bundle->link; ?>?utm_source=qsm-addons-page&utm_medium=plugin&utm_content=all-addons-top&utm_campaign=qsm_plugin" class="button-primary">Get Now</a>
|
108 |
-
</div>
|
109 |
-
<?php } ?>
|
110 |
-
<!-- <div class="remove-ads-adv-link">
|
111 |
-
<a target="_blank" href="https://quizandsurveymaster.com/downloads/advertisement-gone/"><span class="dashicons dashicons-no-alt"></span> Remove Ads</a>
|
112 |
-
</div> -->
|
113 |
</div>
|
114 |
<?php
|
115 |
}
|
@@ -149,9 +261,9 @@ function qsm_display_optin_page() {
|
|
149 |
<div class="about-body">
|
150 |
<img src="" alt="Improved Custom Fields">
|
151 |
</div>
|
152 |
-
</div> -->
|
153 |
</div>
|
154 |
-
|
155 |
<p><?php echo sprintf(__('Getting your addon is dead simple: just subscribe to our newsletter and then you will get the free addon by e-mail. We will not spam you. We usually send out newsletters to talk about new features in <b>Quiz and Survey Master</b>, let you know when new or updated addons are being released and provide informative articles that show you how to use <b>Quiz and Survey Master</b> to its full potential. <a href="%s" %s>View our privacy policy</a>', 'quiz-master-next'), 'https://quizandsurveymaster.com/privacy-policy/', 'target="_blank"'); ?></p>
|
156 |
|
157 |
<div id="wpas-mailchimp-signup-form-wrapper">
|
@@ -209,7 +321,7 @@ function qsm_display_optin_page() {
|
|
209 |
/>
|
210 |
</svg>
|
211 |
<span class="sib-form-message-panel__inner-text">
|
212 |
-
Your subscription could not be saved. Please try again.
|
213 |
</span>
|
214 |
</div>
|
215 |
</div>
|
@@ -221,20 +333,20 @@ function qsm_display_optin_page() {
|
|
221 |
/>
|
222 |
</svg>
|
223 |
<span class="sib-form-message-panel__inner-text">
|
224 |
-
|
225 |
</span>
|
226 |
</div>
|
227 |
</div>
|
228 |
<div></div>
|
229 |
<div id="sib-container" class="sib-container--large sib-container--vertical" style="text-align:center; background-color:rgba(255,255,255,1); max-width:540px; border-radius:3px; border-width:1px; border-color:#C0CCD9; border-style:solid;">
|
230 |
<form id="sib-form" method="POST" action="https://cddf18fd.sibforms.com/serve/MUIEAO9t8eOB2GOqY73EWqFatPi328RiosfYMKieZ_8IxVL2jyEazmQ9LlkDj6pYrTlvB7JBsx3su8WdK5A4l445X0P-0r0Qf82LWXLSFa3yK0YZuypiIxy8hZfBXClZMANBeEVpBkswLw0RxDt2uWrN7B7zHTFXWY0W4mftpWo3Nqen7SQW1L9DYnXrex6lyw5EfHvZ3ZwsU6Xp"
|
231 |
-
data-type="subscription">
|
232 |
<div style="padding: 16px 0;">
|
233 |
<div class="sib-input sib-form-block">
|
234 |
<div class="form__entry entry_block">
|
235 |
<div class="form__label-row ">
|
236 |
<label class="entry__label" style="font-size:16px; text-align:left; font-weight:700; font-family:Helvetica, sans-serif; color:#3c4858; border-width:px;" for="EMAIL" data-required="*">
|
237 |
-
Enter your email address to subscribe
|
238 |
</label>
|
239 |
|
240 |
<div class="entry__field">
|
@@ -245,7 +357,7 @@ function qsm_display_optin_page() {
|
|
245 |
<label class="entry__error entry__error--primary" style="font-size:16px; text-align:left; font-family:Helvetica, sans-serif; color:#661d1d; background-color:#ffeded; border-radius:3px; border-width:px; border-color:#ff4949;">
|
246 |
</label>
|
247 |
<label class="entry__specification" style="font-size:12px; text-align:left; font-family:Helvetica, sans-serif; color:#8390A4; border-width:px;">
|
248 |
-
|
249 |
</label>
|
250 |
</div>
|
251 |
</div>
|
@@ -258,7 +370,7 @@ function qsm_display_optin_page() {
|
|
258 |
<path d="M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z"
|
259 |
/>
|
260 |
</svg>
|
261 |
-
SUBSCRIBE
|
262 |
</button>
|
263 |
</div>
|
264 |
</div>
|
@@ -266,7 +378,7 @@ function qsm_display_optin_page() {
|
|
266 |
<div class="sib-form-block" style="font-size:14px; text-align:center; font-family:Helvetica, sans-serif; color:#333; background-color:transparent; border-width:px;">
|
267 |
<div class="sib-text-form-block">
|
268 |
<p>
|
269 |
-
<a href="https://sendinblue.com" target="_blank"
|
270 |
</p>
|
271 |
</div>
|
272 |
</div>
|
@@ -306,7 +418,7 @@ function qsm_display_optin_page() {
|
|
306 |
</script>
|
307 |
<script src="https://www.google.com/recaptcha/api.js?hl=en"></script>
|
308 |
<!-- END - We recommend to place the above code in footer or bottom of your website html -->
|
309 |
-
<!-- End Sendinblue Form -->
|
310 |
</div>
|
311 |
</div>
|
312 |
|
20 |
wp_enqueue_style( 'qsm_admin_style', plugins_url( '../../css/qsm-admin.css', __FILE__ ), array(), $mlwQuizMasterNext->version );
|
21 |
?>
|
22 |
<div class="wrap qsm-addon-setting-wrap">
|
23 |
+
<h2 style="margin-bottom: 20px;">
|
24 |
+
<?php _e('QSM Addon Settings', 'quiz-master-next'); ?>
|
25 |
+
<?php
|
26 |
+
if( isset( $_GET['tab'] ) && $_GET['tab'] != '' ){ ?>
|
27 |
+
<a class="button button-default" href="?page=qmn_addons"><span style="margin-top: 4px;" class="dashicons dashicons-arrow-left-alt"></span> <?php _e('Back to list', 'quiz-master-next'); ?></a>
|
28 |
+
<?php
|
29 |
+
}
|
30 |
+
?>
|
31 |
+
</h2>
|
32 |
+
<h2 class="nav-tab-wrapper" style="display: none;">
|
33 |
<?php
|
34 |
foreach ($tab_array as $tab) {
|
35 |
$active_class = '';
|
60 |
* @since 4.4.0
|
61 |
*/
|
62 |
function qsm_generate_featured_addons() {
|
63 |
+
global $mlwQuizMasterNext;
|
64 |
+
wp_enqueue_script( 'qsm_admin_script', plugins_url( '../../js/admin.js', __FILE__ ), array( 'jquery' ), $mlwQuizMasterNext->version );
|
65 |
+
$tab_array = $mlwQuizMasterNext->pluginHelper->get_addon_tabs();
|
66 |
?>
|
67 |
+
<div class="qsm-active-addons">
|
68 |
+
<h2 class="installed_title"><?php _e('Installed Addons', 'quiz-master-next'); ?></h2>
|
69 |
+
<?php
|
70 |
+
if( $tab_array && count( $tab_array ) > 1 ){ ?>
|
71 |
+
<div class="installed_addons_wrapper">
|
72 |
+
<?php
|
73 |
+
foreach ($tab_array as $tab) {
|
74 |
+
if( trim( $tab['title'] ) == 'Featured Addons' ){
|
75 |
+
continue;
|
76 |
+
}
|
77 |
+
?>
|
78 |
+
<div class="installed_addon">
|
79 |
+
<span class="installed_addon_name"><?php echo $tab['title']; ?></span>
|
80 |
+
<span class="installed_addon_link">
|
81 |
+
<a class="button button-default" href="?page=qmn_addons&tab=<?php echo $tab['slug']; ?>"><span class="dashicons dashicons-admin-generic"></span> <?php _e('Settings', 'quiz-master-next'); ?></a>
|
82 |
+
</span>
|
83 |
+
</div>
|
84 |
+
<?php } ?>
|
85 |
+
</div>
|
86 |
<?php
|
87 |
+
} else { ?>
|
88 |
+
<div class="no_addons_installed">
|
89 |
+
<?php
|
90 |
+
_e('You have currently not installed any addons. Explore our addons repository with 40+ addons to make your quiz even better.', 'quiz-master-next');
|
91 |
+
?>
|
92 |
+
</div>
|
93 |
+
<?php }
|
94 |
+
?>
|
95 |
+
</div>
|
96 |
+
<div class="qsm-addon-browse-addons">
|
97 |
+
<div class="qsm-addon-anchor-left">
|
98 |
+
<a class="active" href="#qsm_popular_addons"><?php _e('Popular Addons', 'quiz-master-next'); ?></a>
|
99 |
+
<a href="#qsm_onsale_addons"><?php _e('On Sale Addons', 'quiz-master-next'); ?></a>
|
100 |
+
<a href="#qsm_new_addons"><?php _e('Recently Updated Addons', 'quiz-master-next'); ?></a>
|
101 |
+
</div>
|
102 |
+
<div class="qsm-addon-list-right">
|
103 |
+
<span><?php _e('40+ addons available', 'quiz-master-next'); ?></span>
|
104 |
+
<a href="http://quizandsurveymaster.com/addons/?utm_source=qsm-addons-page&utm_medium=plugin&utm_content=all-addons-top&utm_campaign=qsm_plugin" target="_blank" class="button-primary"><?php _e('Browse All Addons', 'quiz-master-next'); ?></a>
|
105 |
+
</div>
|
106 |
+
</div>
|
107 |
+
<div class="qsm-quiz-page-addon qsm-addon-page-list">
|
108 |
+
<?php
|
109 |
+
$popular_addons = qsm_get_widget_data('popular_products');
|
110 |
+
if( empty( $popular_addons ) ){
|
111 |
+
$qsm_admin_dd = qsm_fetch_data_from_script();
|
112 |
+
$popular_addons = isset( $qsm_admin_dd['popular_products'] ) ? $qsm_admin_dd['popular_products'] : array();
|
113 |
+
}
|
114 |
+
?>
|
115 |
+
<div class="qsm_popular_addons" id="qsm_popular_addons">
|
116 |
+
<div class="popuar-addon-ul">
|
117 |
+
<?php
|
118 |
+
if ( $popular_addons ) {
|
119 |
+
foreach ( $popular_addons as $key => $single_arr ) {
|
120 |
+
?>
|
121 |
+
<div>
|
122 |
+
<a href="<?php echo $single_arr['link']; ?>" target="_blank">
|
123 |
+
<img src="<?php echo $single_arr['img']; ?>" title="<?php echo $single_arr['name']; ?>">
|
124 |
+
</a>
|
125 |
+
<div class="description-wrap">
|
126 |
+
<span class="description"><?php echo $single_arr['description']; ?></span>
|
127 |
+
<button class="button button-primary">$<?php echo array_values($single_arr['price'])[0]; ?></button>
|
128 |
+
<a href="<?php echo $single_arr['link']; ?>?utm_source=qsm-addons-page&utm_medium=plugin&utm_content=all-addons-top&utm_campaign=qsm_plugin" target="_blank" class="button button-primary"><?php _e('Get This Addon', 'quiz-master-next'); ?></a>
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
<?php
|
132 |
+
}
|
133 |
}
|
|
|
|
|
|
|
|
|
|
|
134 |
?>
|
135 |
+
</div>
|
136 |
+
</div>
|
137 |
+
<div class="qsm_popular_addons" id="qsm_onsale_addons" style="display: none;">
|
138 |
+
<?php
|
139 |
+
$qsm_onsale_addons = qsm_get_widget_data('on_sale_products');
|
140 |
+
if( empty( $qsm_onsale_addons ) ){
|
141 |
+
$qsm_admin_dd = qsm_fetch_data_from_script();
|
142 |
+
$qsm_onsale_addons = isset( $qsm_admin_dd['on_sale_products'] ) ? $qsm_admin_dd['on_sale_products'] : array();
|
143 |
+
}
|
144 |
+
?>
|
145 |
+
<div class="popuar-addon-ul">
|
146 |
<?php
|
147 |
+
if ( $qsm_onsale_addons ) {
|
148 |
+
foreach ( $qsm_onsale_addons as $key => $single_arr ) {
|
149 |
+
?>
|
150 |
+
<div>
|
151 |
+
<a href="<?php echo $single_arr['link']; ?>" target="_blank">
|
152 |
+
<img src="<?php echo $single_arr['img']; ?>" title="<?php echo $single_arr['name']; ?>">
|
153 |
+
</a>
|
154 |
+
<div class="description-wrap">
|
155 |
+
<span class="description"><?php echo $single_arr['description']; ?></span>
|
156 |
+
<button class="button button-primary">$<?php echo array_values($single_arr['price'])[0]; ?></button>
|
157 |
+
<a href="<?php echo $single_arr['link']; ?>?utm_source=qsm-addons-page&utm_medium=plugin&utm_content=all-addons-top&utm_campaign=qsm_plugin" target="_blank" class="button button-primary"><?php _e('Get This Addon', 'quiz-master-next'); ?></a>
|
158 |
+
</div>
|
159 |
+
</div>
|
160 |
+
<?php
|
161 |
+
}
|
162 |
+
}
|
163 |
+
?>
|
164 |
+
</div>
|
165 |
+
</div>
|
166 |
+
<div class="qsm_popular_addons" id="qsm_new_addons" style="display: none;">
|
167 |
+
<?php
|
168 |
+
$new_addons = qsm_get_widget_data('new_addons');
|
169 |
+
if( empty( $popular_addons ) ){
|
170 |
+
$qsm_admin_dd = qsm_fetch_data_from_script();
|
171 |
+
$new_addons = isset( $qsm_admin_dd['new_addons'] ) ? $qsm_admin_dd['new_addons'] : array();
|
172 |
+
}
|
173 |
+
?>
|
174 |
+
<div class="popuar-addon-ul">
|
175 |
+
<?php
|
176 |
+
if ( $new_addons ) {
|
177 |
+
foreach ( $new_addons as $key => $single_arr ) {
|
178 |
+
if( trim( $single_arr['name'] ) == 'Starter Bundle' || trim( $single_arr['name'] ) == 'Premium Bundle' ){
|
179 |
+
continue;
|
180 |
+
}
|
181 |
+
?>
|
182 |
+
<div>
|
183 |
+
<a href="<?php echo $single_arr['link']; ?>" target="_blank">
|
184 |
+
<img src="<?php echo $single_arr['img']; ?>" title="<?php echo $single_arr['name']; ?>">
|
185 |
+
</a>
|
186 |
+
<div class="description-wrap">
|
187 |
+
<?php if( isset($single_arr['description']) && $single_arr['description'] != '' ){ ?>
|
188 |
+
<span class="description"><?php echo $single_arr['description']; ?></span>
|
189 |
+
<?php } ?>
|
190 |
+
<button class="button button-primary">$<?php echo array_values($single_arr['price'])[0]; ?></button>
|
191 |
+
<a href="<?php echo $single_arr['link']; ?>?utm_source=qsm-addons-page&utm_medium=plugin&utm_content=all-addons-top&utm_campaign=qsm_plugin" target="_blank" class="button button-primary"><?php _e('Get This Addon', 'quiz-master-next'); ?></a>
|
192 |
+
</div>
|
193 |
+
</div>
|
194 |
+
<?php
|
195 |
+
}
|
196 |
}
|
197 |
+
?>
|
198 |
+
</div>
|
199 |
</div>
|
|
|
200 |
</div>
|
201 |
+
<div class="qsm-addon-news-ads">
|
|
|
202 |
<?php
|
203 |
+
$bundles = qsm_get_widget_data('bundles');
|
204 |
+
if( empty( $bundles ) ){
|
205 |
+
$qsm_admin_dd = qsm_fetch_data_from_script();
|
206 |
+
$bundles = isset( $qsm_admin_dd['bundles'] ) ? $qsm_admin_dd['bundles'] : array();
|
207 |
+
}
|
208 |
+
?>
|
209 |
+
<?php
|
210 |
+
if( $bundles ){
|
211 |
+
?>
|
212 |
+
<h3 class="qsm-news-ads-title"><?php _e('SAVE WITH OUR BUNDLES', 'quiz-master-next'); ?></h3>
|
213 |
+
<?php
|
214 |
+
foreach ($bundles as $key => $bundles_arr) { ?>
|
215 |
+
<div class="qsm-info-widget" style="background-color: <?php echo $bundles_arr['background']; ?>">
|
216 |
+
<h3><?php echo $bundles_arr['name']; ?></h3>
|
217 |
+
<p><?php echo $bundles_arr['desc']; ?></p>
|
218 |
+
<button class="button button-default">$<?php echo array_values($bundles_arr['price'])[0]; ?></button>
|
219 |
+
<a target="_blank" href="<?php echo $bundles_arr['link']; ?>?utm_source=qsm-addons-page&utm_medium=plugin&utm_content=all-addons-top&utm_campaign=qsm_plugin" class="button-primary"><?php _e('Get Now', 'quiz-master-next'); ?></a>
|
220 |
+
</div>
|
221 |
+
<?php
|
222 |
+
}
|
223 |
+
}
|
224 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
</div>
|
226 |
<?php
|
227 |
}
|
261 |
<div class="about-body">
|
262 |
<img src="" alt="Improved Custom Fields">
|
263 |
</div>
|
264 |
+
</div> -->
|
265 |
</div>
|
266 |
+
|
267 |
<p><?php echo sprintf(__('Getting your addon is dead simple: just subscribe to our newsletter and then you will get the free addon by e-mail. We will not spam you. We usually send out newsletters to talk about new features in <b>Quiz and Survey Master</b>, let you know when new or updated addons are being released and provide informative articles that show you how to use <b>Quiz and Survey Master</b> to its full potential. <a href="%s" %s>View our privacy policy</a>', 'quiz-master-next'), 'https://quizandsurveymaster.com/privacy-policy/', 'target="_blank"'); ?></p>
|
268 |
|
269 |
<div id="wpas-mailchimp-signup-form-wrapper">
|
321 |
/>
|
322 |
</svg>
|
323 |
<span class="sib-form-message-panel__inner-text">
|
324 |
+
<?php _e('Your subscription could not be saved. Please try again.', 'quiz-master-next'); ?>
|
325 |
</span>
|
326 |
</div>
|
327 |
</div>
|
333 |
/>
|
334 |
</svg>
|
335 |
<span class="sib-form-message-panel__inner-text">
|
336 |
+
<?php _e('Your subscription has been successful.', 'quiz-master-next'); ?>
|
337 |
</span>
|
338 |
</div>
|
339 |
</div>
|
340 |
<div></div>
|
341 |
<div id="sib-container" class="sib-container--large sib-container--vertical" style="text-align:center; background-color:rgba(255,255,255,1); max-width:540px; border-radius:3px; border-width:1px; border-color:#C0CCD9; border-style:solid;">
|
342 |
<form id="sib-form" method="POST" action="https://cddf18fd.sibforms.com/serve/MUIEAO9t8eOB2GOqY73EWqFatPi328RiosfYMKieZ_8IxVL2jyEazmQ9LlkDj6pYrTlvB7JBsx3su8WdK5A4l445X0P-0r0Qf82LWXLSFa3yK0YZuypiIxy8hZfBXClZMANBeEVpBkswLw0RxDt2uWrN7B7zHTFXWY0W4mftpWo3Nqen7SQW1L9DYnXrex6lyw5EfHvZ3ZwsU6Xp"
|
343 |
+
data-type="subscription">
|
344 |
<div style="padding: 16px 0;">
|
345 |
<div class="sib-input sib-form-block">
|
346 |
<div class="form__entry entry_block">
|
347 |
<div class="form__label-row ">
|
348 |
<label class="entry__label" style="font-size:16px; text-align:left; font-weight:700; font-family:Helvetica, sans-serif; color:#3c4858; border-width:px;" for="EMAIL" data-required="*">
|
349 |
+
<?php _e('Enter your email address to subscribe', 'quiz-master-next'); ?>
|
350 |
</label>
|
351 |
|
352 |
<div class="entry__field">
|
357 |
<label class="entry__error entry__error--primary" style="font-size:16px; text-align:left; font-family:Helvetica, sans-serif; color:#661d1d; background-color:#ffeded; border-radius:3px; border-width:px; border-color:#ff4949;">
|
358 |
</label>
|
359 |
<label class="entry__specification" style="font-size:12px; text-align:left; font-family:Helvetica, sans-serif; color:#8390A4; border-width:px;">
|
360 |
+
<?php _e('Provide your email address to subscribe. For e.g abc@xyz.com', 'quiz-master-next'); ?>
|
361 |
</label>
|
362 |
</div>
|
363 |
</div>
|
370 |
<path d="M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z"
|
371 |
/>
|
372 |
</svg>
|
373 |
+
<?php _e('SUBSCRIBE', 'quiz-master-next'); ?>
|
374 |
</button>
|
375 |
</div>
|
376 |
</div>
|
378 |
<div class="sib-form-block" style="font-size:14px; text-align:center; font-family:Helvetica, sans-serif; color:#333; background-color:transparent; border-width:px;">
|
379 |
<div class="sib-text-form-block">
|
380 |
<p>
|
381 |
+
<a href="https://sendinblue.com" target="_blank"><?php _e('Terms & Privacy policy', 'quiz-master-next'); ?></a>
|
382 |
</p>
|
383 |
</div>
|
384 |
</div>
|
418 |
</script>
|
419 |
<script src="https://www.google.com/recaptcha/api.js?hl=en"></script>
|
420 |
<!-- END - We recommend to place the above code in footer or bottom of your website html -->
|
421 |
+
<!-- End Sendinblue Form -->
|
422 |
</div>
|
423 |
</div>
|
424 |
|
@@ -7,16 +7,25 @@ function qsm_get_widget_data( $name ){
|
|
7 |
$get_dashboard_data = get_transient( 'qsm_admin_dashboard_data' );
|
8 |
if($get_dashboard_data !== false && !empty( $get_dashboard_data ) ){
|
9 |
$qsm_admin_dd = $get_dashboard_data;
|
10 |
-
}else{
|
11 |
-
$
|
12 |
-
|
13 |
-
$qsm_admin_dd = wp_remote_retrieve_body( $fetch_api_data );
|
14 |
-
$qsm_admin_dd = json_decode( $qsm_admin_dd, true );
|
15 |
-
set_transient( 'qsm_admin_dashboard_data', $qsm_admin_dd, 24*60*60 );
|
16 |
-
}
|
17 |
}
|
18 |
return isset( $qsm_admin_dd[$name] ) ? $qsm_admin_dd[$name] : array();
|
19 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
/**
|
21 |
* @since 7.0
|
22 |
* @param str $widget_id
|
@@ -131,7 +140,7 @@ function qsm_generate_dashboard_page() {
|
|
131 |
<div class="welcome-panel-column welcome-panel-last">
|
132 |
<h3><?php _e( 'Useful Links', 'quiz-master-next' ); ?></h3>
|
133 |
<ul>
|
134 |
-
<li><a target="_blank" href="https://
|
135 |
<li><a target="_blank" href="https://github.com/QuizandSurveyMaster/quiz_master_next" class="welcome-icon"><span class="dashicons dashicons-editor-code"></span> <?php _e( 'Github Repository', 'quiz-master-next' ); ?></a></li>
|
136 |
</ul>
|
137 |
</div>
|
@@ -304,7 +313,7 @@ function qsm_dashboard_popular_addon( $widget_id ) {
|
|
304 |
foreach ( $addon_array as $key => $single_arr ) {
|
305 |
?>
|
306 |
<li>
|
307 |
-
<a href="<?php echo $single_arr['link'];
|
308 |
<img src="<?php echo $single_arr['img']; ?>" title="<?php echo $single_arr['name']; ?>">
|
309 |
</a>
|
310 |
</li>
|
7 |
$get_dashboard_data = get_transient( 'qsm_admin_dashboard_data' );
|
8 |
if($get_dashboard_data !== false && !empty( $get_dashboard_data ) ){
|
9 |
$qsm_admin_dd = $get_dashboard_data;
|
10 |
+
}else{
|
11 |
+
$qsm_admin_dd = qsm_fetch_data_from_script();
|
12 |
+
set_transient( 'qsm_admin_dashboard_data', $qsm_admin_dd, 24*60*60 );
|
|
|
|
|
|
|
|
|
13 |
}
|
14 |
return isset( $qsm_admin_dd[$name] ) ? $qsm_admin_dd[$name] : array();
|
15 |
}
|
16 |
+
|
17 |
+
function qsm_fetch_data_from_script(){
|
18 |
+
$args = array(
|
19 |
+
'timeout' => 10,
|
20 |
+
'sslverify' => false
|
21 |
+
);
|
22 |
+
$fetch_api_data = wp_remote_get('https://quizandsurveymaster.com/wp-json/qsmps/get-data', $args);
|
23 |
+
if( is_array( $fetch_api_data ) && isset( $fetch_api_data['response'] ) && isset( $fetch_api_data['response']['code'] ) && $fetch_api_data['response']['code'] == 200 ){
|
24 |
+
$qsm_admin_dd = wp_remote_retrieve_body( $fetch_api_data );
|
25 |
+
return json_decode( $qsm_admin_dd, true );
|
26 |
+
}
|
27 |
+
return array();
|
28 |
+
}
|
29 |
/**
|
30 |
* @since 7.0
|
31 |
* @param str $widget_id
|
140 |
<div class="welcome-panel-column welcome-panel-last">
|
141 |
<h3><?php _e( 'Useful Links', 'quiz-master-next' ); ?></h3>
|
142 |
<ul>
|
143 |
+
<li><a target="_blank" href="https://quizandsurveymaster.com/contact-support/" class="welcome-icon"><span class="dashicons dashicons-admin-users"></span> <?php _e( 'Support Forum', 'quiz-master-next' ); ?></a></li>
|
144 |
<li><a target="_blank" href="https://github.com/QuizandSurveyMaster/quiz_master_next" class="welcome-icon"><span class="dashicons dashicons-editor-code"></span> <?php _e( 'Github Repository', 'quiz-master-next' ); ?></a></li>
|
145 |
</ul>
|
146 |
</div>
|
313 |
foreach ( $addon_array as $key => $single_arr ) {
|
314 |
?>
|
315 |
<li>
|
316 |
+
<a href="<?php echo $single_arr['link']; ?>?utm_source=qsm-dashoard-page&utm_medium=plugin&utm_content=all-addons-top&utm_campaign=qsm_plugin" target="_blank">
|
317 |
<img src="<?php echo $single_arr['img']; ?>" title="<?php echo $single_arr['name']; ?>">
|
318 |
</a>
|
319 |
</li>
|
@@ -90,6 +90,22 @@ function qsm_add_author_column_in_db() {
|
|
90 |
}
|
91 |
update_option('qsm_update_quiz_db_column', '1');
|
92 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
}
|
94 |
|
95 |
|
@@ -598,4 +614,17 @@ function qsm_check_create_tables(){
|
|
598 |
QSM_Install::install();
|
599 |
}
|
600 |
}
|
601 |
-
add_action('admin_init', 'qsm_check_create_tables');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
}
|
91 |
update_option('qsm_update_quiz_db_column', '1');
|
92 |
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Changed result table column data type
|
96 |
+
* @since 7.0.1
|
97 |
+
*/
|
98 |
+
if( get_option('qsm_update_result_db_column_datatype', '') != '1' ){
|
99 |
+
global $wpdb;
|
100 |
+
$result_table_name = $wpdb->prefix . "mlw_results";
|
101 |
+
$table_quiz_result_obj = $wpdb->get_row( $wpdb->prepare(
|
102 |
+
'SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = %s AND TABLE_NAME = %s AND COLUMN_NAME = %s ', $wpdb->dbname, $result_table_name, 'quiz_results'
|
103 |
+
), ARRAY_A );
|
104 |
+
if ( isset( $table_quiz_result_obj['DATA_TYPE'] ) && $table_quiz_result_obj['DATA_TYPE'] == 'text' ) {
|
105 |
+
$wpdb->query("ALTER TABLE $result_table_name CHANGE `quiz_results` `quiz_results` LONGTEXT;");
|
106 |
+
}
|
107 |
+
update_option('qsm_update_result_db_column_datatype', '1');
|
108 |
+
}
|
109 |
}
|
110 |
|
111 |
|
614 |
QSM_Install::install();
|
615 |
}
|
616 |
}
|
617 |
+
add_action('admin_init', 'qsm_check_create_tables');
|
618 |
+
|
619 |
+
/**
|
620 |
+
* Redirect the admin old slug to new slug
|
621 |
+
*
|
622 |
+
* @since 7.0.0
|
623 |
+
*/
|
624 |
+
function qsm_admin_page_access_func(){
|
625 |
+
if( isset( $_GET['page'] ) && $_GET['page'] == 'quiz-master-next/mlw_quizmaster2.php'){
|
626 |
+
wp_redirect( admin_url( 'admin.php?page=qsm_dashboard' ) );
|
627 |
+
exit;
|
628 |
+
}
|
629 |
+
}
|
630 |
+
add_action('admin_page_access_denied', 'qsm_admin_page_access_func');
|
@@ -54,7 +54,7 @@ function qsm_documentation_meta_box_content() {
|
|
54 |
<p><?php esc_html_e( 'Need help with the plugin? Try any of the following:', 'quiz-master-next' ); ?></p>
|
55 |
<ul>
|
56 |
<li>For assistance in using the plugin, read our <a href="https://quizandsurveymaster.com/docs/" target="_blank">documentation</a></li>
|
57 |
-
<li>For support, fill out the form on our <a href="https://quizandsurveymaster.com/
|
58 |
</ul>
|
59 |
<?php
|
60 |
}
|
@@ -89,29 +89,29 @@ function qsm_get_system_info() {
|
|
89 |
$parent_theme = $parent_theme_data->Name . ' ' . $parent_theme_data->Version;
|
90 |
}
|
91 |
|
92 |
-
$sys_info .= '<h3>Site Information</h3>';
|
93 |
-
$sys_info .= 'Site URL: ' . site_url() . '<br />';
|
94 |
-
$sys_info .= 'Home URL: ' . home_url() . '<br />';
|
95 |
-
$sys_info .= 'Multisite: ' . ( is_multisite() ? 'Yes' : 'No' ) . '<br />';
|
96 |
-
|
97 |
-
$sys_info .= '<h3>WordPress Information</h3>';
|
98 |
-
$sys_info .= 'Version: ' . get_bloginfo( 'version' ) . '<br />';
|
99 |
-
$sys_info .= 'Language: ' . ( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' ) . '<br />';
|
100 |
-
$sys_info .= 'Permalink Structure: ' . ( get_option( 'permalink_structure' ) ? get_option( 'permalink_structure' ) : 'Default' ) . '<br>';
|
101 |
-
$sys_info .=
|
102 |
-
$sys_info .=
|
103 |
-
$sys_info .= 'Debug Mode: ' . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . '<br />';
|
104 |
-
$sys_info .= 'Memory Limit: ' . WP_MEMORY_LIMIT . '<br />';
|
105 |
-
|
106 |
-
$sys_info .= '<h3>Plugins Information</h3>';
|
107 |
$plugin_mu = get_mu_plugins();
|
108 |
if ( count( $plugin_mu ) > 0 ) {
|
109 |
-
$sys_info .= '<h4>Must Use</h4>';
|
110 |
foreach ( $plugin_mu as $plugin => $plugin_data ) {
|
111 |
$sys_info .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "<br />";
|
112 |
}
|
113 |
}
|
114 |
-
$sys_info .= '<h4>Active</h4>';
|
115 |
$plugins = get_plugins();
|
116 |
$active_plugins = get_option( 'active_plugins', array() );
|
117 |
foreach ( $plugins as $plugin_path => $plugin ) {
|
@@ -120,7 +120,7 @@ function qsm_get_system_info() {
|
|
120 |
}
|
121 |
$sys_info .= $plugin['Name'] . ': ' . $plugin['Version'] . '<br />';
|
122 |
}
|
123 |
-
$sys_info .= '<h4>Inactive</h4>';
|
124 |
foreach ( $plugins as $plugin_path => $plugin ) {
|
125 |
if ( in_array( $plugin_path, $active_plugins ) ) {
|
126 |
continue;
|
@@ -128,10 +128,10 @@ function qsm_get_system_info() {
|
|
128 |
$sys_info .= $plugin['Name'] . ': ' . $plugin['Version'] . '<br />';
|
129 |
}
|
130 |
|
131 |
-
$sys_info .= '<h3>Server Information</h3>';
|
132 |
-
$sys_info .= 'PHP : ' . PHP_VERSION . '<br />';
|
133 |
-
$sys_info .= 'MySQL : ' . $wpdb->db_version() . '<br />';
|
134 |
-
$sys_info .= 'Webserver : ' . $_SERVER['SERVER_SOFTWARE'] . '<br />';
|
135 |
|
136 |
$total_quizzes = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mlw_quizzes LIMIT 1" );
|
137 |
$total_active_quizzes = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mlw_quizzes WHERE deleted = 0 LIMIT 1" );
|
@@ -140,24 +140,24 @@ function qsm_get_system_info() {
|
|
140 |
$total_results = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mlw_results LIMIT 1" );
|
141 |
$total_active_results = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mlw_results WHERE deleted = 0 LIMIT 1" );
|
142 |
|
143 |
-
$sys_info .= '<h3>QSM Information</h3>';
|
144 |
-
$sys_info .= 'Initial Version : ' . get_option( 'qmn_original_version' ) . '<br />';
|
145 |
-
$sys_info .= 'Current Version : ' . $mlwQuizMasterNext->version . '<br />';
|
146 |
-
$sys_info .=
|
147 |
-
$sys_info .=
|
148 |
-
$sys_info .=
|
149 |
-
$sys_info .=
|
150 |
-
$sys_info .=
|
151 |
-
$sys_info .=
|
152 |
-
|
153 |
-
$sys_info .= '<h3>QSM Recent Logs</h3>';
|
154 |
$recent_errors = $mlwQuizMasterNext->log_manager->get_logs();
|
155 |
if ( $recent_errors ) {
|
156 |
foreach ( $recent_errors as $error ) {
|
157 |
$sys_info .= "Log created at {$error->post_date}: {$error->post_title} - {$error->post_content}<br />";
|
158 |
}
|
159 |
} else {
|
160 |
-
$sys_info .= 'No recent logs<br />';
|
161 |
}
|
162 |
|
163 |
return $sys_info;
|
54 |
<p><?php esc_html_e( 'Need help with the plugin? Try any of the following:', 'quiz-master-next' ); ?></p>
|
55 |
<ul>
|
56 |
<li>For assistance in using the plugin, read our <a href="https://quizandsurveymaster.com/docs/" target="_blank">documentation</a></li>
|
57 |
+
<li>For support, fill out the form on our <a href="https://quizandsurveymaster.com/contact-support/?utm_source=qsm-help-page&utm_medium=plugin&utm_campaign=qsm_plugin&utm_content=contact_us" target="_blank">Contact Us Page</a></li>
|
58 |
</ul>
|
59 |
<?php
|
60 |
}
|
89 |
$parent_theme = $parent_theme_data->Name . ' ' . $parent_theme_data->Version;
|
90 |
}
|
91 |
|
92 |
+
$sys_info .= '<h3>'. __('Site Information', 'quiz-master-next') .'</h3>';
|
93 |
+
$sys_info .= __('Site URL:', 'quiz-master-next') . ' ' . site_url() . '<br />';
|
94 |
+
$sys_info .= __('Home URL:', 'quiz-master-next') . ' ' . home_url() . '<br />';
|
95 |
+
$sys_info .= __('Multisite: ', 'quiz-master-next') . ( is_multisite() ? 'Yes' : 'No' ) . '<br />';
|
96 |
+
|
97 |
+
$sys_info .= '<h3>'. __('WordPress Information', 'quiz-master-next') .'</h3>';
|
98 |
+
$sys_info .= __('Version: ', 'quiz-master-next') . get_bloginfo( 'version' ) . '<br />';
|
99 |
+
$sys_info .= __('Language: ', 'quiz-master-next') . ( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' ) . '<br />';
|
100 |
+
$sys_info .= __('Permalink Structure: ', 'quiz-master-next') . ( get_option( 'permalink_structure' ) ? get_option( 'permalink_structure' ) : 'Default' ) . '<br>';
|
101 |
+
$sys_info .= __('Active Theme: ', 'quiz-master-next') . "{$theme}";
|
102 |
+
$sys_info .= __('Parent Theme: ', 'quiz-master-next') . "{$parent_theme}<br>";
|
103 |
+
$sys_info .= __('Debug Mode: ', 'quiz-master-next') . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . '<br />';
|
104 |
+
$sys_info .= __('Memory Limit: ', 'quiz-master-next') . WP_MEMORY_LIMIT . '<br />';
|
105 |
+
|
106 |
+
$sys_info .= '<h3>'. __('Plugins Information', 'quiz-master-next') .'</h3>';
|
107 |
$plugin_mu = get_mu_plugins();
|
108 |
if ( count( $plugin_mu ) > 0 ) {
|
109 |
+
$sys_info .= '<h4>'. __('Must Use', 'quiz-master-next') .'</h4>';
|
110 |
foreach ( $plugin_mu as $plugin => $plugin_data ) {
|
111 |
$sys_info .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "<br />";
|
112 |
}
|
113 |
}
|
114 |
+
$sys_info .= '<h4>'. __('Active', 'quiz-master-next') .'</h4>';
|
115 |
$plugins = get_plugins();
|
116 |
$active_plugins = get_option( 'active_plugins', array() );
|
117 |
foreach ( $plugins as $plugin_path => $plugin ) {
|
120 |
}
|
121 |
$sys_info .= $plugin['Name'] . ': ' . $plugin['Version'] . '<br />';
|
122 |
}
|
123 |
+
$sys_info .= '<h4>'. __('Inactive', 'quiz-master-next') .'</h4>';
|
124 |
foreach ( $plugins as $plugin_path => $plugin ) {
|
125 |
if ( in_array( $plugin_path, $active_plugins ) ) {
|
126 |
continue;
|
128 |
$sys_info .= $plugin['Name'] . ': ' . $plugin['Version'] . '<br />';
|
129 |
}
|
130 |
|
131 |
+
$sys_info .= '<h3>'. __('Server Information', 'quiz-master-next') .'</h3>';
|
132 |
+
$sys_info .= __('PHP : ', 'quiz-master-next') . PHP_VERSION . '<br />';
|
133 |
+
$sys_info .= __('MySQL : ', 'quiz-master-next') . $wpdb->db_version() . '<br />';
|
134 |
+
$sys_info .= __('Webserver : ', 'quiz-master-next') . $_SERVER['SERVER_SOFTWARE'] . '<br />';
|
135 |
|
136 |
$total_quizzes = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mlw_quizzes LIMIT 1" );
|
137 |
$total_active_quizzes = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mlw_quizzes WHERE deleted = 0 LIMIT 1" );
|
140 |
$total_results = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mlw_results LIMIT 1" );
|
141 |
$total_active_results = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mlw_results WHERE deleted = 0 LIMIT 1" );
|
142 |
|
143 |
+
$sys_info .= '<h3>'. __('QSM Information', 'quiz-master-next') .'</h3>';
|
144 |
+
$sys_info .= __('Initial Version : ', 'quiz-master-next') . get_option( 'qmn_original_version' ) . '<br />';
|
145 |
+
$sys_info .= __('Current Version : ', 'quiz-master-next') . $mlwQuizMasterNext->version . '<br />';
|
146 |
+
$sys_info .= __('Total Quizzes : ', 'quiz-master-next') . "{$total_quizzes}<br />";
|
147 |
+
$sys_info .= __('Total Active Quizzes : ', 'quiz-master-next') . "{$total_active_quizzes}<br />";
|
148 |
+
$sys_info .= __('Total Questions : ', 'quiz-master-next') . "{$total_questions}<br />";
|
149 |
+
$sys_info .= __('Total Active Questions : ', 'quiz-master-next') . "{$total_active_questions}<br />";
|
150 |
+
$sys_info .= __('Total Results : ', 'quiz-master-next') . "{$total_results}<br />";
|
151 |
+
$sys_info .= __('Total Active Results : ', 'quiz-master-next') . "{$total_active_results}<br />";
|
152 |
+
|
153 |
+
$sys_info .= '<h3>'. __('QSM Recent Logs', 'quiz-master-next') .'</h3>';
|
154 |
$recent_errors = $mlwQuizMasterNext->log_manager->get_logs();
|
155 |
if ( $recent_errors ) {
|
156 |
foreach ( $recent_errors as $error ) {
|
157 |
$sys_info .= "Log created at {$error->post_date}: {$error->post_title} - {$error->post_content}<br />";
|
158 |
}
|
159 |
} else {
|
160 |
+
$sys_info .= __('No recent logs','quiz-master-next') . '<br />';
|
161 |
}
|
162 |
|
163 |
return $sys_info;
|
@@ -66,8 +66,8 @@ function qsm_options_emails_tab_content() {
|
|
66 |
<main class="email-content">
|
67 |
<div class="email-when">
|
68 |
<div class="email-content-header">
|
69 |
-
<h4
|
70 |
-
<p
|
71 |
</div>
|
72 |
<div class="email-when-conditions">
|
73 |
<!-- Conditions go here. Review template below. -->
|
@@ -76,14 +76,14 @@ function qsm_options_emails_tab_content() {
|
|
76 |
</div>
|
77 |
<div class="email-show">
|
78 |
<div class="email-content-header">
|
79 |
-
<h4
|
80 |
-
<p
|
81 |
</div>
|
82 |
-
<label
|
83 |
<input type="email" class="to-email" value="{{ data.to }}">
|
84 |
-
<label
|
85 |
<input type="text" class="subject" value="{{ data.subject }}">
|
86 |
-
<label
|
87 |
<textarea id="email-template-{{ data.id }}" class="email-template">{{{ data.content }}}</textarea>
|
88 |
<label><input type="checkbox" class="reply-to" <# if ( "true" == data.replyTo || true == data.replyTo ) { #>checked<# } #>>Add user email as Reply-To</label>
|
89 |
</div>
|
@@ -95,17 +95,17 @@ function qsm_options_emails_tab_content() {
|
|
95 |
<div class="email-condition">
|
96 |
<button class="delete-condition-button"><span class="dashicons dashicons-trash"></span></button>
|
97 |
<select class="email-condition-criteria">
|
98 |
-
<option value="points" <# if (data.criteria == 'points') { #>selected<# }
|
99 |
-
<option value="score" <# if (data.criteria == 'score') { #>selected<# }
|
100 |
<?php do_action( 'qsm_email_condition_criteria' ); ?>
|
101 |
</select>
|
102 |
<select class="email-condition-operator">
|
103 |
-
<option value="equal" <# if (data.operator == 'equal') { #>selected<# }
|
104 |
-
<option value="not-equal" <# if (data.operator == 'not-equal') { #>selected<# }
|
105 |
-
<option value="greater-equal" <# if (data.operator == 'greater-equal') { #>selected<# }
|
106 |
-
<option value="greater" <# if (data.operator == 'greater') { #>selected<# }
|
107 |
-
<option value="less-equal" <# if (data.operator == 'less-equal') { #>selected<# }
|
108 |
-
<option value="less" <# if (data.operator == 'less') { #>selected<# }
|
109 |
<?php do_action( 'qsm_email_condition_operator' ); ?>
|
110 |
</select>
|
111 |
<input type="text" class="email-condition-value" value="{{ data.value }}">
|
@@ -118,7 +118,7 @@ function qsm_options_emails_tab_content() {
|
|
118 |
<div class="qsm-popup__container" role="dialog" aria-modal="true" aria-labelledby="modal-3-title">
|
119 |
<header class="qsm-popup__header" style="display: block;">
|
120 |
<h2 class="qsm-popup__title"><?php _e('Template Variables', 'quiz-master-next'); ?></h2>
|
121 |
-
<span class="description"><?php _e('Use these dynamic variables to customize your quiz or survey. Just copy and paste one or more variables into the content templates and these will be replaced by actual values when user takes a quiz.', 'quiz-master-next'); ?></span>
|
122 |
</header>
|
123 |
<main class="qsm-popup__content" id="show-all-variable-content">
|
124 |
<?php
|
66 |
<main class="email-content">
|
67 |
<div class="email-when">
|
68 |
<div class="email-content-header">
|
69 |
+
<h4><?php esc_html_e('When...', 'quiz-master-') ?></h4>
|
70 |
+
<p><?php esc_html_e('Set conditions for when this email should be sent. Leave empty to set this as an email that is always sent.', 'quiz-master-next'); ?></p>
|
71 |
</div>
|
72 |
<div class="email-when-conditions">
|
73 |
<!-- Conditions go here. Review template below. -->
|
76 |
</div>
|
77 |
<div class="email-show">
|
78 |
<div class="email-content-header">
|
79 |
+
<h4><?php esc_html_e('...Send', 'quiz-master-next'); ?></h4>
|
80 |
+
<p><?php esc_html_e('Create the email that should be sent when the conditions are met.', 'quiz-master-next'); ?></p>
|
81 |
</div>
|
82 |
+
<label><?php esc_html_e('Who to send the email to? Put %USER_EMAIL% to send to user', 'quiz-master-next'); ?></label>
|
83 |
<input type="email" class="to-email" value="{{ data.to }}">
|
84 |
+
<label><?php esc_html_e('Email Subject', 'quiz-master-next'); ?></label>
|
85 |
<input type="text" class="subject" value="{{ data.subject }}">
|
86 |
+
<label><?php esc_html_e('Email Content', 'quiz-master-next'); ?></label>
|
87 |
<textarea id="email-template-{{ data.id }}" class="email-template">{{{ data.content }}}</textarea>
|
88 |
<label><input type="checkbox" class="reply-to" <# if ( "true" == data.replyTo || true == data.replyTo ) { #>checked<# } #>>Add user email as Reply-To</label>
|
89 |
</div>
|
95 |
<div class="email-condition">
|
96 |
<button class="delete-condition-button"><span class="dashicons dashicons-trash"></span></button>
|
97 |
<select class="email-condition-criteria">
|
98 |
+
<option value="points" <# if (data.criteria == 'points') { #>selected<# } #>><?php _e('Total points earned', 'quiz-master-next'); ?></option>
|
99 |
+
<option value="score" <# if (data.criteria == 'score') { #>selected<# } #>><?php _e('Correct score percentage', 'quiz-master-next'); ?></option>
|
100 |
<?php do_action( 'qsm_email_condition_criteria' ); ?>
|
101 |
</select>
|
102 |
<select class="email-condition-operator">
|
103 |
+
<option value="equal" <# if (data.operator == 'equal') { #>selected<# } #>><?php _e('is equal to', 'quiz-master-next'); ?></option>
|
104 |
+
<option value="not-equal" <# if (data.operator == 'not-equal') { #>selected<# } #>><?php _e('is not equal to', 'quiz-master-next'); ?></option>
|
105 |
+
<option value="greater-equal" <# if (data.operator == 'greater-equal') { #>selected<# } #>><?php _e('is greater than or equal to', 'quiz-master-next'); ?></option>
|
106 |
+
<option value="greater" <# if (data.operator == 'greater') { #>selected<# } #>><?php _e('is greater than', 'quiz-master-next'); ?></option>
|
107 |
+
<option value="less-equal" <# if (data.operator == 'less-equal') { #>selected<# } #>><?php _e('is less than or equal to', 'quiz-master-next'); ?></option>
|
108 |
+
<option value="less" <# if (data.operator == 'less') { #>selected<# } #>><?php _e('is less than', 'quiz-master-next'); ?></option>
|
109 |
<?php do_action( 'qsm_email_condition_operator' ); ?>
|
110 |
</select>
|
111 |
<input type="text" class="email-condition-value" value="{{ data.value }}">
|
118 |
<div class="qsm-popup__container" role="dialog" aria-modal="true" aria-labelledby="modal-3-title">
|
119 |
<header class="qsm-popup__header" style="display: block;">
|
120 |
<h2 class="qsm-popup__title"><?php _e('Template Variables', 'quiz-master-next'); ?></h2>
|
121 |
+
|