respondus: link assignment to quiz correctly
fixes CNVS-8915 test plan: - use the respondus quiz builder tool to create a quiz - in the settings tab, check 'publish now' - export the quiz to canvas - take the quiz as a student - the score you get should show up in the gradebook Change-Id: I36dd1046b1ee1b82a7ad4bafac2a7e53dd309b59 Reviewed-on: https://gerrit.instructure.com/32617 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Stanley Stuart <stanley@instructure.com> QA-Review: Amber Taniuchi <amber@instructure.com> Reviewed-by: Bracken Mosbacker <bracken@instructure.com> Product-Review: Simon Williams <simon@instructure.com>
This commit is contained in:
parent
0fa0a3dce5
commit
b9d3460aaa
|
@ -23,6 +23,7 @@ class RespondusSettings
|
|||
assessment[:available] = true
|
||||
assessment[:assignment] = {
|
||||
:title => assessment[:title],
|
||||
:submission_types => "online_quiz"
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -37,61 +37,58 @@ describe Qti::Converter do
|
|||
quiz.assignment.should be_nil
|
||||
end
|
||||
|
||||
it "should publish as assignment on import if specified" do
|
||||
copy = Tempfile.new(['spec-canvas', '.zip'])
|
||||
FileUtils.cp(fname, copy.path)
|
||||
Zip::File.open(copy.path) do |zf|
|
||||
zf.file.open("settings.xml", 'w') do |f|
|
||||
f.write <<-XML
|
||||
<settings>
|
||||
<setting name='hasSettings'>true</setting>
|
||||
<setting name='publishNow'>true</setting>
|
||||
</settings>
|
||||
XML
|
||||
describe "applying respondus settings" do
|
||||
before do
|
||||
@copy = Tempfile.new(['spec-canvas', '.zip'])
|
||||
FileUtils.cp(fname, @copy.path)
|
||||
Zip::File.open(@copy.path) do |zf|
|
||||
zf.file.open("settings.xml", 'w') do |f|
|
||||
f.write <<-XML
|
||||
<settings>
|
||||
<setting name='hasSettings'>true</setting>
|
||||
<setting name='publishNow'>true</setting>
|
||||
</settings>
|
||||
XML
|
||||
end
|
||||
end
|
||||
setup_migration(@copy.path)
|
||||
@migration.update_migration_settings(:apply_respondus_settings_file => true)
|
||||
@migration.save!
|
||||
end
|
||||
setup_migration(copy.path)
|
||||
@migration.update_migration_settings(:apply_respondus_settings_file => true)
|
||||
@migration.save!
|
||||
do_migration
|
||||
|
||||
quiz = @course.quizzes.last
|
||||
quiz.should be_present
|
||||
quiz.assignment.should_not be_nil
|
||||
quiz.assignment.title.should == quiz.title
|
||||
quiz.assignment.should be_published
|
||||
end
|
||||
it "should publish as assignment on import if specified" do
|
||||
do_migration
|
||||
|
||||
it "should re-use the same assignment on update" do
|
||||
copy = Tempfile.new(['spec-canvas', '.zip'])
|
||||
FileUtils.cp(fname, copy.path)
|
||||
Zip::File.open(copy.path) do |zf|
|
||||
zf.file.open("settings.xml", 'w') do |f|
|
||||
f.write <<-XML
|
||||
<settings>
|
||||
<setting name='hasSettings'>true</setting>
|
||||
<setting name='publishNow'>true</setting>
|
||||
</settings>
|
||||
XML
|
||||
end
|
||||
quiz = @course.quizzes.last
|
||||
quiz.should be_present
|
||||
quiz.assignment.should_not be_nil
|
||||
quiz.assignment.title.should == quiz.title
|
||||
quiz.assignment.should be_published
|
||||
end
|
||||
setup_migration(copy.path)
|
||||
@migration.update_migration_settings(:apply_respondus_settings_file => true)
|
||||
@migration.save!
|
||||
do_migration
|
||||
|
||||
setup_migration(copy.path)
|
||||
@migration.update_migration_settings(:apply_respondus_settings_file => true, :quiz_id_to_update => @course.quizzes.last.id)
|
||||
@migration.save!
|
||||
do_migration
|
||||
it "should re-use the same assignment on update" do
|
||||
do_migration
|
||||
|
||||
@course.quizzes.size.should == 1
|
||||
@course.assignments.size.should == 1
|
||||
quiz = @course.quizzes.last
|
||||
quiz.should be_present
|
||||
quiz.assignment.should_not be_nil
|
||||
quiz.assignment.title.should == quiz.title
|
||||
quiz.assignment.should be_published
|
||||
setup_migration(@copy.path)
|
||||
@migration.update_migration_settings(:apply_respondus_settings_file => true, :quiz_id_to_update => @course.quizzes.last.id)
|
||||
@migration.save!
|
||||
do_migration
|
||||
|
||||
@course.quizzes.size.should == 1
|
||||
@course.assignments.size.should == 1
|
||||
quiz = @course.quizzes.last
|
||||
quiz.should be_present
|
||||
quiz.assignment.should_not be_nil
|
||||
quiz.assignment.title.should == quiz.title
|
||||
quiz.assignment.should be_published
|
||||
end
|
||||
|
||||
it "should correctly set the assignment submission_type" do
|
||||
do_migration
|
||||
assign = @course.assignments.last
|
||||
assign.submission_types.should == 'online_quiz'
|
||||
assign.quiz.for_assignment?.should be_true
|
||||
end
|
||||
end
|
||||
|
||||
it "should publish spec-canvas-1 correctly" do
|
||||
|
|
Loading…
Reference in New Issue