Merge pull request #6747 from edx/shr/bug/TNL-1240-Check-show-answer-not-working
Quote the starts with expression id^
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<h2 class="problem-header">Problem Header</h2>
|
||||
|
||||
<div class='problem-progress'></div>
|
||||
|
||||
<div class="problem">
|
||||
<p>${_("Problem Content")}</p>
|
||||
|
||||
<div class="action">
|
||||
<input type="hidden" name="problem_id" value="1">
|
||||
|
||||
<input type="text" name="input_example_1.Test" id="input_example_1.Test" value="" class="math" />
|
||||
<span id="display_example_1"></span>
|
||||
<span id="input_example_1_dynamath"></span>
|
||||
|
||||
<input class="check" type="button" value="Check">
|
||||
<input class="reset" type="button" value="Reset">
|
||||
<input class="save" type="button" value="Save">
|
||||
<button class="show"><span class="show-label">Show Answer(s)</span> <span class="sr">(for question(s) above - adjacent to each field)</span></button>
|
||||
<a href="/courseware/6.002_Spring_2012/${ explain }" class="new-page">Explanation</a>
|
||||
<div class="submission_feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -78,6 +78,19 @@ describe 'Problem', ->
|
||||
[@problem.updateMathML, @stubbedJax, $('#input_example_1').get(0)]
|
||||
]
|
||||
|
||||
describe 'bind_with_custom_input_id', ->
|
||||
beforeEach ->
|
||||
spyOn window, 'update_schematics'
|
||||
MathJax.Hub.getAllJax.andReturn [@stubbedJax]
|
||||
@problem = new Problem($('.xblock-student_view'))
|
||||
$(@).html readFixtures('problem_content_1240.html')
|
||||
|
||||
it 'bind the check button', ->
|
||||
expect($('div.action input.check')).toHandleWith 'click', @problem.check_fd
|
||||
|
||||
it 'bind the show button', ->
|
||||
expect($('div.action button.show')).toHandleWith 'click', @problem.show
|
||||
|
||||
describe 'renderProgressState', ->
|
||||
beforeEach ->
|
||||
@problem = new Problem($('.xblock-student_view'))
|
||||
|
||||
@@ -25,7 +25,7 @@ class @Problem
|
||||
window.update_schematics()
|
||||
|
||||
problem_prefix = @element_id.replace(/problem_/,'')
|
||||
@inputs = @$("[id^=input_#{problem_prefix}_]")
|
||||
@inputs = @$("[id^='input_#{problem_prefix}_']")
|
||||
@$('div.action input:button').click @refreshAnswers
|
||||
@checkButton = @$('div.action input.check')
|
||||
@checkButtonCheckText = @checkButton.val()
|
||||
|
||||
Reference in New Issue
Block a user