{"action":"created","issue":{"url":"https://api.github.com/repos/edx/edx-platform/issues/13534","repository_url":"https://api.github.com/repos/edx/edx-platform","labels_url":"https://api.github.com/repos/edx/edx-platform/issues/13534/labels{/name}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/13534/comments","events_url":"https://api.github.com/repos/edx/edx-platform/issues/13534/events","html_url":"https://github.com/edx/edx-platform/pull/13534","id":178531288,"number":13534,"title":"Allows ChoiceResponse problems to set correctness with python variables","user":{"login":"pomegranited","id":7556571,"avatar_url":"https://avatars.githubusercontent.com/u/7556571?v=3","gravatar_id":"","url":"https://api.github.com/users/pomegranited","html_url":"https://github.com/pomegranited","followers_url":"https://api.github.com/users/pomegranited/followers","following_url":"https://api.github.com/users/pomegranited/following{/other_user}","gists_url":"https://api.github.com/users/pomegranited/gists{/gist_id}","starred_url":"https://api.github.com/users/pomegranited/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pomegranited/subscriptions","organizations_url":"https://api.github.com/users/pomegranited/orgs","repos_url":"https://api.github.com/users/pomegranited/repos","events_url":"https://api.github.com/users/pomegranited/events{/privacy}","received_events_url":"https://api.github.com/users/pomegranited/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/edx/edx-platform/labels/engineering%20review","name":"engineering review","color":"c7def8"},{"url":"https://api.github.com/repos/edx/edx-platform/labels/open-source-contribution","name":"open-source-contribution","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":29,"created_at":"2016-09-22T06:20:41Z","updated_at":"2016-10-14T23:23:10Z","closed_at":"2016-10-14T07:25:12Z","pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/13534","html_url":"https://github.com/edx/edx-platform/pull/13534","diff_url":"https://github.com/edx/edx-platform/pull/13534.diff","patch_url":"https://github.com/edx/edx-platform/pull/13534.patch"},"body":"**Desired Deployment Date: 2016-10-31**\r\n\r\nAllows ChoiceResponse CAPA problems to use script-computed variables to determine a choice's correctness, as MultipleChoiceResponse problems already do.\r\n\r\nAdds a unit test for this change, and for the existing MultipleChoiceResponse computed correctness capability.\r\n\r\nSee related [edx-documentation/PR #1282](https://github.com/edx/edx-documentation/pull/1282).\r\n\r\n**Sandbox URL**:\r\n\r\n* LMS: http://pr13534.sandbox.opencraft.hosting/\r\n* Studio: http://studio-pr13534.sandbox.opencraft.hosting/\r\n\r\nSee [ChoiceResponse Correctness Test Course](http://pr13534.sandbox.opencraft.hosting/courses/course-v1:OpenCraft+CR101x+2016/courseware/5566acad60cf4d9a84dbcd92ffcda2d0/87e8a1dad9c34c45b480a8d9fd1befd2/).\r\n\r\n**Testing instructions**:\r\n\r\n1. In Studio, add a Checkbox Problem with the following Advanced XML:\r\n\r\n    ```\r\n<problem>\r\n<script type=\"text/python\">\r\n<![CDATA[\r\nrandom.seed(anonymous_student_id)  # Use different random numbers for each student.\r\na = random.randint(1,10)\r\nb = random.randint(1,10)\r\nc = a + b\r\n\r\nok0 = c % 2 == 0 # check remainder modulo 2\r\ntext0 = \"$a + $b is divisible by 2\"\r\n\r\nok1 = c % 3 == 0 # check remainder modulo 3\r\ntext1 = \"$a + $b is divisible by 3\"\r\n\r\nok2 = c % 5 == 0 # check remainder modulo 5\r\ntext2 = \"$a + $b is divisible by 5\"\r\n\r\nok3 = not any([ok0, ok1, ok2])\r\ntext3 = \"None of the above statements is true.\"\r\n]]>\r\n</script>\r\n    <p>Which statements about the number $a+$b are true? Select all that apply.</p>\r\n    <choiceresponse>\r\n      <checkboxgroup label=\"Mark the true statements\" direction=\"vertical\">\r\n        <choice correct=\"$ok0\">$text0 ... (should be $ok0)</choice>\r\n        <choice correct=\"$ok1\">$text1 ... (should be $ok1)</choice>\r\n        <choice correct=\"$ok2\">$text2 ... (should be $ok2)</choice>\r\n        <choice correct=\"$ok3\">$text3 ... (should be $ok3)</choice>\r\n      </checkboxgroup>\r\n    </choiceresponse>\r\n\r\n    <p><strong>Comment:</strong> In the <code>choice</code> tags for this problem, both the <code>correct</code> attribute and tag content are set set using Python.</p>\r\n</problem>\r\n```\r\n2. Ensure that the choice content and \"correctness\" for each choice has been correctly set for the dynamically generated number values.\r\n\r\n**Reviewers**\r\n- [x] @itsjeyd \r\n- [x] @staubina "},"comment":{"url":"https://api.github.com/repos/edx/edx-platform/issues/comments/253942600","html_url":"https://github.com/edx/edx-platform/pull/13534#issuecomment-253942600","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/13534","id":253942600,"user":{"login":"pomegranited","id":7556571,"avatar_url":"https://avatars.githubusercontent.com/u/7556571?v=3","gravatar_id":"","url":"https://api.github.com/users/pomegranited","html_url":"https://github.com/pomegranited","followers_url":"https://api.github.com/users/pomegranited/followers","following_url":"https://api.github.com/users/pomegranited/following{/other_user}","gists_url":"https://api.github.com/users/pomegranited/gists{/gist_id}","starred_url":"https://api.github.com/users/pomegranited/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pomegranited/subscriptions","organizations_url":"https://api.github.com/users/pomegranited/orgs","repos_url":"https://api.github.com/users/pomegranited/repos","events_url":"https://api.github.com/users/pomegranited/events{/privacy}","received_events_url":"https://api.github.com/users/pomegranited/received_events","type":"User","site_admin":false},"created_at":"2016-10-14T23:23:10Z","updated_at":"2016-10-14T23:23:10Z","body":"Whew, thanks @cahrens !"}}
{"actor":{"display_login":"pomegranited"}}