Quiz And Survey Master (Formerly Quiz Master Next) - Version 5.1.0

Version Description

(October 2, 2017) = * Closed Enhancement: Add all active quizzes function to API - (Issue #552) * Closed User Request: Shortcode or variable for dynamic link to specific quiz/survey - (Issue #524) * Closed Enhancement: Use locale's date to generate date strings - (Issue #479) * Closed User Request: Allow users to change the date to European Date DD.MM.YYYY - (Issue #439) * Closed User Request: More Space in the Correct Answer Info textbox - (Issue #417)

Download this release

Release Info

Developer fpcorso
Plugin Icon 128x128 Quiz And Survey Master (Formerly Quiz Master Next)
Version 5.1.0
Comparing to
See all releases

Code changes from version 5.0.7 to 5.1.0

CHANGELOG.md CHANGED
@@ -1,3 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  = 4.7.10 (January 1, 2017) =
2
  * Closed Bug: Edit question not working when visual editor is off - Issue #497
3
  * Closed Bug: Localization incomplete on Global Settings page - Issue #478
1
+ = 5.1.0 (October 2, 2017) =
2
+ * Closed Enhancement: Add all active quizzes function to API - ([Issue #552](https://github.com/fpcorso/quiz_master_next/issues/552))
3
+ * Closed User Request: Shortcode or variable for dynamic link to specific quiz/survey - ([Issue #524](https://github.com/fpcorso/quiz_master_next/issues/524))
4
+ * Closed Enhancement: Use locale's date to generate date strings - ([Issue #479](https://github.com/fpcorso/quiz_master_next/issues/479))
5
+ * Closed User Request: Allow users to change the date to European Date DD.MM.YYYY - ([Issue #439](https://github.com/fpcorso/quiz_master_next/issues/439))
6
+ * Closed User Request: More Space in the Correct Answer Info textbox - ([Issue #417](https://github.com/fpcorso/quiz_master_next/issues/417))
7
+
8
+ = 5.0.7 (September 18, 2017) =
9
+ * Closed Bug: Answers of "0" disappear when adding or editing questions - ([Issue #531](https://github.com/fpcorso/quiz_master_next/issues/531))
10
+
11
+ = 5.0.6 (August 1, 2017) =
12
+ * Closed Bug: HTML Entities causing incorrect answers and missing user answer - ([Issue #565](https://github.com/fpcorso/quiz_master_next/issues/565))
13
+
14
+ = 5.0.5 (July 8, 2017) =
15
+ * Closed Enhancement: Add notice for leaderboard removal - ([Issue #562](https://github.com/fpcorso/quiz_master_next/issues/562))
16
+ * Closed Bug: Scheduled timeframe options are not working - ([Issue #558](https://github.com/fpcorso/quiz_master_next/issues/558))
17
+
18
+ = 5.0.4 (June 19, 2017) =
19
+ * Closed Bug: Required fields are not checked 2nd time user takes quiz when timer is turned on ([Issue #528](https://github.com/fpcorso/quiz_master_next/issues/528))
20
+ * Closed Enhancement: Ensure compatibility with WordPress 4.8 ([Issue #554](https://github.com/fpcorso/quiz_master_next/issues/554))
21
+
22
+ = 5.0.3 (May 29, 2017) =
23
+ * Minor code changes
24
+
25
+ = 5.0.2 (May 7, 2017) =
26
+ * Closed Bug: Social sharing text not updating when user changes the text ([Issue #541](https://github.com/fpcorso/quiz_master_next/issues/541))
27
+
28
+ = 5.0.1 (March 27, 2017) =
29
+ * Closed Bug: The setting to hide contact fields from logged-in users is hiding fields from visitors too ([Issue #535](https://github.com/fpcorso/quiz_master_next/issues/535))
30
+
31
+ = 5.0.0 (March 25, 2017) =
32
+ * Closed Bug: Fix delete custom post types during uninstall bug ([Issue #527](https://github.com/fpcorso/quiz_master_next/issues/527))
33
+ * Closed Enhancement: Change Shortcode To QSM ([Issue #515](https://github.com/fpcorso/quiz_master_next/issues/515))
34
+ * Closed Enhancement: Search function for quizzes/surveys ([Issue #492](https://github.com/fpcorso/quiz_master_next/issues/492))
35
+ * Closed Enhancement: Create new fields class to handle creation/post data of settings fields ([Issue #450](https://github.com/fpcorso/quiz_master_next/issues/450))
36
+ * Closed Enhancement: Create new settings class to handle the settings data ([Issue #449](https://github.com/fpcorso/quiz_master_next/issues/449))
37
+ * Closed Enhancement: Rewrite options system to allow for extendibility ([Issue #448](https://github.com/fpcorso/quiz_master_next/issues/448))
38
+ * Closed Enhancement: Enable tabs for the admin results page ([Issue #408](https://github.com/fpcorso/quiz_master_next/issues/408))
39
+ * Closed Enhancement: Create onboarding process ([Issue #397](https://github.com/fpcorso/quiz_master_next/issues/397))
40
+ * Closed Enhancement: Create new contact tab to allow form creation ([Issue #394](https://github.com/fpcorso/quiz_master_next/issues/394))
41
+ * Closed Enhancement: Move Certificate to free addon ([Issue #381](https://github.com/fpcorso/quiz_master_next/issues/381))
42
+ * Closed Enhancement: Ability to add check box for privacy statement with the contact fields ([Issue #372](https://github.com/fpcorso/quiz_master_next/issues/372))
43
+ * Closed Enhancement: Customize the "Please complete all required fields!" text ([Issue #371](https://github.com/fpcorso/quiz_master_next/issues/371))
44
+ * Closed Enhancement: Allow admins to customize the validation error messages ([Issue #346](https://github.com/fpcorso/quiz_master_next/issues/346))
45
+ * Closed Enhancement: Hint field cannot be customized ([Issue #262](https://github.com/fpcorso/quiz_master_next/issues/262))
46
+ * Closed Enhancement: Add custom fields to the contact form ([Issue #211](https://github.com/fpcorso/quiz_master_next/issues/211))
47
+ * Closed Enhancement: Scrollable List of Quizzes ([Issue #46](https://github.com/fpcorso/quiz_master_next/issues/46))
48
+
49
  = 4.7.10 (January 1, 2017) =
50
  * Closed Bug: Edit question not working when visual editor is off - Issue #497
51
  * Closed Bug: Localization incomplete on Global Settings page - Issue #478
css/qsm-admin-question.css CHANGED
@@ -1,144 +1,149 @@
1
  .edit_link,
2
  .duplicate_link {
3
- color: #0074a2 !important;
4
- font-size: 14px !important;
5
  }
6
  .delete_link {
7
- color: red !important;
8
- font-size: 14px !important;
9
  }
10
  .edit_link:hover,
11
  .duplicate_link:hover,
12
  .delete_link:hover {
13
- background-color: black;
14
  }
15
 
16
  .row:after,
17
  .answers:after,
18
  .answers_single:after {
19
- clear:both;
20
- display:table;
21
- content: " ";
22
  }
23
  .row {
24
- margin-bottom: 15px;
25
  }
26
  .row .option_label {
27
- width:15%;
28
- float:left;
29
- font-weight: bold;
30
  }
31
  .row .option_input {
32
- width:84%;
33
- float:left;
34
  }
 
 
 
 
 
35
  .question_form {
36
 
37
  }
38
  .question_form fieldset {
39
- margin: 20px 0px;
40
- background: #fff;
41
- padding: 5px;
42
  }
43
  .question_form legend {
44
- font-size: 16px;
45
- font-weight: bold;
46
- background: #f1f1f1;
47
- padding: 5px;
48
  }
49
  .answer_number,
50
  .answer_text,
51
  .answer_points,
52
  .answer_correct {
53
- font-weight: bold;
54
- float:left;
55
- margin: 1%;
56
  }
57
  .answer_number {
58
- width:10%;
59
  }
60
  .answer_text {
61
- width:60%;
62
  }
63
  .answer_points {
64
- width:10%;
65
  }
66
  .answer_correct {
67
- width:10%;
68
  }
69
  .answer_input {
70
- width: 100%;
71
  }
72
  .question_area_header_text {
73
- padding: 40px 0 0 !important;
74
  }
75
 
76
  .other_quiz_question {
77
- display: flex;
78
- flex-direction: row;
79
- justify-content: space-between;
80
- align-items: center;
81
- margin: 10px 0;
82
- border: 1px solid #ccc;
83
  }
84
 
85
  .import_question_button,
86
  .other_quiz_question_text {
87
- margin-right: 15px !important;
88
  }
89
 
90
  @-moz-keyframes qsm-spinner-loader {
91
- 0% {
92
- -moz-transform: rotate(0deg);
93
- transform: rotate(0deg);
94
- }
95
- 100% {
96
- -moz-transform: rotate(360deg);
97
- transform: rotate(360deg);
98
- }
99
  }
100
  @-webkit-keyframes qsm-spinner-loader {
101
- 0% {
102
- -webkit-transform: rotate(0deg);
103
- transform: rotate(0deg);
104
- }
105
- 100% {
106
- -webkit-transform: rotate(360deg);
107
- transform: rotate(360deg);
108
- }
109
  }
110
 
111
  @keyframes qsm-spinner-loader {
112
- 0% {
113
- -moz-transform: rotate(0deg);
114
- -ms-transform: rotate(0deg);
115
- -webkit-transform: rotate(0deg);
116
- transform: rotate(0deg);
117
- }
118
- 100% {
119
- -moz-transform: rotate(360deg);
120
- -ms-transform: rotate(360deg);
121
- -webkit-transform: rotate(360deg);
122
- transform: rotate(360deg);
123
- }
124
  }
125
 
126
  /* :not(:required) hides this rule from IE9 and below */
127
  .qsm-spinner-loader:not(:required) {
128
- -moz-animation: qsm-spinner-loader 1500ms infinite linear;
129
- -webkit-animation: qsm-spinner-loader 1500ms infinite linear;
130
- animation: qsm-spinner-loader 1500ms infinite linear;
131
- -moz-border-radius: 0.5em;
132
- -webkit-border-radius: 0.5em;
133
- border-radius: 0.5em;
134
- -moz-box-shadow: rgba(0, 0, 51, 0.3) 1.5em 0 0 0, rgba(0, 0, 51, 0.3) 1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) 0 1.5em 0 0, rgba(0, 0, 51, 0.3) -1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) -1.5em 0 0 0, rgba(0, 0, 51, 0.3) -1.1em -1.1em 0 0, rgba(0, 0, 51, 0.3) 0 -1.5em 0 0, rgba(0, 0, 51, 0.3) 1.1em -1.1em 0 0;
135
- -webkit-box-shadow: rgba(0, 0, 51, 0.3) 1.5em 0 0 0, rgba(0, 0, 51, 0.3) 1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) 0 1.5em 0 0, rgba(0, 0, 51, 0.3) -1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) -1.5em 0 0 0, rgba(0, 0, 51, 0.3) -1.1em -1.1em 0 0, rgba(0, 0, 51, 0.3) 0 -1.5em 0 0, rgba(0, 0, 51, 0.3) 1.1em -1.1em 0 0;
136
- box-shadow: rgba(0, 0, 51, 0.3) 1.5em 0 0 0, rgba(0, 0, 51, 0.3) 1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) 0 1.5em 0 0, rgba(0, 0, 51, 0.3) -1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) -1.5em 0 0 0, rgba(0, 0, 51, 0.3) -1.1em -1.1em 0 0, rgba(0, 0, 51, 0.3) 0 -1.5em 0 0, rgba(0, 0, 51, 0.3) 1.1em -1.1em 0 0;
137
- display: inline-block;
138
- font-size: 10px;
139
- width: 1em;
140
- height: 1em;
141
- margin: 1.5em;
142
- overflow: hidden;
143
- text-indent: 100%;
144
  }
1
  .edit_link,
2
  .duplicate_link {
3
+ color: #0074a2 !important;
4
+ font-size: 14px !important;
5
  }
6
  .delete_link {
7
+ color: red !important;
8
+ font-size: 14px !important;
9
  }
10
  .edit_link:hover,
11
  .duplicate_link:hover,
12
  .delete_link:hover {
13
+ background-color: black;
14
  }
15
 
16
  .row:after,
17
  .answers:after,
18
  .answers_single:after {
19
+ clear:both;
20
+ display:table;
21
+ content: " ";
22
  }
23
  .row {
24
+ margin-bottom: 15px;
25
  }
26
  .row .option_label {
27
+ width:15%;
28
+ float:left;
29
+ font-weight: bold;
30
  }
31
  .row .option_input {
32
+ width:84%;
33
+ float:left;
34
  }
35
+
36
+ .row textarea.option_input {
37
+ min-height: 50px;
38
+ }
39
+
40
  .question_form {
41
 
42
  }
43
  .question_form fieldset {
44
+ margin: 20px 0px;
45
+ background: #fff;
46
+ padding: 5px;
47
  }
48
  .question_form legend {
49
+ font-size: 16px;
50
+ font-weight: bold;
51
+ background: #f1f1f1;
52
+ padding: 5px;
53
  }
54
  .answer_number,
55
  .answer_text,
56
  .answer_points,
57
  .answer_correct {
58
+ font-weight: bold;
59
+ float:left;
60
+ margin: 1%;
61
  }
62
  .answer_number {
63
+ width:10%;
64
  }
65
  .answer_text {
66
+ width:60%;
67
  }
68
  .answer_points {
69
+ width:10%;
70
  }
71
  .answer_correct {
72
+ width:10%;
73
  }
74
  .answer_input {
75
+ width: 100%;
76
  }
77
  .question_area_header_text {
78
+ padding: 40px 0 0 !important;
79
  }
80
 
81
  .other_quiz_question {
82
+ display: flex;
83
+ flex-direction: row;
84
+ justify-content: space-between;
85
+ align-items: center;
86
+ margin: 10px 0;
87
+ border: 1px solid #ccc;
88
  }
89
 
90
  .import_question_button,
91
  .other_quiz_question_text {
92
+ margin-right: 15px !important;
93
  }
94
 
95
  @-moz-keyframes qsm-spinner-loader {
96
+ 0% {
97
+ -moz-transform: rotate(0deg);
98
+ transform: rotate(0deg);
99
+ }
100
+ 100% {
101
+ -moz-transform: rotate(360deg);
102
+ transform: rotate(360deg);
103
+ }
104
  }
105
  @-webkit-keyframes qsm-spinner-loader {
106
+ 0% {
107
+ -webkit-transform: rotate(0deg);
108
+ transform: rotate(0deg);
109
+ }
110
+ 100% {
111
+ -webkit-transform: rotate(360deg);
112
+ transform: rotate(360deg);
113
+ }
114
  }
115
 
116
  @keyframes qsm-spinner-loader {
117
+ 0% {
118
+ -moz-transform: rotate(0deg);
119
+ -ms-transform: rotate(0deg);
120
+ -webkit-transform: rotate(0deg);
121
+ transform: rotate(0deg);
122
+ }
123
+ 100% {
124
+ -moz-transform: rotate(360deg);
125
+ -ms-transform: rotate(360deg);
126
+ -webkit-transform: rotate(360deg);
127
+ transform: rotate(360deg);
128
+ }
129
  }
130
 
131
  /* :not(:required) hides this rule from IE9 and below */
132
  .qsm-spinner-loader:not(:required) {
133
+ -moz-animation: qsm-spinner-loader 1500ms infinite linear;
134
+ -webkit-animation: qsm-spinner-loader 1500ms infinite linear;
135
+ animation: qsm-spinner-loader 1500ms infinite linear;
136
+ -moz-border-radius: 0.5em;
137
+ -webkit-border-radius: 0.5em;
138
+ border-radius: 0.5em;
139
+ -moz-box-shadow: rgba(0, 0, 51, 0.3) 1.5em 0 0 0, rgba(0, 0, 51, 0.3) 1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) 0 1.5em 0 0, rgba(0, 0, 51, 0.3) -1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) -1.5em 0 0 0, rgba(0, 0, 51, 0.3) -1.1em -1.1em 0 0, rgba(0, 0, 51, 0.3) 0 -1.5em 0 0, rgba(0, 0, 51, 0.3) 1.1em -1.1em 0 0;
140
+ -webkit-box-shadow: rgba(0, 0, 51, 0.3) 1.5em 0 0 0, rgba(0, 0, 51, 0.3) 1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) 0 1.5em 0 0, rgba(0, 0, 51, 0.3) -1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) -1.5em 0 0 0, rgba(0, 0, 51, 0.3) -1.1em -1.1em 0 0, rgba(0, 0, 51, 0.3) 0 -1.5em 0 0, rgba(0, 0, 51, 0.3) 1.1em -1.1em 0 0;
141
+ box-shadow: rgba(0, 0, 51, 0.3) 1.5em 0 0 0, rgba(0, 0, 51, 0.3) 1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) 0 1.5em 0 0, rgba(0, 0, 51, 0.3) -1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) -1.5em 0 0 0, rgba(0, 0, 51, 0.3) -1.1em -1.1em 0 0, rgba(0, 0, 51, 0.3) 0 -1.5em 0 0, rgba(0, 0, 51, 0.3) 1.1em -1.1em 0 0;
142
+ display: inline-block;
143
+ font-size: 10px;
144
+ width: 1em;
145
+ height: 1em;
146
+ margin: 1.5em;
147
+ overflow: hidden;
148
+ text-indent: 100%;
149
  }
js/qsm-admin.js CHANGED
@@ -34,7 +34,7 @@ var QSMQuizzesSurveys;
34
  '</div>' +
35
  '</td>' +
36
  '<td>[qsm quiz=' + quizData.id + ']</td>' +
37
- '<td>[mlw_quizmaster_leaderboard mlw_quiz=' + quizData.id + ']</td>' +
38
  '<td>' + quizData.views + '</td>' +
39
  '<td>' + quizData.taken + '</td>' +
40
  '<td>' + quizData.lastActivity + '</td>' +
34
  '</div>' +
35
  '</td>' +
36
  '<td>[qsm quiz=' + quizData.id + ']</td>' +
37
+ '<td>[qsm_link id=' + quizData.id + ']Click here[/qsm_link]</td>' +
38
  '<td>' + quizData.views + '</td>' +
39
  '<td>' + quizData.taken + '</td>' +
40
  '<td>' + quizData.lastActivity + '</td>' +
mlw_quizmaster2.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
- * Version: 5.0.7
6
  * Author: Frank Corso
7
  * Author URI: http://www.quizandsurveymaster.com/
8
  * Plugin URI: http://www.quizandsurveymaster.com/
@@ -10,7 +10,7 @@
10
  * Domain Path: /languages
11
  *
12
  * @author Frank Corso
13
- * @version 5.0.7
14
  */
15
  if ( ! defined( 'ABSPATH' ) ) exit;
16
 
@@ -30,7 +30,7 @@ class MLWQuizMasterNext {
30
  * @var string
31
  * @since 4.0.0
32
  */
33
- public $version = '5.0.7';
34
 
35
  /**
36
  * QSM Alert Manager Object
@@ -147,6 +147,7 @@ class MLWQuizMasterNext {
147
  include( "php/adverts-generate.php" );
148
  include( "php/question-types.php" );
149
  include( "php/default-templates.php" );
 
150
 
151
  include( "php/class-qmn-alert-manager.php" );
152
  $this->alertManager = new MlwQmnAlertManager();
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
+ * Version: 5.1.0
6
  * Author: Frank Corso
7
  * Author URI: http://www.quizandsurveymaster.com/
8
  * Plugin URI: http://www.quizandsurveymaster.com/
10
  * Domain Path: /languages
11
  *
12
  * @author Frank Corso
13
+ * @version 5.1.0
14
  */
15
  if ( ! defined( 'ABSPATH' ) ) exit;
16
 
30
  * @var string
31
  * @since 4.0.0
32
  */
33
+ public $version = '5.1.0';
34
 
35
  /**
36
  * QSM Alert Manager Object
147
  include( "php/adverts-generate.php" );
148
  include( "php/question-types.php" );
149
  include( "php/default-templates.php" );
150
+ include( "php/shortcodes.php" );
151
 
152
  include( "php/class-qmn-alert-manager.php" );
153
  $this->alertManager = new MlwQmnAlertManager();
php/about-page.php CHANGED
@@ -11,8 +11,8 @@ function mlw_generate_about_page() {
11
 
12
  global $mlwQuizMasterNext;
13
  $version = $mlwQuizMasterNext->version;
14
- wp_enqueue_style( 'qsm_admin_style', plugins_url( '../css/qsm-admin.css' , __FILE__ ), array(), '5.0.0' );
15
- wp_enqueue_script( 'qsm_admin_js', plugins_url( '../js/admin.js' , __FILE__ ), array( 'jquery' ), '5.0.0' );
16
  ?>
17
  <style>
18
  div.qsm_icon_wrap {
@@ -33,50 +33,28 @@ function mlw_generate_about_page() {
33
  </h2>
34
  <div class="qsm-tab-content tab-1">
35
  <div class="feature">
36
- <h2 class="feature-headline">Welcome to QSM 5.0!</h2>
37
- <p class="feature-text">There are many changes in version 5.0. From a contact fields system to new developer functions, there are a lot to see.</p>
38
  </div>
39
  <div class="feature">
40
- <h2 class="feature-headline">New Contact Fields System</h2>
41
- <p class="feature-text">The biggest change is our new contact fields. Instead of having to edit some of the options on one tab, the text on another tab, and final settings on another tab, all of the contact field options are on the new "Contact" tab.</p>
42
- <p class="feature-text">Even better, you can now create new contact fields for anything you need! Need an "Age" field or an "Attendee ID" field? Now you can!</p>
43
- <p class="feature-text">You can now choose from three different contact field types: Small Open Answer, Email, or Checkbox.</p>
44
  </div>
45
  <div class="feature">
46
- <h2 class="feature-headline">More Text Is Editable</h2>
47
- <p class="feature-text">You can now edit the text for the "Hint" as well as all 4 of the error messages that are used when validating a user's responses. You can edit these on the "Text" tab.</p>
48
- </div>
49
- <div class="feature">
50
- <h2 class="feature-headline">Scrollable And Searchable Quizzes/Surveys</h2>
51
- <p class="feature-text">For the users who have many quizzes and surveys on their site, it has been difficult and frustrating to find a particular quiz/survey to edit it on the Quizzes page. Now, the quizzes/surveys can be searched using the new searchbox in the top-right! Also, there are no more pages of quizzes/surveys to look through as the quizzes/surveys load as you scroll down making editing much quicker and more efficient.</p>
52
- </div>
53
- <div class="feature">
54
- <h2 class="feature-headline">Introduction Of Onboarding Process</h2>
55
- <p class="feature-text">New users of this plugin will now see a getting started video and documentation when first accessing the Quizzes/Surveys page.</p>
56
- </div>
57
- <div class="feature">
58
- <h2 class="feature-headline">Certificate Is Now An Addon</h2>
59
- <p class="feature-text">As we stated 8 months ago, the certificate feature is no longer built into the plugin and is available as a free addon.</p>
60
  </div>
61
  <hr />
62
  <div class="feature">
63
- <h2 class="feature-headline">For Developers: New Settings System</h2>
64
- <p class="feature-text">The settings system has been completely rewritten and is now stored as serialized arrays that can be extended instead of hardcoded as columns in the database. You can now "register" settings with defaults and assign which tab they belong to. Documentation coming soon.</p>
65
- </div>
66
- <div class="feature">
67
- <h2 class="feature-headline">For Developers: New Results Page Tabs</h2>
68
- <p class="feature-text">The "Results" page in the admin can now be extended with tabs. A great location for adding features that affect or analyze the results.</p>
69
  </div>
70
  </div>
71
  <div class="qsm-tab-content tab-2" style="display: none;">
72
  <h2>Changelog</h2>
73
- <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 39 ); ?>
74
- <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 38 ); ?>
75
- <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 37 ); ?>
76
- <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 34 ); ?>
77
- <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 33 ); ?>
78
- <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 26 ); ?>
79
- <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 19 ); ?>
80
  </div>
81
  <div class="qsm-tab-content tab-3" style="display:none;">
82
  <h2>GitHub Contributors</h2>
11
 
12
  global $mlwQuizMasterNext;
13
  $version = $mlwQuizMasterNext->version;
14
+ wp_enqueue_style( 'qsm_admin_style', plugins_url( '../css/qsm-admin.css' , __FILE__ ), array(), '5.1.0' );
15
+ wp_enqueue_script( 'qsm_admin_js', plugins_url( '../js/admin.js' , __FILE__ ), array( 'jquery' ), '5.1.0' );
16
  ?>
17
  <style>
18
  div.qsm_icon_wrap {
33
  </h2>
34
  <div class="qsm-tab-content tab-1">
35
  <div class="feature">
36
+ <h2 class="feature-headline">Welcome to QSM 5.1!</h2>
 
37
  </div>
38
  <div class="feature">
39
+ <h2 class="feature-headline">New Shortcode For Quiz/Survey Link</h2>
40
+ <p class="feature-text">There has always been a shortcode for displaying your quizzes and surveys. However, adding a link directly to the quiz or survey has been difficult.</p>
41
+ <p class="feature-text">Before, if you place a direct link and the permalink changed, your link would break.</p>
42
+ <p class="feature-text">Now, you can use the new "qsm_link" shortcode for creating links. The shortcode has been added to the "Quizzes/Surveys" page so it can easily be copied to be pasted anywhere on your site!</p>
43
  </div>
44
  <div class="feature">
45
+ <h2 class="feature-headline">Dates Are Now Localized</h2>
46
+ <p class="feature-text">You may have noticed that the dates in your results as well as variables such as %DATE_TAKEN% and %CURRENT_DATE% never followed the format you set your WordPress to.</p>
47
+ <p class="feature-text">With this update, all dates will follow the format set on the "General" page of the "Settings" menu in your WordPress dashboard.</p>
 
 
 
 
 
 
 
 
 
 
 
48
  </div>
49
  <hr />
50
  <div class="feature">
51
+ <h2 class="feature-headline">For Developers: New All Quizzes Function</h2>
52
+ <p class="feature-text">There is a new function "get_quizzes" in the plugin helper API that returns all quizzes. With the functions parameters, you can get the quizzes ordered by a certain field and include deleted quizzes if needed.</p>
 
 
 
 
53
  </div>
54
  </div>
55
  <div class="qsm-tab-content tab-2" style="display: none;">
56
  <h2>Changelog</h2>
57
+ <?php QSM_Changelog_Generator::get_changelog_list( 'fpcorso/quiz_master_next', 25 ); ?>
 
 
 
 
 
 
58
  </div>
59
  <div class="qsm-tab-content tab-3" style="display:none;">
60
  <h2>GitHub Contributors</h2>
php/admin-results-page.php CHANGED
@@ -364,7 +364,9 @@ function qsm_results_overview_tab_content() {
364
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->business ."</span></td>";
365
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->email ."</span></td>";
366
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->phone ."</span></td>";
367
- $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->time_taken ."</span></td>";
 
 
368
  $quotes_list .= "</tr>";
369
  }
370
  $display .= "<tbody id=\"the-list\">{$quotes_list}</tbody>";
364
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->business ."</span></td>";
365
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->email ."</span></td>";
366
  $quotes_list .= "<td><span style='font-size:16px;'>" . $mlw_quiz_info->phone ."</span></td>";
367
+ $date = date_i18n( get_option( 'date_format' ), strtotime( $mlw_quiz_info->time_taken ) );
368
+ $time = date( "h:i:s A", strtotime( $mlw_quiz_info->time_taken ) );
369
+ $quotes_list .= "<td><span style='font-size:16px;'>$date $time</span></td>";
370
  $quotes_list .= "</tr>";
371
  }
372
  $display .= "<tbody id=\"the-list\">{$quotes_list}</tbody>";
php/class-qmn-log-manager.php CHANGED
@@ -30,10 +30,10 @@ class QMN_Log_Manager
30
  * @since 4.5.0
31
  */
32
  private function log_types() {
33
- $terms = array(
34
- 'error', 'event'
35
- );
36
- return apply_filters( 'qmn_log_types', $terms );
37
  }
38
 
39
  /**
@@ -52,6 +52,8 @@ class QMN_Log_Manager
52
  'supports' => array( 'title', 'editor' ),
53
  'can_export' => false
54
  );
 
 
55
  register_post_type( 'qmn_log', apply_filters( 'qmn_log_post_type_args', $log_args ) );
56
  }
57
 
@@ -118,7 +120,10 @@ class QMN_Log_Manager
118
  'log_type' => false
119
  );
120
  $args = wp_parse_args( $log_data, $defaults );
121
- do_action( 'wp_pre_insert_log' );
 
 
 
122
  // store the log entry
123
  $log_id = wp_insert_post( $args );
124
  // set the log type, if any
@@ -131,6 +136,8 @@ class QMN_Log_Manager
131
  update_post_meta( $log_id, '_qmn_log_' . sanitize_key( $key ), $meta );
132
  }
133
  }
 
 
134
  do_action( 'wp_post_insert_qmn_log', $log_id );
135
  return $log_id;
136
  }
30
  * @since 4.5.0
31
  */
32
  private function log_types() {
33
+ $terms = array( 'error', 'event' );
34
+
35
+ // Filters the taxomony for the QSM logs
36
+ return apply_filters( 'qmn_log_types', $terms );
37
  }
38
 
39
  /**
52
  'supports' => array( 'title', 'editor' ),
53
  'can_export' => false
54
  );
55
+
56
+ // Registers QSM logs post type with filtered $args
57
  register_post_type( 'qmn_log', apply_filters( 'qmn_log_post_type_args', $log_args ) );
58
  }
59
 
120
  'log_type' => false
121
  );
122
  $args = wp_parse_args( $log_data, $defaults );
123
+
124
+ // Hook called before a QSM log is inserted
125
+ do_action( 'wp_pre_insert_qmn_log' );
126
+
127
  // store the log entry
128
  $log_id = wp_insert_post( $args );
129
  // set the log type, if any
136
  update_post_meta( $log_id, '_qmn_log_' . sanitize_key( $key ), $meta );
137
  }
138
  }
139
+
140
+ // Hook called after a QSM log is inserted
141
  do_action( 'wp_post_insert_qmn_log', $log_id );
142
  return $log_id;
143
  }
php/class-qmn-plugin-helper.php CHANGED
@@ -88,6 +88,53 @@ class QMNPluginHelper {
88
  $mlwQuizMasterNext->quiz_settings->prepare_quiz( intval( $quiz_id ) );
89
  }
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  /**
92
  * Registers a quiz setting
93
  *
@@ -148,7 +195,7 @@ class QMNPluginHelper {
148
  */
149
  public function generate_settings_section( $section = 'quiz_options' ) {
150
  global $mlwQuizMasterNext;
151
- QSM_Fields::generate_section( $mlwQuizMasterNext->quiz_settings->load_setting_fields( $section ), $section );
152
  }
153
 
154
  /**
88
  $mlwQuizMasterNext->quiz_settings->prepare_quiz( intval( $quiz_id ) );
89
  }
90
 
91
+ /**
92
+ * Retrieves all quizzes.
93
+ *
94
+ * @param bool $include_deleted If set to true, returned array will include all deleted quizzes
95
+ * @param string $order_by The column the quizzes should be ordered by
96
+ * @param string $order whether the $order_by should be ordered as ascending or decending. Can be "ASC" or "DESC"
97
+ * @return array All of the quizzes as a numerical array of objects
98
+ */
99
+ public function get_quizzes( $include_deleted = false, $order_by = 'quiz_id', $order = 'DESC' ) {
100
+ global $wpdb;
101
+
102
+ // Set order direction
103
+ $order_direction = 'DESC';
104
+ if ( 'ASC' == $order ) {
105
+ $order_direction = 'ASC';
106
+ }
107
+
108
+ // Set field to sort by
109
+ switch ( $order_by ) {
110
+ case 'last_activity':
111
+ $order_field = 'last_activity';
112
+ break;
113
+
114
+ case 'quiz_views':
115
+ $order_field = 'quiz_views';
116
+ break;
117
+
118
+ case 'quiz_taken':
119
+ $order_field = 'quiz_taken';
120
+ break;
121
+
122
+ default:
123
+ $order_field = 'quiz_id';
124
+ break;
125
+ }
126
+
127
+ // Should we include deleted?
128
+ $delete = "WHERE deleted='0'";
129
+ if ( $include_deleted ) {
130
+ $delete = '';
131
+ }
132
+
133
+ // Get quizzes and return them
134
+ $quizzes = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}mlw_quizzes $delete ORDER BY $order_field $order_direction" );
135
+ return $quizzes;
136
+ }
137
+
138
  /**
139
  * Registers a quiz setting
140
  *
195
  */
196
  public function generate_settings_section( $section = 'quiz_options' ) {
197
  global $mlwQuizMasterNext;
198
+ QSM_Fields::generate_section( $mlwQuizMasterNext->quiz_settings->load_setting_fields( $section ), $section );
199
  }
200
 
201
  /**
php/class-qmn-quiz-creator.php CHANGED
@@ -398,6 +398,8 @@ class QMNQuizCreator
398
 
399
  $mlwQuizMasterNext->alertManager->newAlert(__('Your new quiz or survey has been created successfully. To begin editing, click the Edit link.', 'quiz-master-next'), 'success');
400
  $mlwQuizMasterNext->audit_manager->new_audit( "New Quiz/Survey Has Been Created: $quiz_name" );
 
 
401
  do_action('qmn_quiz_created', $new_quiz);
402
  }
403
  else
@@ -464,6 +466,8 @@ class QMNQuizCreator
464
  $mlwQuizMasterNext->alertManager->newAlert(sprintf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0002'), 'error');
465
  $mlwQuizMasterNext->log_manager->add("Error 0002", $wpdb->last_error.' from '.$wpdb->last_query, 0, 'error');
466
  }
 
 
467
  do_action('qmn_quiz_deleted', $quiz_id);
468
  }
469
 
398
 
399
  $mlwQuizMasterNext->alertManager->newAlert(__('Your new quiz or survey has been created successfully. To begin editing, click the Edit link.', 'quiz-master-next'), 'success');
400
  $mlwQuizMasterNext->audit_manager->new_audit( "New Quiz/Survey Has Been Created: $quiz_name" );
401
+
402
+ // Hook called after new quiz or survey has been created. Passes quiz_id to hook
403
  do_action('qmn_quiz_created', $new_quiz);
404
  }
405
  else
466
  $mlwQuizMasterNext->alertManager->newAlert(sprintf(__('There has been an error in this action. Please share this with the developer. Error Code: %s', 'quiz-master-next'), '0002'), 'error');
467
  $mlwQuizMasterNext->log_manager->add("Error 0002", $wpdb->last_error.' from '.$wpdb->last_query, 0, 'error');
468
  }
469
+
470
+ // Hook called after quiz or survey is deleted. Hook passes quiz_id to function
471
  do_action('qmn_quiz_deleted', $quiz_id);
472
  }
473
 
php/class-qmn-quiz-manager.php CHANGED
@@ -564,7 +564,7 @@ class QMNQuizManager {
564
  $mlw_qmn_timer = isset($_POST["timer"]) ? intval( $_POST["timer"] ) : 0;
565
  $qmn_array_for_variables['user_id'] = get_current_user_id();
566
  $qmn_array_for_variables['timer'] = $mlw_qmn_timer;
567
- $qmn_array_for_variables['time_taken'] = date("h:i:s A m/d/Y");
568
  $qmn_array_for_variables['contact'] = $contact_responses;
569
 
570
  if (!isset($_POST["mlw_code_captcha"]) || (isset($_POST["mlw_code_captcha"]) && $_POST["mlw_user_captcha"] == $_POST["mlw_code_captcha"]))
@@ -1168,7 +1168,7 @@ function qsm_scheduled_timeframe_check( $display, $options, $variable_data ) {
1168
  $end = strtotime( $options->scheduled_time_end ) + 86399;
1169
 
1170
  // Checks if the current timestamp is outside of scheduled timeframe
1171
- if ( time() < $start || time() > $end ) {
1172
  $qmn_allowed_visit = false;
1173
  $message = wpautop( htmlspecialchars_decode( $options->scheduled_timeframe_text, ENT_QUOTES ) );
1174
  $message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message, $variable_data );
564
  $mlw_qmn_timer = isset($_POST["timer"]) ? intval( $_POST["timer"] ) : 0;
565
  $qmn_array_for_variables['user_id'] = get_current_user_id();
566
  $qmn_array_for_variables['timer'] = $mlw_qmn_timer;
567
+ $qmn_array_for_variables['time_taken'] = date("h:i:s A m/d/Y", current_time( 'timestamp' ) );
568
  $qmn_array_for_variables['contact'] = $contact_responses;
569
 
570
  if (!isset($_POST["mlw_code_captcha"]) || (isset($_POST["mlw_code_captcha"]) && $_POST["mlw_user_captcha"] == $_POST["mlw_code_captcha"]))
1168
  $end = strtotime( $options->scheduled_time_end ) + 86399;
1169
 
1170
  // Checks if the current timestamp is outside of scheduled timeframe
1171
+ if ( current_time( 'timestamp' ) < $start || current_time( 'timestamp' ) > $end ) {
1172
  $qmn_allowed_visit = false;
1173
  $message = wpautop( htmlspecialchars_decode( $options->scheduled_timeframe_text, ENT_QUOTES ) );
1174
  $message = apply_filters( 'mlw_qmn_template_variable_quiz_page', $message, $variable_data );
php/class-qsm-fields.php CHANGED
@@ -19,6 +19,7 @@ class QSM_Fields {
19
  public static function generate_section( $fields, $section ) {
20
 
21
  global $mlwQuizMasterNext;
 
22
 
23
  // If nonce is correct, save settings
24
  if ( isset( $_POST["save_settings_nonce"] ) && wp_verify_nonce( $_POST['save_settings_nonce'], 'save_settings') ) {
19
  public static function generate_section( $fields, $section ) {
20
 
21
  global $mlwQuizMasterNext;
22
+ global $wpdb;
23
 
24
  // If nonce is correct, save settings
25
  if ( isset( $_POST["save_settings_nonce"] ) && wp_verify_nonce( $_POST['save_settings_nonce'], 'save_settings') ) {
php/dashboard-widgets.php CHANGED
@@ -32,7 +32,7 @@ add_action( 'wp_dashboard_setup', 'qmn_add_dashboard_widget' );
32
  function qmn_snapshot_dashboard_widget()
33
  {
34
  global $wpdb;
35
- $mlw_qmn_today_taken = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".date("Y-m-d")." 00:00:00' AND '".date("Y-m-d")." 23:59:59') AND deleted=0");
36
  $mlw_last_week = mktime(0, 0, 0, date("m") , date("d")-7, date("Y"));
37
  $mlw_last_week = date("Y-m-d", $mlw_last_week);
38
  $mlw_qmn_last_weekday_taken = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_last_week." 00:00:00' AND '".$mlw_last_week." 23:59:59') AND deleted=0");
32
  function qmn_snapshot_dashboard_widget()
33
  {
34
  global $wpdb;
35
+ $mlw_qmn_today_taken = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '" . date( "Y-m-d", current_time( 'timestamp' ) )." 00:00:00' AND '" . date( "Y-m-d", current_time( 'timestamp' ) )." 23:59:59') AND deleted=0");
36
  $mlw_last_week = mktime(0, 0, 0, date("m") , date("d")-7, date("Y"));
37
  $mlw_last_week = date("Y-m-d", $mlw_last_week);
38
  $mlw_qmn_last_weekday_taken = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE (time_taken_real BETWEEN '".$mlw_last_week." 00:00:00' AND '".$mlw_last_week." 23:59:59') AND deleted=0");
php/options-page-questions-tab.php CHANGED
@@ -545,9 +545,8 @@ function qsm_options_questions_tab_content() {
545
  <label class="option_label"><?php _e('Question Type', 'quiz-master-next'); ?></label>
546
  <select class="option_input" name="question_type" id="question_type">
547
  <?php
548
- foreach($qmn_question_types as $type)
549
- {
550
- echo "<option value='".$type['slug']."'>".$type['name']."</option>";
551
  }
552
  ?>
553
  </select>
@@ -560,21 +559,21 @@ function qsm_options_questions_tab_content() {
560
  <div id="answer_area">
561
  <div class="answer_headers">
562
  <div class="answer_number">&nbsp;</div>
563
- <div class="answer_text"><?php _e('Answers', 'quiz-master-next'); ?></div>
564
- <div class="answer_points"><?php _e('Points Worth', 'quiz-master-next'); ?></div>
565
- <div class="answer_correct"><?php _e('Correct Answer', 'quiz-master-next'); ?></div>
566
  </div>
567
  <div class="answers" id="answers">
568
 
569
  </div>
570
- <a href="#" class="button" id="new_answer_button"><?php _e('Add New Answer!', 'quiz-master-next'); ?></a>
571
  </div>
572
  </fieldset>
573
  <fieldset>
574
  <legend>Question Options</legend>
575
  <div id="correct_answer_area" class="row">
576
  <label class="option_label"><?php _e('Correct Answer Info', 'quiz-master-next'); ?></label>
577
- <input class="option_input" type="text" name="correct_answer_info" value="" id="correct_answer_info" />
578
  </div>
579
 
580
  <div id="hint_area" class="row">
@@ -608,10 +607,8 @@ function qsm_options_questions_tab_content() {
608
  <label class="option_label"><?php _e('Category', 'quiz-master-next'); ?></label>
609
  <div class="option_input">
610
  <?php
611
- foreach($qmn_quiz_categories as $category)
612
- {
613
- if ($category->category != '')
614
- {
615
  ?>
616
  <input type="radio" class="category_radio" name="new_category" id="new_category<?php echo esc_attr($category->category); ?>" value="<?php echo esc_attr($category->category); ?>">
617
  <label for="new_category<?php echo esc_attr($category->category); ?>"><?php echo $category->category; ?></label>
545
  <label class="option_label"><?php _e('Question Type', 'quiz-master-next'); ?></label>
546
  <select class="option_input" name="question_type" id="question_type">
547
  <?php
548
+ foreach( $qmn_question_types as $type ) {
549
+ echo "<option value='{$type['slug']}'>{$type['name']}</option>";
 
550
  }
551
  ?>
552
  </select>
559
  <div id="answer_area">
560
  <div class="answer_headers">
561
  <div class="answer_number">&nbsp;</div>
562
+ <div class="answer_text"><?php _e( 'Answers', 'quiz-master-next' ); ?></div>
563
+ <div class="answer_points"><?php _e( 'Points Worth', 'quiz-master-next' ); ?></div>
564
+ <div class="answer_correct"><?php _e( 'Correct Answer', 'quiz-master-next' ); ?></div>
565
  </div>
566
  <div class="answers" id="answers">
567
 
568
  </div>
569
+ <a href="#" class="button" id="new_answer_button"><?php _e( 'Add New Answer!', 'quiz-master-next' ); ?></a>
570
  </div>
571
  </fieldset>
572
  <fieldset>
573
  <legend>Question Options</legend>
574
  <div id="correct_answer_area" class="row">
575
  <label class="option_label"><?php _e('Correct Answer Info', 'quiz-master-next'); ?></label>
576
+ <textarea class="option_input" type="text" name="correct_answer_info" value="" id="correct_answer_info"></textarea>
577
  </div>
578
 
579
  <div id="hint_area" class="row">
607
  <label class="option_label"><?php _e('Category', 'quiz-master-next'); ?></label>
608
  <div class="option_input">
609
  <?php
610
+ foreach( $qmn_quiz_categories as $category ) {
611
+ if ( $category->category != '' ) {
 
 
612
  ?>
613
  <input type="radio" class="category_radio" name="new_category" id="new_category<?php echo esc_attr($category->category); ?>" value="<?php echo esc_attr($category->category); ?>">
614
  <label for="new_category<?php echo esc_attr($category->category); ?>"><?php echo $category->category; ?></label>
php/quizzes-page.php CHANGED
@@ -50,8 +50,8 @@ function qsm_generate_quizzes_surveys_page() {
50
  }
51
 
52
  // Load our quizzes
53
- $quizzes = $wpdb->get_results( "SELECT quiz_id, quiz_name, quiz_views, quiz_taken, last_activity FROM {$wpdb->prefix}mlw_quizzes WHERE deleted='0' ORDER BY quiz_id DESC" );
54
-
55
  // Load quiz posts
56
  $post_to_quiz_array = array();
57
  $my_query = new WP_Query( array( 'post_type' => 'quiz', 'posts_per_page' => -1, 'post_status' => 'publish' ) );
@@ -85,6 +85,8 @@ function qsm_generate_quizzes_surveys_page() {
85
  );
86
  }
87
 
 
 
88
  $quiz_json_array[] = array(
89
  'id' => $quiz->quiz_id,
90
  'name' => esc_html( $quiz->quiz_name ),
@@ -92,7 +94,7 @@ function qsm_generate_quizzes_surveys_page() {
92
  'postID' => $post_to_quiz_array[ $quiz->quiz_id ]['id'],
93
  'views' => $quiz->quiz_views,
94
  'taken' => $quiz->quiz_taken,
95
- 'lastActivity' => $quiz->last_activity
96
  );
97
  }
98
  $total_count = count( $quiz_json_array );
@@ -120,7 +122,7 @@ function qsm_generate_quizzes_surveys_page() {
120
  <th><?php _e( 'Name', 'quiz-master-next' ); ?></th>
121
  <th><?php _e( 'URL', 'quiz-master-next' ); ?></th>
122
  <th><?php _e( 'Shortcode', 'quiz-master-next' ); ?></th>
123
- <th><?php _e( 'Leaderboard Shortcode', 'quiz-master-next' ); ?></th>
124
  <th><?php _e( 'Views', 'quiz-master-next' ); ?></th>
125
  <th><?php _e( 'Taken', 'quiz-master-next' ); ?></th>
126
  <th><?php _e( 'Last Modified', 'quiz-master-next' ); ?></th>
@@ -134,7 +136,7 @@ function qsm_generate_quizzes_surveys_page() {
134
  <th><?php _e( 'Name', 'quiz-master-next' ); ?></th>
135
  <th><?php _e( 'URL', 'quiz-master-next' ); ?></th>
136
  <th><?php _e( 'Shortcode', 'quiz-master-next' ); ?></th>
137
- <th><?php _e( 'Leaderboard Shortcode', 'quiz-master-next' ); ?></th>
138
  <th><?php _e( 'Views', 'quiz-master-next' ); ?></th>
139
  <th><?php _e( 'Taken', 'quiz-master-next' ); ?></th>
140
  <th><?php _e( 'Last Modified', 'quiz-master-next' ); ?></th>
50
  }
51
 
52
  // Load our quizzes
53
+ $quizzes = $mlwQuizMasterNext->pluginHelper->get_quizzes();
54
+
55
  // Load quiz posts
56
  $post_to_quiz_array = array();
57
  $my_query = new WP_Query( array( 'post_type' => 'quiz', 'posts_per_page' => -1, 'post_status' => 'publish' ) );
85
  );
86
  }
87
 
88
+ $activity_date = date_i18n( get_option( 'date_format' ), strtotime( $quiz->last_activity ) );
89
+ $activity_time = date( "h:i:s A", strtotime( $quiz->last_activity ) );
90
  $quiz_json_array[] = array(
91
  'id' => $quiz->quiz_id,
92
  'name' => esc_html( $quiz->quiz_name ),
94
  'postID' => $post_to_quiz_array[ $quiz->quiz_id ]['id'],
95
  'views' => $quiz->quiz_views,
96
  'taken' => $quiz->quiz_taken,
97
+ 'lastActivity' => $activity_date . ' ' . $activity_time
98
  );
99
  }
100
  $total_count = count( $quiz_json_array );
122
  <th><?php _e( 'Name', 'quiz-master-next' ); ?></th>
123
  <th><?php _e( 'URL', 'quiz-master-next' ); ?></th>
124
  <th><?php _e( 'Shortcode', 'quiz-master-next' ); ?></th>
125
+ <th><?php _e( 'Link Shortcode', 'quiz-master-next' ); ?></th>
126
  <th><?php _e( 'Views', 'quiz-master-next' ); ?></th>
127
  <th><?php _e( 'Taken', 'quiz-master-next' ); ?></th>
128
  <th><?php _e( 'Last Modified', 'quiz-master-next' ); ?></th>
136
  <th><?php _e( 'Name', 'quiz-master-next' ); ?></th>
137
  <th><?php _e( 'URL', 'quiz-master-next' ); ?></th>
138
  <th><?php _e( 'Shortcode', 'quiz-master-next' ); ?></th>
139
+ <th><?php _e( 'Link Shortcode', 'quiz-master-next' ); ?></th>
140
  <th><?php _e( 'Views', 'quiz-master-next' ); ?></th>
141
  <th><?php _e( 'Taken', 'quiz-master-next' ); ?></th>
142
  <th><?php _e( 'Last Modified', 'quiz-master-next' ); ?></th>
php/shortcodes.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Displays a link to a quiz using ID. Used [qsm_link id=1]Click Here[/qsm_link]
4
+ *
5
+ * @since 5.1.0
6
+ * @param array $atts Attributes from add_shortcode function
7
+ * @param string $content The text to be used for the link
8
+ * @return string The HTML the shortcode will be replaced with
9
+ */
10
+ function qsm_quiz_link_shortcode( $atts, $content = '' ) {
11
+ extract(shortcode_atts(array(
12
+ 'id' => 0,
13
+ 'class' => '',
14
+ 'target' => ''
15
+ ), $atts));
16
+ $id = intval( $id );
17
+
18
+ // Find the permalink by finding the post with the meta_key 'quiz_id' of supplied quiz
19
+ $permalink = '';
20
+ $my_query = new WP_Query( array( 'post_type' => 'quiz', 'meta_key' => 'quiz_id', 'meta_value' => $id, 'posts_per_page' => 1, 'post_status' => 'publish' ) );
21
+ if ( $my_query->have_posts() ) {
22
+ while ( $my_query->have_posts() ) {
23
+ $my_query->the_post();
24
+ $permalink = get_permalink();
25
+ }
26
+ }
27
+ wp_reset_postdata();
28
+
29
+ // Craft the target attribute if one is passed to shortcode
30
+ $target_html = '';
31
+ if ( ! empty( $target ) ) {
32
+ $target_html = "target='" . esc_attr( $target ) . "'";
33
+ }
34
+ return "<a href='" . esc_url( $permalink ) . "' class='" . esc_attr( $class ) . "' $target_html>" . esc_html( $content ) . "</a>";
35
+ }
36
+ add_shortcode( 'qsm_link', 'qsm_quiz_link_shortcode' );
37
+ ?>
php/template-variables.php CHANGED
@@ -53,13 +53,13 @@ add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_question_
53
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_comments',10,2);
54
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_timer',10,2);
55
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_timer_minutes',10,2);
56
- add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_date',10,2);
57
- add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_date_taken',10,2);
58
  add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_facebook_share',10,2);
59
  add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_twitter_share',10,2);
60
 
61
  add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_quiz_name',10,2);
62
- add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_date',10,2);
63
  add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_current_user',10,2);
64
 
65
  /**
@@ -246,14 +246,30 @@ function mlw_qmn_variable_timer_minutes($content, $mlw_quiz_array)
246
  $content = str_replace( "%TIMER_MINUTES%" , $mlw_minutes, $content);
247
  return $content;
248
  }
249
- function mlw_qmn_variable_date($content, $mlw_quiz_array)
250
- {
251
- $content = str_replace( "%CURRENT_DATE%" , date("F jS Y"), $content);
 
 
 
 
 
 
 
 
252
  return $content;
253
  }
254
 
255
- function mlw_qmn_variable_date_taken( $content, $mlw_quiz_array ) {
256
- $content = str_replace( "%DATE_TAKEN%" , date("m/d/Y", strtotime( $mlw_quiz_array["time_taken"] ) ), $content);
 
 
 
 
 
 
 
 
257
  return $content;
258
  }
259
 
53
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_comments',10,2);
54
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_timer',10,2);
55
  add_filter('mlw_qmn_template_variable_results_page', 'mlw_qmn_variable_timer_minutes',10,2);
56
+ add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_date',10,2);
57
+ add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_date_taken',10,2);
58
  add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_facebook_share',10,2);
59
  add_filter('mlw_qmn_template_variable_results_page', 'qsm_variable_twitter_share',10,2);
60
 
61
  add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_quiz_name',10,2);
62
+ add_filter('mlw_qmn_template_variable_quiz_page', 'qsm_variable_date',10,2);
63
  add_filter('mlw_qmn_template_variable_quiz_page', 'mlw_qmn_variable_current_user',10,2);
64
 
65
  /**
246
  $content = str_replace( "%TIMER_MINUTES%" , $mlw_minutes, $content);
247
  return $content;
248
  }
249
+
250
+ /**
251
+ * Replaces the variable %CURRENT_DATE% and displays the current date
252
+ *
253
+ * @param string $content The contents of the results page
254
+ * @param array $results The array of all the results from user taking the quiz
255
+ * @return string Returns the contents for the results page
256
+ */
257
+ function qsm_variable_date( $content, $results ) {
258
+ $date = date_i18n( get_option( 'date_format' ), time() );
259
+ $content = str_replace( "%CURRENT_DATE%" , $date, $content);
260
  return $content;
261
  }
262
 
263
+ /**
264
+ * Replaces the variable %DATE_TAKEN% and returns the date the user submitted his or her responses
265
+ *
266
+ * @param string $content The contents of the results page
267
+ * @param array $results The array of all the results from user taking the quiz
268
+ * @return string Returns the contents for the results page
269
+ */
270
+ function qsm_variable_date_taken( $content, $results ) {
271
+ $date = date_i18n( get_option( 'date_format' ), strtotime( $results["time_taken"] ) );
272
+ $content = str_replace( "%DATE_TAKEN%" , $date, $content);
273
  return $content;
274
  }
275
 
php/widgets.php CHANGED
@@ -48,8 +48,8 @@ class Mlw_Qmn_Leaderboard_Widget extends WP_Widget {
48
  // widget display
49
  function widget($args, $instance) {
50
  extract( $args );
51
- // these are the widget options
52
- $title = apply_filters('widget_title', $instance['title']);
53
  $quiz_id = $instance['quiz_id'];
54
  echo $before_widget;
55
  // Display the widget
48
  // widget display
49
  function widget($args, $instance) {
50
  extract( $args );
51
+ // Filter to alter leadboard widget title
52
+ $title = apply_filters('qsm_leaderboard_widget_title', $instance['title']);
53
  $quiz_id = $instance['quiz_id'];
54
  echo $before_widget;
55
  // Display the widget
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: fpcorso
3
  Tags: quiz, survey, lead, test, score, exam, questionnaire, answer, question, points
4
  Requires at least: 4.7
5
  Tested up to: 4.8
6
- Stable tag: 5.0.7
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -108,50 +108,16 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
108
 
109
  == Changelog ==
110
 
111
- = 5.0.7 (September 18, 2017) =
112
- * Closed Bug: Answers of "0" disappear when adding or editing questions - ([Issue #531](https://github.com/fpcorso/quiz_master_next/issues/531))
113
-
114
- = 5.0.6 (August 1, 2017) =
115
- * Closed Bug: HTML Entities causing incorrect answers and missing user answer - ([Issue #565](https://github.com/fpcorso/quiz_master_next/issues/565))
116
-
117
- = 5.0.5 (July 8, 2017) =
118
- * Closed Enhancement: Add notice for leaderboard removal - ([Issue #562](https://github.com/fpcorso/quiz_master_next/issues/562))
119
- * Closed Bug: Scheduled timeframe options are not working - ([Issue #558](https://github.com/fpcorso/quiz_master_next/issues/558))
120
-
121
- = 5.0.4 (June 19, 2017) =
122
- * Closed Bug: Required fields are not checked 2nd time user takes quiz when timer is turned on ([Issue #528](https://github.com/fpcorso/quiz_master_next/issues/528))
123
- * Closed Enhancement: Ensure compatibility with WordPress 4.8 ([Issue #554](https://github.com/fpcorso/quiz_master_next/issues/554))
124
-
125
- = 5.0.3 (May 29, 2017) =
126
- * Minor code changes
127
-
128
- = 5.0.2 (May 7, 2017) =
129
- * Closed Bug: Social sharing text not updating when user changes the text ([Issue #541](https://github.com/fpcorso/quiz_master_next/issues/541))
130
-
131
- = 5.0.1 (March 27, 2017) =
132
- * Closed Bug: The setting to hide contact fields from logged-in users is hiding fields from visitors too ([Issue #535](https://github.com/fpcorso/quiz_master_next/issues/535))
133
-
134
- = 5.0.0 (March 25, 2017) =
135
- * Closed Bug: Fix delete custom post types during uninstall bug ([Issue #527](https://github.com/fpcorso/quiz_master_next/issues/527))
136
- * Closed Enhancement: Change Shortcode To QSM ([Issue #515](https://github.com/fpcorso/quiz_master_next/issues/515))
137
- * Closed Enhancement: Search function for quizzes/surveys ([Issue #492](https://github.com/fpcorso/quiz_master_next/issues/492))
138
- * Closed Enhancement: Create new fields class to handle creation/post data of settings fields ([Issue #450](https://github.com/fpcorso/quiz_master_next/issues/450))
139
- * Closed Enhancement: Create new settings class to handle the settings data ([Issue #449](https://github.com/fpcorso/quiz_master_next/issues/449))
140
- * Closed Enhancement: Rewrite options system to allow for extendibility ([Issue #448](https://github.com/fpcorso/quiz_master_next/issues/448))
141
- * Closed Enhancement: Enable tabs for the admin results page ([Issue #408](https://github.com/fpcorso/quiz_master_next/issues/408))
142
- * Closed Enhancement: Create onboarding process ([Issue #397](https://github.com/fpcorso/quiz_master_next/issues/397))
143
- * Closed Enhancement: Create new contact tab to allow form creation ([Issue #394](https://github.com/fpcorso/quiz_master_next/issues/394))
144
- * Closed Enhancement: Move Certificate to free addon ([Issue #381](https://github.com/fpcorso/quiz_master_next/issues/381))
145
- * Closed Enhancement: Ability to add check box for privacy statement with the contact fields ([Issue #372](https://github.com/fpcorso/quiz_master_next/issues/372))
146
- * Closed Enhancement: Customize the "Please complete all required fields!" text ([Issue #371](https://github.com/fpcorso/quiz_master_next/issues/371))
147
- * Closed Enhancement: Allow admins to customize the validation error messages ([Issue #346](https://github.com/fpcorso/quiz_master_next/issues/346))
148
- * Closed Enhancement: Hint field cannot be customized ([Issue #262](https://github.com/fpcorso/quiz_master_next/issues/262))
149
- * Closed Enhancement: Add custom fields to the contact form ([Issue #211](https://github.com/fpcorso/quiz_master_next/issues/211))
150
- * Closed Enhancement: Scrollable List of Quizzes ([Issue #46](https://github.com/fpcorso/quiz_master_next/issues/46))
151
-
152
- ([Read Full Changelog](https://github.com/fpcorso/quiz_master_next/blob/master/CHANGELOG.md))
153
 
154
  == Upgrade Notice ==
155
 
156
- = 5.0.0 =
157
- Upgrade to use a variety of new features including new contact fields system, new options to customize hint and error messages, and more!
3
  Tags: quiz, survey, lead, test, score, exam, questionnaire, answer, question, points
4
  Requires at least: 4.7
5
  Tested up to: 4.8
6
+ Stable tag: 5.1.0
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
108
 
109
  == Changelog ==
110
 
111
+ = 5.1.0 (October 2, 2017) =
112
+ * Closed Enhancement: Add all active quizzes function to API - ([Issue #552](https://github.com/fpcorso/quiz_master_next/issues/552))
113
+ * Closed User Request: Shortcode or variable for dynamic link to specific quiz/survey - ([Issue #524](https://github.com/fpcorso/quiz_master_next/issues/524))
114
+ * Closed Enhancement: Use locale's date to generate date strings - ([Issue #479](https://github.com/fpcorso/quiz_master_next/issues/479))
115
+ * Closed User Request: Allow users to change the date to European Date DD.MM.YYYY - ([Issue #439](https://github.com/fpcorso/quiz_master_next/issues/439))
116
+ * Closed User Request: More Space in the Correct Answer Info textbox - ([Issue #417](https://github.com/fpcorso/quiz_master_next/issues/417))
117
+
118
+ = ([Read Full Changelog](https://github.com/fpcorso/quiz_master_next/blob/master/CHANGELOG.md)) =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
 
120
  == Upgrade Notice ==
121
 
122
+ = 5.1.0 =
123
+ Upgrade to get a new link shortcode, localized dates, and more!