Commit 61aefcbd by Vik Paruchuri

adding in hint box

parent 1fcb0ee7
...@@ -16,7 +16,8 @@ $(document).on('click', 'section.sa-wrapper input#save', ( -> ...@@ -16,7 +16,8 @@ $(document).on('click', 'section.sa-wrapper input#save', ( ->
assessment=$('section.sa-wrapper #assessment').find(':selected').text() assessment=$('section.sa-wrapper #assessment').find(':selected').text()
post_url=$('section.sa-wrapper input#ajax_url').attr('url') post_url=$('section.sa-wrapper input#ajax_url').attr('url')
final_url="#{post_url}/sa_save" final_url="#{post_url}/sa_save"
$.post final_url, assessment, (response) -> hint=$('section.sa-wrapper textarea#hint').val()
$.post final_url, {'assessment':assessment, 'hint':hint}, (response) ->
if response.success if response.success
$('section.sa-wrapper p#save_message').append(response.message) $('section.sa-wrapper p#save_message').append(response.message)
$('section.sa-wrapper input#save').remove() $('section.sa-wrapper input#save').remove()
......
...@@ -137,6 +137,8 @@ class SelfAssessmentModule(XModule): ...@@ -137,6 +137,8 @@ class SelfAssessmentModule(XModule):
'<section class="sa-wrapper"><select name="assessment" id="assessment">' '<section class="sa-wrapper"><select name="assessment" id="assessment">'
'<option value="incorrect">Incorrect</option><option value="correct">' '<option value="incorrect">Incorrect</option><option value="correct">'
'Correct</option></select><br/>' 'Correct</option></select><br/>'
'What hint about this problem would you give to someone?'
'<textarea name="hint" id="hint" cols="50" rows="5"/><br/>'
'<input type="button" value="Save" id="save" name="save"/>' '<input type="button" value="Save" id="save" name="save"/>'
'<p id="save_message"></p><input type="hidden" ' '<p id="save_message"></p><input type="hidden" '
'id="ajax_url" name="ajax_url" url="{0}">' 'id="ajax_url" name="ajax_url" url="{0}">'
...@@ -225,6 +227,8 @@ class SelfAssessmentModule(XModule): ...@@ -225,6 +227,8 @@ class SelfAssessmentModule(XModule):
''' '''
#Extract correctness from ajax and assign points #Extract correctness from ajax and assign points
log.debug(get.keys())
log.debug(get)
self.correctness = get.keys()[0].lower() self.correctness = get.keys()[0].lower()
points = 0 points = 0
if self.correctness == "correct": if self.correctness == "correct":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment