Fixed bug when user votes w/o permission - now displays a friendly error message instead of failing.
Fixed bug when hinter module displays a hint, then is asked to display nothing. (Used to not update in this case.)
This commit is contained in:
committed by
Carlos Andrés Rocha
parent
15317de252
commit
560cd9b068
@@ -227,7 +227,7 @@ class CrowdsourceHinterModule(CrowdsourceHinterFields, XModule):
|
||||
Returns key 'hint_and_votes', a list of (hint_text, #votes) pairs.
|
||||
"""
|
||||
if self.user_voted:
|
||||
return json.dumps({'contents': 'Sorry, but you have already voted!'})
|
||||
return {}
|
||||
ans_no = int(get['answer'])
|
||||
hint_no = str(get['hint'])
|
||||
answer = self.previous_answers[ans_no][0]
|
||||
|
||||
@@ -72,3 +72,5 @@ class @Hinter
|
||||
JavascriptLoader.executeModuleScripts @el, () =>
|
||||
@bind()
|
||||
@$('#previous-answer-0').css('display', 'inline')
|
||||
else
|
||||
@el.hide()
|
||||
|
||||
Reference in New Issue
Block a user