improve blackboard true/false question parsing

test plan:
* import the first package referenced in the ticket
 (with "BBtestmgr" in the title)
* should bring in the true/false questions without errors

closes #CNVS-14569

Change-Id: Ibe56af41852234c7e982fcb37166ad5c55e61fda
Reviewed-on: https://gerrit.instructure.com/38801
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
This commit is contained in:
James Williams 2014-08-06 07:41:41 -06:00
parent e8aba47588
commit a0d1b2d4cc
1 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ class ChoiceInteraction < AssessmentItemConverter
answer[:text] = DEFAULT_ANSWER_TEXT
end
end
if @flavor == Qti::Flavors::BBLEARN && @question[:question_type] == 'true_false_question'
if @flavor == Qti::Flavors::BBLEARN && @question[:question_type] == 'true_false_question' && choice['identifier'] =~ /true|false/i
answer[:text] = choice['identifier']
end
@ -136,7 +136,7 @@ class ChoiceInteraction < AssessmentItemConverter
elsif cond.at_css('match variable[identifier=RESP_MC]') or cond.at_css('match variable[identifier=response]')
migration_id = cond.at_css('match baseValue[baseType=identifier]').text.strip()
migration_id = migration_id.sub('.', '_') if is_either_or
answer = answers_hash[migration_id]
answer = answers_hash[migration_id] || answers_hash.values.detect{|a| a[:text] == migration_id}
answer[:weight] = get_response_weight(cond)
answer[:feedback_id] ||= get_feedback_id(cond)
elsif cond.at_css('member variable[identifier=RESP_MC]')