Added analysis button and scripting

This commit is contained in:
2023-03-05 00:28:54 +00:00
parent ea86fd9ae6
commit a1289da09c
6 changed files with 89 additions and 3 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 == 'analyse') {
$.ajax({
url: `/admin/analysis/`,
type: 'POST',
data: JSON.stringify({'id': id, 'class': 'test'}),
contentType: 'application/json',
success: function(response) {
window.location.href = response
},
error: function(response){
error_response(response)
},
})
}
event.preventDefault()
@ -123,6 +136,19 @@ $('.edit-question-dataset').click(function(event) {
window.location.href = `/admin/view/${id}`
} else if (action == 'download') {
window.location.href = `/admin/settings/questions/download/${id}/`
} else if (action == 'analyse') {
$.ajax({
url: `/admin/analysis/`,
type: 'POST',
data: JSON.stringify({'id': id, 'class': 'dataset'}),
contentType: 'application/json',
success: function(response) {
window.location.href = response
},
error: function(response){
error_response(response)
},
})
}
}
event.preventDefault()