Close Quiz function

This commit is contained in:
2021-12-06 23:16:33 +00:00
parent cefb5fe849
commit 421445d8d5
3 changed files with 33 additions and 6 deletions

View File

@ -88,6 +88,19 @@ $('.test-action').click(function(event) {
});
} else if (action == 'edit') {
window.location.href = `/admin/test/${_id}/`
} else if (action == 'close'){
$.ajax({
url: `/admin/tests/close/`,
type: 'POST',
data: JSON.stringify({'_id': _id}),
contentType: 'application/json',
success: function(response) {
window.location.reload();
},
error: function(response){
error_response(response);
},
});
}
event.preventDefault();