copy feedback for file_upload_questions
test plan: * create a quiz with a file upload question with a comment * copy the course * the copied question should preserve the comment closes #QO-88 Change-Id: I479d1f03f11cb00b727300c423ec2632286c8bc7 Reviewed-on: https://gerrit.instructure.com/171924 Tested-by: Jenkins Reviewed-by: Mysti Sadler <mysti@instructure.com> QA-Review: Mysti Sadler <mysti@instructure.com> Product-Review: James Williams <jamesw@instructure.com>
This commit is contained in:
parent
544e38bb04
commit
bf7170d492
|
@ -143,6 +143,7 @@ class AssessmentItemConverter
|
||||||
elsif !%w(text_only_question file_upload_question).include?(@migration_type)
|
elsif !%w(text_only_question file_upload_question).include?(@migration_type)
|
||||||
self.parse_question_data
|
self.parse_question_data
|
||||||
else
|
else
|
||||||
|
self.get_feedback if @migration_type == 'file_upload_question'
|
||||||
@question[:question_type] ||= @migration_type
|
@question[:question_type] ||= @migration_type
|
||||||
end
|
end
|
||||||
rescue => e
|
rescue => e
|
||||||
|
|
|
@ -255,7 +255,7 @@ module AngelPropExpected
|
||||||
:answers=>[],
|
:answers=>[],
|
||||||
:correct_comments=>"",
|
:correct_comments=>"",
|
||||||
:question_name=>"offline item?",
|
:question_name=>"offline item?",
|
||||||
:incorrect_comments=>"",
|
:incorrect_comments=>"asdf",
|
||||||
:migration_id=>nil,
|
:migration_id=>nil,
|
||||||
:points_possible=>1,
|
:points_possible=>1,
|
||||||
:question_type=>"file_upload_question",
|
:question_type=>"file_upload_question",
|
||||||
|
|
|
@ -129,7 +129,7 @@ module CC
|
||||||
presentation_options(pres_node, question)
|
presentation_options(pres_node, question)
|
||||||
end # presentation
|
end # presentation
|
||||||
|
|
||||||
unless ['text_only_question', 'file_upload_question'].include?(question['question_type'])
|
if question['question_type'] != 'text_only_question'
|
||||||
item_node.resprocessing do |res_node|
|
item_node.resprocessing do |res_node|
|
||||||
res_node.outcomes do |out_node|
|
res_node.outcomes do |out_node|
|
||||||
out_node.decvar(
|
out_node.decvar(
|
||||||
|
|
|
@ -1107,6 +1107,19 @@ equation: <img class="equation_image" title="Log_216" src="/equation_images/Log_
|
||||||
expect(q2.question_data['answers'].first['comments_html']).to eq text
|
expect(q2.question_data['answers'].first['comments_html']).to eq text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "should copy neutral feedback for file upload questions" do
|
||||||
|
q = @copy_from.quizzes.create!(:title => "q")
|
||||||
|
data = {"question_type" => "file_upload_question", 'name' => 'test question', "neutral_comments_html" => "<i>comment</i>", "neutral_comments" => "comment"}
|
||||||
|
qq = q.quiz_questions.create!(:question_data => data)
|
||||||
|
|
||||||
|
run_course_copy
|
||||||
|
|
||||||
|
q2 = @copy_to.quizzes.first
|
||||||
|
qq2 = q2.quiz_questions.first
|
||||||
|
expect(qq2.question_data['neutral_comments_html']).to eq data['neutral_comments_html']
|
||||||
|
expect(qq2.question_data['neutral_comments']).to eq data['neutral_comments']
|
||||||
|
end
|
||||||
|
|
||||||
describe "assignment overrides" do
|
describe "assignment overrides" do
|
||||||
before :once do
|
before :once do
|
||||||
@quiz_plain = @copy_from.quizzes.create!(title: 'my quiz')
|
@quiz_plain = @copy_from.quizzes.create!(title: 'my quiz')
|
||||||
|
|
Loading…
Reference in New Issue