Show answer appears to work
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user