improve quiz question explanations for ungraded quizzes

test plan:
* create an ungraded survey quiz
* start to add a new question
* the instructions at the top of the question form for
 each question type should not refer to "correct" answers
 when not applicable
(i.e. for types other than numerical/formula questions)

closes #CNVS-8248

Change-Id: Ifa0111a5aeb700e88221e903e36e48f723423ab6
Reviewed-on: https://gerrit.instructure.com/64987
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
This commit is contained in:
James Williams 2015-10-12 05:46:51 -06:00
parent 59a56f58c3
commit 1cbf896cbd
2 changed files with 32 additions and 2 deletions

View File

@ -29,6 +29,29 @@
</div>
<div class="clear"></div>
<div class="text">
<%# explanations for ungraded quizzes - basically the same sans references to "correct" answers %>
<div tabindex="0" class="multiple_choice_question_survey_quiz_explanation explanation subheader">
<%= t("Enter your question and multiple answers.") %>
</div>
<div tabindex="0" class="true_false_question_survey_quiz_explanation explanation subheader">
<%= t("Enter your question text.") %>
</div>
<div tabindex="0" class="short_answer_question_survey_quiz_explanation explanation subheader">
<%= t("Enter your question text. \nStudents will see the question followed by a small text box to type their answer.") %>
</div>
<div tabindex="0" class="fill_in_multiple_blanks_question_survey_quiz_explanation explanation subheader">
<%= t("Enter your question, specifying where each blank should go. Students must type answers into text boxes at each blank.") %>
</div>
<div tabindex="0" class="multiple_answers_question_survey_quiz_explanation explanation subheader">
<%= t("This question will show a checkbox next to each answer.") %>
</div>
<div tabindex="0" class="multiple_dropdowns_question_survey_quiz_explanation explanation subheader">
<%= t("Enter your question, specifying where each dropdown should go. Then define possible answers for each dropdown.") %>
</div>
<div tabindex="0" class="missing_word_question_survey_quiz_explanation explanation subheader">
<%= t("Define text to go before and after the dropdown and build a set of possible answers.") %>
</div>
<div tabindex="0" class="multiple_choice_question_explanation explanation subheader">
<%= t('explanations.multiple_choice', "Enter your question and multiple answers, then select the one correct answer.") %>
</div>

View File

@ -654,12 +654,19 @@ define([
result.textValues = ['answer_weight', 'answer_text', 'answer_comment', 'blank_id', 'id', 'match_id'];
result.htmlValues = ['answer_html', 'answer_match_left_html', 'answer_comment_html'];
result.question_type = question_type;
$formQuestion.find(".explanation").hide().filter("." + question_type + "_explanation").show();
var is_survey_quiz = $("#questions").hasClass('survey_quiz');
if (is_survey_quiz && $formQuestion.find("." + question_type + "_survey_quiz_explanation").length > 0) {
$formQuestion.find(".explanation").hide().filter("." + question_type + "_survey_quiz_explanation").show();
} else {
$formQuestion.find(".explanation").hide().filter("." + question_type + "_explanation").show();
}
$formQuestion.attr('class', 'question').addClass('selectable');
$formQuestion.find(".missing_word_after_answer").hide().end()
.find(".matching_answer_incorrect_matches_holder").hide().end()
.find(".question_comment").css('display', '').end();
if ($("#questions").hasClass('survey_quiz')) {
if (is_survey_quiz) {
$formQuestion.find(".question_comment").css('display', 'none').end()
.find(".question_neutral_comment").css('display', '');
}