210
var args = {'ivle.op': 'add_testcase', 'passmsg': passmsg,
211
'failmsg': failmsg, 'default': case_default,
213
update_path = "api/+exercises/" + exercise;
214
ajax_call(callback, update_path, "", args, 'POST');
218
function edit_test_case(testid, suiteid)
220
var passmsg = $("#test_case_pass_" + testid + "_" + suiteid).val();
221
var failmsg = $("#test_case_fail_" + testid + "_" + suiteid).val();
222
var case_default = $("#test_case_default_" + testid + "_" + suiteid).val();
224
var callback = function(xhr)
229
testresponse = JSON.parse(xhr.responseText);
230
alert('Test Case Modified Sucessfully');
235
alert('Error Saving Test Case');
240
var args = {'ivle.op': 'edit_testcase', 'passmsg': passmsg,
241
'failmsg': failmsg, 'default': case_default,
242
'testid':testid, 'suiteid': suiteid};
243
update_path = "api/+exercises/" + exercise;
244
ajax_call(callback, update_path, "", args, 'POST');
247
function edit_test_part(partid, testid, suiteid)
249
var part_type = $("#test_part_part_type_" + partid).val();
250
var test_type = $("#test_part_test_type_" + partid).val();
251
var data = $("#test_part_data_" + partid).val();
252
var filename = $("#test_part_file_" + partid).val();
254
var callback = function(xhr)
259
testresponse = JSON.parse(xhr.responseText);
260
alert("Test Part Modified");
264
alert("Error Adding Test Part");
269
var args = {'ivle.op': 'edit_testpart', 'part_type': part_type,
270
'test_type': test_type, 'data': data, 'filename': filename,
271
'partid': partid, 'testid': testid, 'suiteid': suiteid};
272
update_path = "api/+exercises/" + exercise;
273
ajax_call(callback, update_path, "", args, 'POST');
276
function add_test_part(testid, suiteid)
278
var part_type = $("#new_test_part_part_type_" + testid).val();
279
var test_type = $("#new_test_part_test_type_" + testid).val();
280
var data = $("#new_test_part_data_" + testid).val();
281
var filename = $("#new_test_part_file_" + testid).val();
283
var savebutton = $("#new_test_part_save_" + testid);
284
savebutton.attr('value', 'Saving...');
285
savebutton.attr('disabled', 'disabled');
287
var callback = function(xhr)
291
var test_parts = $("#test_case_parts_" + testid);
294
testresponse = JSON.parse(xhr.responseText);
295
savebutton.attr('value', 'Saving...');
296
savebutton.removeAttr('disabled');
298
alert("Test Part Added");
299
window.location.reload();
304
alert("Error Adding Test Part");
309
var args = {'ivle.op': 'add_testpart', 'part_type': part_type,
310
'test_type': test_type, 'data': data, 'filename': filename,
311
'testid': testid, 'suiteid': suiteid};
312
update_path = "api/+exercises/" + exercise;
313
ajax_call(callback, update_path, "", args, 'POST');