Commit 658938fb authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Fix algorea task wrapper: Move closure to access answer object, correctly use noop as callback

parent 159f4bb0
Pipeline #219 passed with stages
in 17 minutes and 14 seconds
......@@ -48,7 +48,7 @@ function noop(){}
function getTaskProxyCallback(task) {
function reloadAnswerCallback() {
task.gradeAnswer("{}", {}, noop(), ec("task.gradeAnswer"));
task.gradeAnswer("{}", {}, noop, ec("task.gradeAnswer"));
}
function reloadStateCallback() {
......@@ -75,18 +75,18 @@ function getTaskProxyCallback(task) {
task.load(myLoadViews, loadCallback, ec("task.load"))
}
function gradeAnswerCallback(score, message, scoreToken){
function save_task_callback() {
console.log("OK transmission");
};
window.save_task_object({"text": answer}, score, save_task_callback)
}
function getAnswerCallback(answer) {
console.log("In task.gradeAnswer callback:");
console.log(answer);
function gradeAnswerCallback(score, message, scoreToken){
function save_task_callback() {
console.log("OK transmission");
};
window.save_task_object({"text": answer}, score, save_task_callback)
}
task.gradeAnswer(answer, {}, gradeAnswerCallback, ec("task.gradeAnswer"));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment