diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py index d7204e516c..9bb72ad4e1 100644 --- a/common/lib/capa/capa/inputtypes.py +++ b/common/lib/capa/capa/inputtypes.py @@ -504,7 +504,7 @@ class JSInput(InputTypeBase): def _extra_context(self): context = { - 'applet_loader': '/static/js/capa/jsinput.js', + 'applet_loader': '/static/js/capa/src/jsinput.js', 'saved_state': self.value } diff --git a/common/static/js/capa/spec/jsinput/jsinput.js b/common/static/js/capa/spec/jsinput/jsinput.js index 85b33d9b4e..252bc4df54 100644 --- a/common/static/js/capa/spec/jsinput/jsinput.js +++ b/common/static/js/capa/spec/jsinput/jsinput.js @@ -11,38 +11,15 @@ describe("A jsinput has:", function () { }); }); - describe("The ctxCall function", function() { - it("Evaluatates nested-object functions", function() { - var ctxTest = { - ctxFn : function () { - return this.name ; - } - }; - var fnString = "nest.ctxFn"; - var holder = {}; - holder.nest = ctxTest; - var fn = _ctxCall(holder, fnString); - expect(fnString).toBe(holder.nest.ctxFn()); - }); - it("Throws an exception when the object does not exits", function () { - var notObj = _ctxCall("twas", "brilling"); - expect(notObj).toThrow(); - }); - - it("Throws an exception when the function does not exist", function () { - var anobj = {}; - var notFn = _ctxCall("anobj", "brillig"); - expect(notFn).toThrow(); - }); - - - }); describe("The jsinput constructor", function(){ + + var iframe1 = $(document).find('iframe')[0]; + var testJsElem = jsinputConstructor({ - id: 3781, - elem: "
-
--
-+
++
+