From 95a88823b9252c819823c2e1c500d0d7847c64f4 Mon Sep 17 00:00:00 2001 From: polesye Date: Wed, 8 Jan 2014 11:57:39 +0200 Subject: [PATCH] BLD-633: Fix show answer for ImageResponse. --- .../xmodule/xmodule/js/spec/capa/display_spec.coffee | 12 +++++++++--- .../lib/xmodule/xmodule/js/src/capa/display.coffee | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee b/common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee index ea1e185f65..ced45bdbab 100644 --- a/common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee +++ b/common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee @@ -308,11 +308,17 @@ describe 'Problem', -> states = [ { desc: 'rectangle is drawn correctly', - data: {'rectangle': '(10,10)-(30,30)'} + data: { + 'rectangle': '(10,10)-(30,30)', + 'regions': null + } }, { desc: 'region is drawn correctly', - data: {'regions': '[[10,10],[30,30],[70,30],[20,30]]'} + data: { + 'rectangle': null, + 'regions': '[[10,10],[30,30],[70,30],[20,30]]' + } }, { desc: 'mixed shapes are drawn correctly', @@ -387,7 +393,7 @@ describe 'Problem', -> ctx.lineWidth = "2"; $.each coords, (key, value) => - types[key](value) if types[key]? + types[key](value) if types[key]? and value return canvas diff --git a/common/lib/xmodule/xmodule/js/src/capa/display.coffee b/common/lib/xmodule/xmodule/js/src/capa/display.coffee index f65860b7ab..2961962414 100644 --- a/common/lib/xmodule/xmodule/js/src/capa/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/capa/display.coffee @@ -260,7 +260,7 @@ class @Problem check: => if not @check_save_waitfor(@check_internal) - @check_internal() + @check_internal() check_internal: => Logger.log 'problem_check', @answers @@ -570,7 +570,7 @@ class @Problem $.each answers, (key, answer) => $.each answer, (key, value) => - types[key](value) if types[key]? + types[key](value) if types[key]? and value container.html(canvas)