Commit af5340fd by Victor Shnayder

Make script type checking more strict

- check for known script type instead of ignoring js and perl
parent 773e5fa2
...@@ -436,13 +436,12 @@ class LoncapaProblem(object): ...@@ -436,13 +436,12 @@ class LoncapaProblem(object):
sys.path = original_path + self._extract_system_path(script) sys.path = original_path + self._extract_system_path(script)
stype = script.get('type') stype = script.get('type')
if stype: # Require that there be a type, and that the type be one we understand
if 'javascript' in stype: known_types = ['loncapa/python', 'edx/python']
continue # skip javascript if not stype in known_types:
if 'perl' in stype: continue
continue # skip perl
# TODO: evaluate only python
code = script.text code = script.text
XMLESC = {"'": "'", """: '"'} XMLESC = {"'": "'", """: '"'}
code = unescape(code, XMLESC) code = unescape(code, XMLESC)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment