24
24
$('#' + something).toggle("slow");
27
function add_exercise()
29
var exercise_id = $('#exercise_id').val();
30
var exercise_name = $('#exercise_name').val();
31
var exercise_num_rows = $('#exercise_num_rows').val();
32
var exercise_desc = $('#exercise_desc').val();
33
var exercise_partial = $('#exercise_partial').val();
34
var exercise_solution = $('#exercise_solution').val();
35
var exercise_include = $('#exercise_include').val();
37
var callback = function(xhr)
42
testresponse = JSON.parse(xhr.responseText);
43
alert('Exercise Created');
44
window.location = '/+exercises';
48
alert('Error: Could not add exercise');
53
update_path = "api/+exercises";
55
var args = {'identifier': exercise_id , 'name': exercise_name,
56
'description': exercise_desc, 'partial': exercise_partial,
57
'solution': exercise_solution, 'include': exercise_include,
58
'num_rows': exercise_num_rows, 'ivle.op': 'add_exercise'};
59
ajax_call(callback, update_path, "", args, 'POST');
27
63
/* Edit the exercise values */
28
64
function edit_exercise()