From 61e574ee22d4e3c89713feabe848d39ba7fcb351 Mon Sep 17 00:00:00 2001 From: Victor Shnayder Date: Mon, 8 Oct 2012 13:05:30 -0400 Subject: [PATCH] Revert "Make script type checking more strict" Don't want to break existing problems. This reverts commit 811422a18d8222d4e9b7c797cdb27796d1f387c3. --- common/lib/capa/capa/capa_problem.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/common/lib/capa/capa/capa_problem.py b/common/lib/capa/capa/capa_problem.py index 20867ab323..9a5a15a696 100644 --- a/common/lib/capa/capa/capa_problem.py +++ b/common/lib/capa/capa/capa_problem.py @@ -436,12 +436,13 @@ class LoncapaProblem(object): sys.path = original_path + self._extract_system_path(script) stype = script.get('type') - - # Require that there be a type, and that the type be one we understand - known_types = ['loncapa/python', 'edx/python'] - if not stype in known_types: - continue - + + if stype: + if 'javascript' in stype: + continue # skip javascript + if 'perl' in stype: + continue # skip perl + # TODO: evaluate only python code = script.text XMLESC = {"'": "'", """: '"'} code = unescape(code, XMLESC)