Title: Incorrect highlighting because of flaws in ObjectAssignmentParser · Issue #359 · datacamp/pythonwhat · GitHub
Open Graph Title: Incorrect highlighting because of flaws in ObjectAssignmentParser · Issue #359 · datacamp/pythonwhat
X Title: Incorrect highlighting because of flaws in ObjectAssignmentParser · Issue #359 · datacamp/pythonwhat
Description: When checking whether an object is correctly created and the exercise only contains a single = operator in addition to other 'object-mutating' operations that don't use =, highlighting trips up. Reproducible example (in words) # solution...
Open Graph Description: When checking whether an object is correctly created and the exercise only contains a single = operator in addition to other 'object-mutating' operations that don't use =, highlighting trips up. Re...
X Description: When checking whether an object is correctly created and the exercise only contains a single = operator in addition to other 'object-mutating' operations that don't use =, highlighting ...
Opengraph URL: https://github.com/datacamp/pythonwhat/issues/359
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect highlighting because of flaws in ObjectAssignmentParser","articleBody":"When checking whether an object is correctly created and the exercise only contains a single `=` operator in addition to other 'object-mutating' operations that don't use `=`, highlighting trips up.\r\n\r\n## Reproducible example (in words)\r\n\r\n```python\r\n# solution\r\nx = []\r\nfor i in range(3):\r\n x.append(i)\r\n\r\n# sct\r\nEx().check_object('x').has_equal_value()\r\n```\r\n\r\nIf the student submits:\r\n\r\n```python\r\n# student\r\nx = []\r\nfor i in range(3):\r\n x.append(2 * i)\r\n```\r\n\r\nThe `x = []` will be highlighted, even though the mistake is in the `x.append()` step. This is extremely confusing for students! You can see it in action [here](https://www.dropbox.com/s/me22ch8ojuqb1en/Screenshot%202018-09-25%2013.19.00.png?dl=0)\r\n\r\n## Reproducible example (in code)\r\n\r\n```python\r\nfrom pythonwhat.local import setup_state\r\nfrom pythonwhat.Test import TestFail\r\nsol_code = \"x = []\\nfor i in range(3): x.append(i)\"\r\nstu_code = \"x = []\\nfor i in range(3): x.append(2 * i)\"\r\ns = setup_state(sol_code, stu_code)\r\ntry:\r\n s.check_object('x').has_equal_value()\r\nexcept TestFail as e:\r\n line_info = e.feedback.line_info\r\n\r\nline_info\r\n```\r\n\r\nThis will print out:\r\n\r\n```\r\n{'column_start': 0, 'line_start': 1, 'line_end': 1, 'column_end': 6}\r\n```\r\n\r\nWhile it should have a `line_start` on `line_end` equal to 2, _or just not highlight anything at all_.","author":{"url":"https://github.com/filipsch","@type":"Person","name":"filipsch"},"datePublished":"2018-09-26T15:49:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/359/pythonwhat/issues/359"}
| 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:108d28e8-73fb-1958-5c96-139fbd197ee5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D9BA:FBF0:7EF184:B01064:698CA3D9 |
| html-safe-nonce | 24f582e23956cc8aebfde58f7386699445402e713347fddd05c9c110faa77849 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOUJBOkZCRjA6N0VGMTg0OkIwMTA2NDo2OThDQTNEOSIsInZpc2l0b3JfaWQiOiI1NzQ5NjUzNzM3MTcwNTc2MzQ1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 47667796e1d71f176a5fb5abe76774b23286f832d3c4a838e3ee45cf62172a0b |
| hovercard-subject-tag | issue:364098048 |
| 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/359/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d5eb141b52a2f7d0dd650706352a03bb55bdff628366d13cb32fa09e54bc388c/datacamp/pythonwhat/issues/359 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d5eb141b52a2f7d0dd650706352a03bb55bdff628366d13cb32fa09e54bc388c/datacamp/pythonwhat/issues/359 |
| og:image:alt | When checking whether an object is correctly created and the exercise only contains a single = operator in addition to other 'object-mutating' operations that don't use =, highlighting trips up. Re... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | filipsch |
| 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