Skip to content

Commit ad9847d

Browse files
committed
Version 2.0.1
1 parent 15680a3 commit ad9847d

29 files changed

+236
-280
lines changed

1.0.0 to 2.0.0 Upgrade Checklist.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// These are the changes that need to be done when upgrading the plugin from 2.0.0 to 2.0.1.
2+
3+
Backup the chained_quiz plugin tables.
4+
5+
Backup the entire site.
6+
7+
Delete OUTPUT files from source folder.
8+
9+
Update the version # in the options table (if plugin files uploaded backend)
10+
11+
Submissions page shortcode should restrict by algorithm id.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ None yet.
6666
3. And of course you can define different results depending on the results collected in the quiz
6767

6868
# Changelog
69+
## Version 2.0.1
70+
- Bug fixes.
71+
6972
## Version 2.0
7073
- Added Dashboard functionality.
7174

controllers/completed.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static function manage() {
122122
// select all the given answers in these records
123123
$rids = array(0);
124124
foreach($records as $record) $rids[] = $record->id;
125-
$answers = $wpdb->get_results( "SELECT tA.answer as answer, tA.points as points, tQ.title as question,
125+
$answers = $wpdb->get_results( "SELECT tA.answer as answer, tA.answer_text as answer_text, tA.points as points, tQ.title as question,
126126
tA.completion_id as completion_id, tQ.qtype as qtype, tA.comments as comments
127127
FROM ".CHAINED_USER_ANSWERS." tA JOIN ".CHAINED_QUESTIONS." tQ
128128
ON tQ.id = tA.question_id
@@ -147,7 +147,7 @@ static function manage() {
147147
$ids = explode(',', $answer->answer);
148148
$answer_text = '';
149149

150-
if($answer->qtype == 'text') $answer_text = esc_html(stripslashes($answer->answer));
150+
if($answer->qtype == 'text') $answer_text = esc_html(stripslashes($answer->answer_text));
151151
else {
152152
foreach($ids as $id) {
153153
foreach($choices as $choice) {
@@ -242,8 +242,8 @@ static function manage() {
242242
include(CHAINED_PATH."/views/completed.html.php");
243243
} // end manage
244244

245-
// Generate the triage algorithm responses dashboard/table.
246-
static function view_responses() {
245+
// Generate the triage algorithm submitted responses as a dashboard/table.
246+
static function view_submissions($algorithm_ids) {
247247
global $wpdb;
248248

249249
$results = $wpdb->get_results(
@@ -252,14 +252,15 @@ static function view_responses() {
252252
JOIN ".CHAINED_COMPLETED." tCOM
253253
JOIN ".CHAINED_QUESTIONS." tQUES
254254
JOIN ".CHAINED_USER_ANSWERS." tUA
255-
WHERE tQUIZ.id = tCOM.quiz_id
255+
WHERE tQUIZ.id IN ($algorithm_ids)
256+
AND tQUIZ.id = tCOM.quiz_id
256257
AND tQUIZ.id = tQUES.quiz_id
257258
AND tQUES.id = tUA.question_id
258259
AND tCOM.id = tUA.completion_id
259260
AND tQUES.sort_order = 1
260261
ORDER BY tCOM.datetime DESC");
261262

262-
include(CHAINED_PATH."/views/responses.html.php");
263+
include(CHAINED_PATH."/views/submissions.html.php");
263264
}
264265

265266
// defines whether to sort by ASC or DESC

controllers/shortcodes.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ static function algorithmShortcodeHandler($atts) {
1212
return $content;
1313
} // end algorithm()
1414

15-
// Shortcode handler/receiver for [triage-dashboard].
15+
// Shortcode handler/receiver for [triage-submissions].
1616
static function responsesShortcodeHandler($atts) {
17+
18+
$args = shortcode_atts( array(
19+
'algorithm' => '0'
20+
), $atts );
21+
22+
$algorithm_id = @$atts[0];
1723
ob_start();
18-
ChainedQuizCompleted :: view_responses();
24+
ChainedQuizCompleted :: view_submissions($args['algorithm']);
1925
$content = ob_get_clean();
2026
return $content;
2127
} // end dashboard()

css/main.css

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,14 @@ textarea.chained-quiz-frontend {
4949
background-color: #FFFFFF;
5050
} */
5151

52+
.soap-note-canvas {
53+
background-color: #cce6ff;
54+
}
55+
5256
div.soap-note {
53-
border: 1px solid;
54-
border-color: #B3B3B3;
57+
border: 3px dashed;
58+
border-color: #ff0000;
59+
background-color: #ffffff;
5560
padding: 10px;
56-
box-shadow: 5px 5px 10px #888888;
61+
box-shadow: 5px 5px 10px #0D0D0D;
5762
}

helpers/.DS_Store

6 KB
Binary file not shown.

helpers/remote-call.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

js/common.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,13 @@ chainedQuiz.initializeQuestion = function(quizID) {
8585

8686
chainedQuiz.disagree = function(completionID, url) {
8787
// Prompt the user for feedback commment and encode the strings to a valid URL.
88-
var comment = encodeURI(prompt("What feedback do you have with the SOAP note?", ""));
88+
var comment = prompt("What feedback do you have with the SOAP note?", "");
89+
var encoded_comment = encodeURI(comment);
8990
if (comment != null) {
9091
// Prepare the URL parameters to POST.
9192
data = 'action=chainedquiz_ajax';
9293
data += '&chainedquiz_action=feedback';
93-
data += '&comment=' + comment;
94+
data += '&comment=' + encoded_comment;
9495

9596
// Submit the feedback to the server-side PHP.
9697
jQuery.post(url, data);

models/basic.php

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -151,29 +151,22 @@ static function install($update = false) {
151151
update_option('chained_user_subject', __('Your results on {{quiz-name}}', 'chained'));
152152
}
153153

154-
update_option('chainedquiz_version', "0.8");
154+
update_option('chainedquiz_version', "2.0.1");
155155
// exit;
156156
}
157157

158158
// main menu
159159
static function menu() {
160160
$chained_caps = current_user_can('manage_options') ? 'manage_options' : 'chained_manage';
161161

162-
add_menu_page(__('Triage Algorithm', 'chained'), __('Triage Algorithm', 'chained'), $chained_caps, "chained_quizzes",
163-
array('ChainedQuizQuizzes', "manage"));
164-
add_submenu_page('chained_quizzes', __('Quizzes', 'chained'), __('Quizzes', 'chained'), $chained_caps,
165-
'chained_quizzes', array('ChainedQuizQuizzes', "manage"));
166-
add_submenu_page('chained_quizzes', __('Settings', 'chained'), __('Settings', 'chained'), 'manage_options',
167-
'chainedquiz_options', array('ChainedQuiz','options'));
168-
add_submenu_page('chained_quizzes', __('Social Sharing', 'chained'), __('Social Sharing', 'chained'), $chained_caps,
169-
'chainedquiz_social_sharing', array('ChainedSharing','options'));
162+
add_menu_page(__('Triage Algorithm', 'chained'), __('Triage Algorithm', 'chained'), $chained_caps, "chained_quizzes", array('ChainedQuizQuizzes', "manage"));
163+
add_submenu_page('chained_quizzes', __('Algorithms', 'chained'), __('Algorithms', 'chained'), $chained_caps, 'chained_quizzes', array('ChainedQuizQuizzes', "manage"));
164+
add_submenu_page('chained_quizzes', __('Settings', 'chained'), __('Settings', 'chained'), 'manage_options', 'chainedquiz_options', array('ChainedQuiz','options'));
165+
add_submenu_page('chained_quizzes', __('Social Sharing', 'chained'), __('Social Sharing', 'chained'), $chained_caps, 'chainedquiz_social_sharing', array('ChainedSharing','options'));
170166

171-
add_submenu_page(NULL, __('Chained Quiz Results', 'chained'), __('Chained Quiz Results', 'chained'), $chained_caps,
172-
'chainedquiz_results', array('ChainedQuizResults','manage'));
173-
add_submenu_page(NULL, __('Chained Quiz Questions', 'chained'), __('Chained Quiz Questions', 'chained'), $chained_caps,
174-
'chainedquiz_questions', array('ChainedQuizQuestions','manage'));
175-
add_submenu_page(NULL, __('Users Completed Quiz', 'chained'), __('Users Completed Quiz', 'chained'), $chained_caps,
176-
'chainedquiz_list', array('ChainedQuizCompleted','manage'));
167+
add_submenu_page(NULL, __('Chained Quiz Results', 'chained'), __('Chained Quiz Results', 'chained'), $chained_caps, 'chainedquiz_results', array('ChainedQuizResults','manage'));
168+
add_submenu_page(NULL, __('Chained Quiz Questions', 'chained'), __('Chained Quiz Questions', 'chained'), $chained_caps, 'chainedquiz_questions', array('ChainedQuizQuestions','manage'));
169+
add_submenu_page(NULL, __('Users Completed Quiz', 'chained'), __('Users Completed Quiz', 'chained'), $chained_caps, 'chainedquiz_list', array('ChainedQuizCompleted','manage'));
177170

178171
}
179172

@@ -190,7 +183,7 @@ static function scripts() {
190183
'chained-common',
191184
CHAINED_URL.'js/common.js',
192185
false,
193-
'2.0.0',
186+
'2.0.1',
194187
false
195188
);
196189
wp_enqueue_script("chained-common");
@@ -217,7 +210,7 @@ static function init() {
217210

218211
// shortcodes
219212
add_shortcode('triage-algorithm', array("TriageShortcodes", "algorithmShortcodeHandler"));
220-
add_shortcode('triage-responses', array("TriageShortcodes", "responsesShortcodeHandler"));
213+
add_shortcode('triage-submissions', array("TriageShortcodes", "responsesShortcodeHandler"));
221214
add_shortcode('chained-share', array("ChainedSharing", "display"));
222215

223216
// once daily delete empty records older than 1 day

0 commit comments

Comments
 (0)