Merge pull request #2618 from edx/valera/fix_multiple_choice_video

Fix bug multiple choice with video. BLD-788.
This commit is contained in:
Valera Rozuvan
2014-02-21 16:23:13 +02:00
2 changed files with 9 additions and 5 deletions

View File

@@ -124,9 +124,15 @@ describe 'Problem', ->
expect(@problem.bind).toHaveBeenCalled()
describe 'check_fd', ->
xit 'should have more specs written for this functionality', ->
expect(false)
beforeEach ->
# Insert an input of type file outside of the problem.
$('.xblock-student_view').after('<input type="file" />')
@problem = new Problem($('.xblock-student_view'))
spyOn(@problem, 'check')
it 'check method is called if input of type file is not in problem', ->
@problem.check_fd()
expect(@problem.check).toHaveBeenCalled()
describe 'check', ->
beforeEach ->
@@ -509,5 +515,3 @@ describe 'Problem', ->
xit 'serialize all answers', ->
@problem.refreshAnswers()
expect(@problem.answers).toEqual "input_1_1=one&input_1_2=two"

View File

@@ -195,7 +195,7 @@ class @Problem
###
check_fd: =>
# If there are no file inputs in the problem, we can fall back on @check
if $('input:file').length == 0
if @el.find('input:file').length == 0
@check()
return