Acceptance tests for visual correctness reset feature

This commit is contained in:
Peter Baratta
2013-08-23 16:05:00 -04:00
committed by Sarina Canelake
parent 48cb05c037
commit fe47dcb122
6 changed files with 97 additions and 22 deletions

View File

@@ -17,7 +17,7 @@
% for choice_id, choice_description in choices:
<label for="input_${id}_${choice_id}"
## If the student has selected this choice...
## If the student has selected this choice...
% if input_type == 'radio' and ( (isinstance(value, basestring) and (choice_id == value)) or (not isinstance(value, basestring) and choice_id in value) ):
<%
if status == 'correct':

View File

@@ -352,10 +352,10 @@ class TextlineTemplateTest(TemplateTestCase):
super(TextlineTemplateTest, self).setUp()
def test_section_class(self):
cases = [({}, ' capa_inputtype '),
({'do_math': True}, 'text-input-dynamath capa_inputtype '),
({'inline': True}, ' capa_inputtype inline'),
({'do_math': True, 'inline': True}, 'text-input-dynamath capa_inputtype inline'), ]
cases = [({}, ' capa_inputtype textline'),
({'do_math': True}, 'text-input-dynamath capa_inputtype textline'),
({'inline': True}, ' capa_inputtype inline textline'),
({'do_math': True, 'inline': True}, 'text-input-dynamath capa_inputtype inline textline'), ]
for (context, css_class) in cases:
base_context = self.context.copy()

View File

@@ -380,8 +380,6 @@ class @Problem
classes = $(inputtype).attr('class').split(' ')
for cls in classes
bindMethod = @bindResetCorrectnessByInputtype[cls]
# For debugging! Remove later
console.log $(inputtype).attr('id'), cls, typeof bindMethod
if bindMethod?
bindMethod(inputtype)
@@ -393,7 +391,7 @@ class @Problem
formulaequationinput: (element) ->
$(element).find('input').on 'input', ->
$p = $(element).find('p.status')
$p.text "unanswered"
$p.text gettext("unanswered")
$p.parent().removeClass().addClass "unanswered"
choicegroup: (element) ->
@@ -406,10 +404,9 @@ class @Problem
$status.empty().css 'display', 'inline-block'
else
# Recreate the unanswered dot on left.
$element.find('div.indicator_container').append "<span class='unanswered' style='display:inline-block;' id='status_#{id}'></span>"
$("<span>", {"class": "unanswered", "style": "display: inline-block;", "id": "status_#{id}"})
$element.find("label").removeClass()
.find('span').remove()
'option-input': (element) ->
$select = $(element).find('select')
@@ -417,7 +414,7 @@ class @Problem
$select.on 'change', ->
$status = $("#status_#{id}")
.removeClass().addClass("unanswered")
.find('span').text('Status: unsubmitted')
.find('span').text(gettext('Status: unsubmitted'))
textline: (element) ->
$(element).find('input').on 'input', ->