adding in hint box
This commit is contained in:
@@ -16,7 +16,8 @@ $(document).on('click', 'section.sa-wrapper input#save', ( ->
|
||||
assessment=$('section.sa-wrapper #assessment').find(':selected').text()
|
||||
post_url=$('section.sa-wrapper input#ajax_url').attr('url')
|
||||
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
|
||||
$('section.sa-wrapper p#save_message').append(response.message)
|
||||
$('section.sa-wrapper input#save').remove()
|
||||
|
||||
@@ -137,6 +137,8 @@ class SelfAssessmentModule(XModule):
|
||||
'<section class="sa-wrapper"><select name="assessment" id="assessment">'
|
||||
'<option value="incorrect">Incorrect</option><option value="correct">'
|
||||
'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"/>'
|
||||
'<p id="save_message"></p><input type="hidden" '
|
||||
'id="ajax_url" name="ajax_url" url="{0}">'
|
||||
@@ -225,6 +227,8 @@ class SelfAssessmentModule(XModule):
|
||||
'''
|
||||
|
||||
#Extract correctness from ajax and assign points
|
||||
log.debug(get.keys())
|
||||
log.debug(get)
|
||||
self.correctness = get.keys()[0].lower()
|
||||
points = 0
|
||||
if self.correctness == "correct":
|
||||
|
||||
Reference in New Issue
Block a user