Skip to content

Commit 669ef90

Browse files
committed
Version 5.1
1 parent 8bddd54 commit 669ef90

16 files changed

Lines changed: 100 additions & 93 deletions

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ None yet.
7070
4. The submissions dashboard to capture feedback for machine learning.
7171

7272
# Changelog
73+
## 5.1 (Show Answers on Questions Page)
74+
- Show/hide answers in the questions listing page (admin only).
75+
- Hyperlink from the answer to the next question to ask.
76+
- Fixed bug where published algorithms are not being hyperlinked.
77+
7378
## 5.0 (Checkbox Improvements)
7479
- Scores can have different SOAP note sections.
7580
- Added Date questions that display a calendar date picker.

SQL/multiple-choice-answers.sql

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

SQL/query.sql

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

SQL/quiz-goto-sort.sql

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

controllers/questions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ static function list_questions() {
108108

109109
$quiz = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".CHAINED_QUIZZES." WHERE id=%d", intval($_GET['quiz_id'])));
110110
$questions = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".CHAINED_QUESTIONS." WHERE quiz_id=%d ORDER BY sort_order, id", intval($_GET['quiz_id'])));
111+
$choices = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".CHAINED_CHOICES." WHERE quiz_id=%d ORDER BY id", intval($_GET['quiz_id'])));
111112
$count = count($questions);
112113
include(CHAINED_PATH."/views/questions.html.php");
113114
} // end list_quizzes

controllers/quizzes.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static function edit_quiz() {
5555
$output = stripslashes($quiz->output);
5656

5757
// is this quiz currently published?
58-
$is_published = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE post_content LIKE '%[chained-quiz ".intval($_GET['id'])."]%'
58+
$is_published = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE post_content LIKE '%[triage-algorithm ".intval($_GET['id'])."]%'
5959
AND post_status='publish' AND post_title!=''");
6060
include(CHAINED_PATH.'/views/quiz.html.php');
6161
} // end edit_quiz
@@ -82,13 +82,13 @@ static function list_quizzes() {
8282

8383
// now select all posts that have watu shortcode in them
8484
$posts=$wpdb->get_results("SELECT * FROM {$wpdb->posts}
85-
WHERE post_content LIKE '%[chained-quiz %]%' AND post_title!=''
85+
WHERE post_content LIKE '%[triage-algorithm %]%' AND post_title!=''
8686
AND post_status='publish' ORDER BY post_date DESC");
8787

8888
// match posts to exams
8989
foreach($quizzes as $cnt=>$quiz) {
9090
foreach($posts as $post) {
91-
if(strstr($post->post_content,"[chained-quiz ".$quiz->id."]")) {
91+
if(strstr($post->post_content,"[triage-algorithm ".$quiz->id."]")) {
9292
$quizzes[$cnt]->post=$post;
9393
break;
9494
}

models/basic.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static function install($update = false) {
140140
}
141141

142142
// Set the current plugin version number.
143-
update_option('chained_version', '5.0');
143+
update_option('chained_version', '5.1');
144144
// exit;
145145
}
146146

@@ -172,7 +172,7 @@ static function scripts() {
172172
'chained-common',
173173
CHAINED_URL.'js/common.js',
174174
false,
175-
'5.0',
175+
'5.1',
176176
false
177177
);
178178
wp_enqueue_script("chained-common");

models/question.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,20 @@ function display_choices($question, $choices) {
185185
return $output;
186186
break;
187187
case 'radio':
188+
$type = $question->qtype;
189+
$name = "answer";
190+
191+
foreach($choices as $choice) {
192+
$choice_text = stripslashes($choice->choice);
193+
$choice_text = do_shortcode($choice_text);
194+
$output .= "<div class='chained-quiz-choice'><label class='chained-quiz-label'><input class='chained-quiz-frontend chained-quiz-$type' type='$type' name='$name' value='".$choice->id."' $autocontinue> $choice_text</label></div>";
195+
}
196+
197+
return $output;
198+
break;
188199
case 'checkbox':
189200
$type = $question->qtype;
190-
$name = ($question->qtype == 'radio') ? "answer": "answers[]";
201+
$name = "answers[]";
191202
$noneID = null;
192203

193204
// Find the 'None' answer choice and cleanup data at the same time while we are already inspecting each element.

models/quiz.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ function send_emails($quiz, $output, $attach_path) {
292292
function auto_publish($quiz_id, $vars) {
293293
global $wpdb;
294294

295-
$post = array('post_content' => '[chained-quiz '.$quiz_id.']', 'post_name'=> sanitize_text_field($vars['title']),
295+
$post = array('post_content' => '[triage-algorithm '.$quiz_id.']', 'post_name'=> sanitize_text_field($vars['title']),
296296
'post_title'=>sanitize_text_field($vars['title']), 'post_status'=>'publish');
297297
wp_insert_post($post);
298298
}

readme upgrade to 5.0.txt

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

0 commit comments

Comments
 (0)