Show answer appears to work

This commit is contained in:
Piotr Mitros
2011-12-25 17:59:31 -05:00
parent 196855747c
commit a8d0bafc9e
2 changed files with 10 additions and 0 deletions

View File

@@ -9,3 +9,6 @@
% if save_button:
<input id="save_${ id }" type="button" value="Save" >
% endif
% if answer_available:
<input id="show_${ id }" type="button" value="Show Answer" >
% endif

View File

@@ -22,6 +22,13 @@ function ${ id }_load() {
});
}
});
$('#show_${ id }').click(function() {
$.getJSON('/modx/problem/${ id }/problem_show', function(data) {
for (var key in data) {
$("#answer_${ id }_"+key).text(data[key]);
}
});
});
$('#save_${ id }').click(function() {
var submit_data={};
$.each($("[id^=input_${ id }_]"), function(index,value){