From 84aeb9dad3a23ca388a7bc285c654351667e1f4f Mon Sep 17 00:00:00 2001 From: kimth Date: Fri, 26 Oct 2012 06:01:26 +0000 Subject: [PATCH 1/2] Permit collapsibles in capa detailed solution --- common/lib/xmodule/xmodule/js/src/capa/display.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/js/src/capa/display.coffee b/common/lib/xmodule/xmodule/js/src/capa/display.coffee index cc389c3fc9..b6df1fc57f 100644 --- a/common/lib/xmodule/xmodule/js/src/capa/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/capa/display.coffee @@ -216,7 +216,9 @@ class @Problem for choice in value @$("label[for='input_#{key}_#{choice}']").attr correct_answer: 'true' else - @$("#answer_#{key}, #solution_#{key}").html(value) + detailed_solution = @$("#answer_#{key}, #solution_#{key}") + detailed_solution.html(value) + Collapsible.setCollapsibles(detailed_solution) # TODO remove the above once everything is extracted into its own # inputtype functions. From 62840765a57b49cfeea508cd49a10559122318e4 Mon Sep 17 00:00:00 2001 From: kimth Date: Fri, 26 Oct 2012 06:59:21 +0000 Subject: [PATCH 2/2] Variable name is misleading, use generic 'answer' instead --- common/lib/xmodule/xmodule/js/src/capa/display.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/capa/display.coffee b/common/lib/xmodule/xmodule/js/src/capa/display.coffee index b6df1fc57f..1c0ace9e59 100644 --- a/common/lib/xmodule/xmodule/js/src/capa/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/capa/display.coffee @@ -216,9 +216,9 @@ class @Problem for choice in value @$("label[for='input_#{key}_#{choice}']").attr correct_answer: 'true' else - detailed_solution = @$("#answer_#{key}, #solution_#{key}") - detailed_solution.html(value) - Collapsible.setCollapsibles(detailed_solution) + answer = @$("#answer_#{key}, #solution_#{key}") + answer.html(value) + Collapsible.setCollapsibles(answer) # TODO remove the above once everything is extracted into its own # inputtype functions.