1
/* IVLE - Informatics Virtual Learning Environment
2
* Copyright (C) 2007-2008 The University of Melbourne
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
* Module: Tutorial system (client)
23
/** User clicks "Submit" button. Do an Ajax call and run the test.
24
* problemid: "id" of the problem's div element.
25
* filename: Filename of the problem's XML file (used to identify the problem
26
* when interacting with the server).
28
function submitproblem(problemid, filename)
30
/* Get the source code the student is submitting */
31
problemdiv = document.getElementById(problemid);
32
problembox = problemdiv.getElementsByTagName("textarea")[0];
33
code = problembox.value;
34
alert("code = \"" + code + "\"\nproblem = \"" + filename + "\"\n"
35
+ "action = \"test\"");