diff --git a/common/lib/capa/capa/tests/test_files/js/.gitignore b/common/lib/capa/capa/tests/test_files/js/.gitignore new file mode 100644 index 0000000000..d2910668f2 --- /dev/null +++ b/common/lib/capa/capa/tests/test_files/js/.gitignore @@ -0,0 +1,4 @@ +test_problem_display.js +test_problem_generator.js +test_problem_grader.js +xproblem.js \ No newline at end of file diff --git a/common/lib/capa/capa/tests/test_files/js/test_problem_display.js b/common/lib/capa/capa/tests/test_files/js/test_problem_display.js deleted file mode 100644 index b61569acea..0000000000 --- a/common/lib/capa/capa/tests/test_files/js/test_problem_display.js +++ /dev/null @@ -1,49 +0,0 @@ -// Generated by CoffeeScript 1.4.0 -(function() { - var MinimaxProblemDisplay, root, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - MinimaxProblemDisplay = (function(_super) { - - __extends(MinimaxProblemDisplay, _super); - - function MinimaxProblemDisplay(state, submission, evaluation, container, submissionField, parameters) { - this.state = state; - this.submission = submission; - this.evaluation = evaluation; - this.container = container; - this.submissionField = submissionField; - this.parameters = parameters != null ? parameters : {}; - MinimaxProblemDisplay.__super__.constructor.call(this, this.state, this.submission, this.evaluation, this.container, this.submissionField, this.parameters); - } - - MinimaxProblemDisplay.prototype.render = function() {}; - - MinimaxProblemDisplay.prototype.createSubmission = function() { - var id, value, _ref, _results; - this.newSubmission = {}; - if (this.submission != null) { - _ref = this.submission; - _results = []; - for (id in _ref) { - value = _ref[id]; - _results.push(this.newSubmission[id] = value); - } - return _results; - } - }; - - MinimaxProblemDisplay.prototype.getCurrentSubmission = function() { - return this.newSubmission; - }; - - return MinimaxProblemDisplay; - - })(XProblemDisplay); - - root = typeof exports !== "undefined" && exports !== null ? exports : this; - - root.TestProblemDisplay = TestProblemDisplay; - -}).call(this); diff --git a/common/lib/capa/capa/tests/test_files/js/test_problem_generator.js b/common/lib/capa/capa/tests/test_files/js/test_problem_generator.js deleted file mode 100644 index 4b1d133723..0000000000 --- a/common/lib/capa/capa/tests/test_files/js/test_problem_generator.js +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by CoffeeScript 1.4.0 -(function() { - var TestProblemGenerator, root, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - TestProblemGenerator = (function(_super) { - - __extends(TestProblemGenerator, _super); - - function TestProblemGenerator(seed, parameters) { - this.parameters = parameters != null ? parameters : {}; - TestProblemGenerator.__super__.constructor.call(this, seed, this.parameters); - } - - TestProblemGenerator.prototype.generate = function() { - this.problemState.value = this.parameters.value; - return this.problemState; - }; - - return TestProblemGenerator; - - })(XProblemGenerator); - - root = typeof exports !== "undefined" && exports !== null ? exports : this; - - root.generatorClass = TestProblemGenerator; - -}).call(this); diff --git a/common/lib/capa/capa/tests/test_files/js/test_problem_grader.js b/common/lib/capa/capa/tests/test_files/js/test_problem_grader.js deleted file mode 100644 index 80d7ad1690..0000000000 --- a/common/lib/capa/capa/tests/test_files/js/test_problem_grader.js +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by CoffeeScript 1.4.0 -(function() { - var TestProblemGrader, root, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - TestProblemGrader = (function(_super) { - - __extends(TestProblemGrader, _super); - - function TestProblemGrader(submission, problemState, parameters) { - this.submission = submission; - this.problemState = problemState; - this.parameters = parameters != null ? parameters : {}; - TestProblemGrader.__super__.constructor.call(this, this.submission, this.problemState, this.parameters); - } - - TestProblemGrader.prototype.solve = function() { - return this.solution = { - 0: this.problemState.value - }; - }; - - TestProblemGrader.prototype.grade = function() { - var allCorrect, id, value, valueCorrect, _ref; - if (!(this.solution != null)) { - this.solve(); - } - allCorrect = true; - _ref = this.solution; - for (id in _ref) { - value = _ref[id]; - valueCorrect = this.submission != null ? value === this.submission[id] : false; - this.evaluation[id] = valueCorrect; - if (!valueCorrect) { - allCorrect = false; - } - } - return allCorrect; - }; - - return TestProblemGrader; - - })(XProblemGrader); - - root = typeof exports !== "undefined" && exports !== null ? exports : this; - - root.graderClass = TestProblemGrader; - -}).call(this); diff --git a/common/lib/capa/capa/tests/test_files/js/xproblem.js b/common/lib/capa/capa/tests/test_files/js/xproblem.js deleted file mode 100644 index 55a469f7c1..0000000000 --- a/common/lib/capa/capa/tests/test_files/js/xproblem.js +++ /dev/null @@ -1,78 +0,0 @@ -// Generated by CoffeeScript 1.4.0 -(function() { - var XProblemDisplay, XProblemGenerator, XProblemGrader, root; - - XProblemGenerator = (function() { - - function XProblemGenerator(seed, parameters) { - this.parameters = parameters != null ? parameters : {}; - this.random = new MersenneTwister(seed); - this.problemState = {}; - } - - XProblemGenerator.prototype.generate = function() { - return console.error("Abstract method called: XProblemGenerator.generate"); - }; - - return XProblemGenerator; - - })(); - - XProblemDisplay = (function() { - - function XProblemDisplay(state, submission, evaluation, container, submissionField, parameters) { - this.state = state; - this.submission = submission; - this.evaluation = evaluation; - this.container = container; - this.submissionField = submissionField; - this.parameters = parameters != null ? parameters : {}; - } - - XProblemDisplay.prototype.render = function() { - return console.error("Abstract method called: XProblemDisplay.render"); - }; - - XProblemDisplay.prototype.updateSubmission = function() { - return this.submissionField.val(JSON.stringify(this.getCurrentSubmission())); - }; - - XProblemDisplay.prototype.getCurrentSubmission = function() { - return console.error("Abstract method called: XProblemDisplay.getCurrentSubmission"); - }; - - return XProblemDisplay; - - })(); - - XProblemGrader = (function() { - - function XProblemGrader(submission, problemState, parameters) { - this.submission = submission; - this.problemState = problemState; - this.parameters = parameters != null ? parameters : {}; - this.solution = null; - this.evaluation = {}; - } - - XProblemGrader.prototype.solve = function() { - return console.error("Abstract method called: XProblemGrader.solve"); - }; - - XProblemGrader.prototype.grade = function() { - return console.error("Abstract method called: XProblemGrader.grade"); - }; - - return XProblemGrader; - - })(); - - root = typeof exports !== "undefined" && exports !== null ? exports : this; - - root.XProblemGenerator = XProblemGenerator; - - root.XProblemDisplay = XProblemDisplay; - - root.XProblemGrader = XProblemGrader; - -}).call(this);