Adding javascriptresponse. This responsetype is a framework for problems that are entirely controlled by javascript and graded by Node.js on the server.

This commit is contained in:
Arjun Singh
2012-08-06 18:02:18 -04:00
parent 869e638e07
commit 2337eeba1e
6 changed files with 257 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
var importAll = function (modulePath) {
module = require(modulePath);
for(key in module){
global[key] = module[key];
}
}
importAll("xproblem");
importAll("minimax.js");
graderModulePath = process.argv[2];
submission = JSON.parse(process.argv[3]);
problemState = JSON.parse(process.argv[4]);
params = JSON.parse(process.argv[5]);
graderModule = require(graderModulePath);
graderClass = graderModule.graderClass;
grader = new graderClass(submission, problemState, params);
console.log(JSON.stringify(grader.grade()));
console.log(JSON.stringify(grader.evaluation));
console.log(JSON.stringify(grader.solution));