{"action":"opened","issue":{"url":"https://api.github.com/repos/jazkarta/edx-platform/issues/100","labels_url":"https://api.github.com/repos/jazkarta/edx-platform/issues/100/labels{/name}","comments_url":"https://api.github.com/repos/jazkarta/edx-platform/issues/100/comments","events_url":"https://api.github.com/repos/jazkarta/edx-platform/issues/100/events","html_url":"https://github.com/jazkarta/edx-platform/issues/100","id":84833096,"number":100,"title":"Error in ccx for problem with \"unsafe code\"","user":{"login":"cewing","id":417109,"avatar_url":"https://avatars.githubusercontent.com/u/417109?v=3","gravatar_id":"","url":"https://api.github.com/users/cewing","html_url":"https://github.com/cewing","followers_url":"https://api.github.com/users/cewing/followers","following_url":"https://api.github.com/users/cewing/following{/other_user}","gists_url":"https://api.github.com/users/cewing/gists{/gist_id}","starred_url":"https://api.github.com/users/cewing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cewing/subscriptions","organizations_url":"https://api.github.com/users/cewing/orgs","repos_url":"https://api.github.com/users/cewing/repos","events_url":"https://api.github.com/users/cewing/events{/privacy}","received_events_url":"https://api.github.com/users/cewing/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-04T00:25:48Z","updated_at":"2015-06-04T00:25:48Z","closed_at":null,"body":"@pdpinch This error message appears the the CCX I've built from the example course in my local environment:\r\n\r\n```\r\nProblem ccx-block-v1:edX+DemoX+Rerun1+ccx@1+type@problem+block@d7daeff25e4f4026bdd269ae69e03e02 has an error:\r\ncannot create LoncapaProblem ccx-block-v1:edX+DemoX+Rerun1+ccx@1+type@problem+block@d7daeff25e4f4026bdd269ae69e03e02: Execution of unsafe Javascript code is not allowed.\r\n```\r\n\r\nThe problem appears to arise from a check in `xmodule.capa_base` in the `CapaMixin` class when a [new `lcp` is created](https://github.com/jazkarta/edx-platform/blob/ccx-custom-ids/common/lib/xmodule/xmodule/capa_base.py#L230) for the object with this mixin.  \r\n\r\nIn the process of creating the problem block, the system checks to see if unsafe code is allowed, using a attribute [from the runtime for the object](https://github.com/jazkarta/edx-platform/blob/ccx-custom-ids/common/lib/xmodule/xmodule/capa_base.py#L303).\r\n\r\nThis attribute is a lambda that calls a [function by the same name](https://github.com/jazkarta/edx-platform/blob/ccx-custom-ids/common/djangoapps/util/sandboxing.py#L8) from `utils.sandboxing`, passing in a course id.  \r\n\r\nThe function checks a value `COURSES_WITH_UNSAFE_CODE` from settings, which appears to be set to an empty list.  Checking through settings files verifies that this list is empty except in some tests where it is overridden.\r\n\r\nI don't think this is actually a problem with CCX, but wanted to open an issue in case it is a sign of something serious.\r\n\r\n"}}