diff --git a/app/views/simple_questions/show.1p2.qti.builder b/app/views/simple_questions/show.1p2.qti.builder index 1bc30bc..ddfdffc 100644 --- a/app/views/simple_questions/show.1p2.qti.builder +++ b/app/views/simple_questions/show.1p2.qti.builder @@ -1,20 +1,39 @@ -xml.instruct! +require 'builder' +xml = Builder::XmlMarkup.new -xml.kml(:xmlns => "http://earth.google.com/kml/2.2") { -xml.Document { - xml.name("Test") - xml.open(1) - xml.visible(1) - xml.NetworkLink { - xml.name("My rails app being passed parameters") - xml.open(1) - xml.visibility(0) - xml.Link { - xml.href("hi") - xml.viewRefreshMode("onStop") - xml.viewRefreshTime(0.5) - xml.viewFormat("BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]&CENTRE=[lookatLon],[lookatLat]") +xml.instruct! +xml.Document{ + xml.item{ + xml.presentation{ + xml.material{ + xml.mattext("texttype" => "text/html") { + xml.cdata!(@question.content_html.html_safe) + } } + xml.response_lid{ + xml.render_choice{ + @question.answer_choices.each_index do |ac| + xml.response_label("ident" => "A" + ac.to_s){ + xml.material{ + xml.mattext("texttype" => "text/html"){ + xml.cdata!(@question.answer_choices[ac].content_html.html_safe) + } + } + } + end + } + } + } + xml.resprocessing{ + @question.answer_choices.each_index do |ac| + xml.respcondition{ + xml.conditionvar{ + xml.varequal "A" + ac.to_s + } + xml.setvar(@question.answer_choices[ac].credit,"varname" => "que_score", "action" => "Add" + ) + } + end } } -} \ No newline at end of file +}