Due dates and number of submissions work
This commit is contained in:
28
problem.js
28
problem.js
@@ -13,25 +13,27 @@ function ${ id }_load() {
|
||||
$.getJSON('/modx/problem/${ id }/problem_check',
|
||||
submit_data,
|
||||
function(json) {
|
||||
for(p in json) {
|
||||
if(json[p]=='correct')
|
||||
$("#status_"+p).attr("class", "ui-icon ui-icon-check");
|
||||
if(json[p]=='incorrect')
|
||||
$("#status_"+p).attr("class", "ui-icon ui-icon-close");
|
||||
$('#check_${ id }').attr("value", "Reset");
|
||||
}
|
||||
});
|
||||
${ id }_load();
|
||||
});
|
||||
} else /* if 'Reset' */ {
|
||||
$.getJSON('/modx/problem/${ id }/problem_reset', {'id':'${ id }'}, function(json) {
|
||||
${ id }_load();
|
||||
//$('#main_${ id }').html(json);
|
||||
//MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$('#save_${ id }').click(function() {
|
||||
var submit_data={};
|
||||
$.each($("[id^=input_${ id }_]"), function(index,value){
|
||||
submit_data[value.id]=value.value;});
|
||||
$.getJSON('/modx/problem/${ id }/problem_save',
|
||||
submit_data, function(data){
|
||||
if(data.success) {
|
||||
alert('Saved');
|
||||
}}
|
||||
);
|
||||
});
|
||||
}
|
||||
);}
|
||||
$(function() {
|
||||
${ id }_load();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user