don't import exact value for numeric range questions

test plan:
* import the package attached to the ticket
* the quiz titled "Numeric Question Test" should
 have a question with a range answer
* copy the course
* the copied quiz question should also
 have a range answer (and not be changed to exact)

closes #ADMIN-714

Change-Id: I4e3871ab9875fd1a469dd463183a3e306edf9fb5
Reviewed-on: https://gerrit.instructure.com/139255
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
This commit is contained in:
James Williams 2018-01-26 08:15:52 -07:00
parent 4b5654711d
commit ef42d03ac4
3 changed files with 7 additions and 6 deletions

View File

@ -34,17 +34,20 @@ class NumericInteraction < AssessmentItemConverter
end
def get_answer_values
answer = {:weight=>100,:comments=>"",:id=>unique_local_id,:numerical_answer_type=>"range_answer"}
answer = {:weight=>100,:comments=>"",:id=>unique_local_id}
if gte = @doc.at_css('responseCondition gte baseValue')
answer[:start] = gte.text.to_f
end
if lte = @doc.at_css('responseCondition lte baseValue')
answer[:end] = lte.text.to_f
end
if equal = @doc.at_css('responseCondition equal baseValue')
if (answer[:start] && answer[:end])
answer[:numerical_answer_type] = "range_answer"
@question[:answers] << answer
elsif equal = @doc.at_css('responseCondition equal baseValue')
answer[:exact] = equal.text.to_f
end
if (answer[:start] && answer[:end]) || answer[:exact]
answer[:numerical_answer_type] = "exact_answer"
@question[:answers] << answer
end
end

View File

@ -489,7 +489,6 @@ module BB8Expected
[{:end=>4.0,
:numerical_answer_type=>"range_answer",
:start=>4.0,
:exact=>4.0,
:comments=>"",
:weight=>100}],
:question_text=>"What is 10 - 6?<br>",

View File

@ -354,7 +354,6 @@ describe Qti::Converter do
"answers"=>
[{"comments"=>"",
"numerical_answer_type"=>"range_answer",
"exact"=>1.25,
"weight"=>100,
"end"=>1.3,
"id"=>9082,