Title: check_function() not working as documented (or what am I missing?) · Issue #394 · datacamp/pythonwhat · GitHub
Open Graph Title: check_function() not working as documented (or what am I missing?) · Issue #394 · datacamp/pythonwhat
X Title: check_function() not working as documented (or what am I missing?) · Issue #394 · datacamp/pythonwhat
Description: Hello! Just recently stumbled across this project in conjunction with datacamp-light, and I'm really keen to incorporate into some online assignments for my students. However, I'm having trouble using check_function() in my SCT. Can't ev...
Open Graph Description: Hello! Just recently stumbled across this project in conjunction with datacamp-light, and I'm really keen to incorporate into some online assignments for my students. However, I'm having trouble us...
X Description: Hello! Just recently stumbled across this project in conjunction with datacamp-light, and I'm really keen to incorporate into some online assignments for my students. However, I'm having tr...
Opengraph URL: https://github.com/datacamp/pythonwhat/issues/394
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"check_function() not working as documented (or what am I missing?)","articleBody":"Hello!\r\n\r\nJust recently stumbled across this project in conjunction with datacamp-light, and I'm really keen to incorporate into some online assignments for my students.\r\n\r\nHowever, I'm having trouble using `check_function()` in my SCT. Can't even get the first example in under [\"Basic functionality\" (in your docs](https://pythonwhat.readthedocs.io/en/latest/articles/checking_function_calls.html#basic-functionality)) to work.\r\n\r\nHere's my markup:\r\n\r\n```html\r\n\u003cdiv data-datacamp-exercise data-lang=\"python\"\u003e\r\n \u003ccode data-type=\"sample-code\"\u003e\r\n\r\n round(2.718282, ndigits = 3)\r\n\r\n \u003c/code\u003e\r\n \u003ccode data-type=\"sct\"\u003e\r\n Ex().check_function(\"round\").multi(\r\n check_args(\"number\").has_equal_value(),\r\n check_args(\"ndigits\").has_equal_value()\r\n )\r\n \u003c/code\u003e\r\n\u003c/div\u003e\r\n```\r\n\r\nThe result when I hit \"Run\" looks correct. But when I hit \"Submit, here's the error I get:\r\n\r\n```\r\nDataCamp encountered the following error:\r\nTraceback (most recent call last):\r\n File \"/var/lib/python/site-packages/protobackend/output.py\", line 70, in wrapper\r\n output = f(*args, **kwargs)\r\n File \"/var/lib/python/site-packages/pythonbackend/commands.py\", line 63, in worker_dispatch\r\n return d.dispatch(cmd)\r\n File \"/var/lib/python/site-packages/protobackend/dispatcher.py\", line 28, in dispatch\r\n cmd_output = cmd(pre_payload)\r\n File \"/var/lib/python/site-packages/pythonbackend/Exercise.py\", line 123, in runSubmit\r\n self.dc_force_diagnose,\r\n File \"/var/lib/python/site-packages/pythonwhat/test_exercise.py\", line 67, in test_exercise\r\n raise e\r\n File \"/var/lib/python/site-packages/pythonwhat/test_exercise.py\", line 57, in test_exercise\r\n exec(sct, sct_cntxt)\r\n File \"\u003cstring\u003e\", line 1, in \u003cmodule\u003e\r\n File \"/var/lib/python/site-packages/protowhat/sct_syntax.py\", line 258, in __call__\r\n ChainedCall(self.function, args, kwargs), previous=self.chain\r\n File \"/var/lib/python/site-packages/protowhat/sct_syntax.py\", line 225, in __init__\r\n self._state = chained_call(state)\r\n File \"/var/lib/python/site-packages/protowhat/sct_syntax.py\", line 113, in __call__\r\n return self.callable(state, *self.args, **self.kwargs)\r\n File \"/var/lib/python/site-packages/protowhat/sct_syntax.py\", line 78, in wrapper\r\n force=isinstance(error, InstructorError),\r\n File \"/var/lib/python/site-packages/protowhat/failure.py\", line 88, in _debug\r\n raise failure_type(state.get_feedback(FeedbackComponent(feedback)), state.state_history)\r\nprotowhat.failure.InstructorError: `check_function()` couldn't find a call of `round()` in the solution code. Make sure you get the mapping right!\r\n\r\nDebug on error:\r\nSCT function state history: `check_function`\r\nLast test: `\u003cFail {'result': False, 'feedback': \u003cFeedbackComponent {'append': True, 'message': \"`check_function()` couldn't find a call of `round()` in the solution code. Make sure you get the mapping right!\", 'kwargs': {}}\u003e}\u003e`\r\n```","author":{"url":"https://github.com/gordonje","@type":"Person","name":"gordonje"},"datePublished":"2020-02-03T21:53:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/394/pythonwhat/issues/394"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4c1ded01-0e3a-35e7-cb64-42864e196bc3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9164:7F630:21F73E2:2ECF344:698CDD72 |
| html-safe-nonce | 3f3f4adf97d804b923b9a788f49f88933521fddaa6f64945065e320db4377f8e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTY0OjdGNjMwOjIxRjczRTI6MkVDRjM0NDo2OThDREQ3MiIsInZpc2l0b3JfaWQiOiI0NTMwMTY3ODk3NDAyNDMyODgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5b9bd4f2938f27d3b82c7a2f407183fbafb9b97c779f15af12bce63a26365cbd |
| hovercard-subject-tag | issue:559357192 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/datacamp/pythonwhat/394/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ddec8c7232c344efe0a1e87ef8c039909022ff7fc807b77a8ad65d4225064b1f/datacamp/pythonwhat/issues/394 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ddec8c7232c344efe0a1e87ef8c039909022ff7fc807b77a8ad65d4225064b1f/datacamp/pythonwhat/issues/394 |
| og:image:alt | Hello! Just recently stumbled across this project in conjunction with datacamp-light, and I'm really keen to incorporate into some online assignments for my students. However, I'm having trouble us... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gordonje |
| hostname | github.com |
| expected-hostname | github.com |
| None | 640eeb7b6ff4d8d106235d228c0c286e82592d4d2403227b5b2b4fc5832297a4 |
| turbo-cache-control | no-preview |
| go-import | github.com/datacamp/pythonwhat git https://github.com/datacamp/pythonwhat.git |
| octolytics-dimension-user_id | 6276968 |
| octolytics-dimension-user_login | datacamp |
| octolytics-dimension-repository_id | 51361383 |
| octolytics-dimension-repository_nwo | datacamp/pythonwhat |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 51361383 |
| octolytics-dimension-repository_network_root_nwo | datacamp/pythonwhat |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3d444f0a47beeeac94cddbb51c91ab408befe8d4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width