Skip to content

Remove physical constants and suffixes from calc.py#17368

Merged
nedbat merged 1 commit intoopenedx:masterfrom
mitodl:pdpinch/remove-constansts-and-suffixes
Apr 26, 2018
Merged

Remove physical constants and suffixes from calc.py#17368
nedbat merged 1 commit intoopenedx:masterfrom
mitodl:pdpinch/remove-constansts-and-suffixes

Conversation

@jolyonb
Copy link
Contributor

@jolyonb jolyonb commented Jan 31, 2018

In formula problems, a number of physical constants have been predefined, as well as some suffixes. In my experience, these only lead to student confusion. Students expect an error to be raised when invalid input is given. So, when the answer to a given problem is 2*m and students forget the multiplication sign and instead enter 2m and are graded incorrect, this leads to student frustration, excess discussion forum posts, extra work for the instructor, etc. The problem is exacerbated in an exam situation where correctness is not shown until the end of the exam.

The physical constants have been defined to be particular numbers, and often lead to unintended consequences. Students expect that undefined variables will raise an error message, but the variables c, Q, T and k are accepted without warning. These variables are also particularly useless as defined, as they're specified in particular units, and cannot be used when working with different units. Best practice is definitely to sample variables appropriately when allowing for formula input.

This PR removes all extraneous physical constants and suffixes.

@openedx-webhooks
Copy link

Thanks for the pull request, @jolyonb! I've created OSPR-2187 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams.

Feel free to add as much of the following information to the ticket:

  • supporting documentation
  • edx-code email threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will still be done via the GitHub pull request interface. As a reminder, our process documentation is here.

@openedx-webhooks openedx-webhooks added needs triage open-source-contribution PR author is not from Axim or 2U labels Jan 31, 2018
@pdpinch
Copy link
Contributor

pdpinch commented Jan 31, 2018

@jolyonb this is failing on the case-sensitivity test. The value for e seems to be reverting to the constant instead of using the value we set for E in the test. What's the correct behavior?

from https://build.testeng.edx.org/job/edx-platform-python-unittests-pr/48020/testReport/junit/calc.calc.tests.test_calc/EvaluatorTest/test_variable_case_sensitivity/

         variables = {'E': 1.0}
>       self.assertEqual(calc.evaluator(variables, {}, "e"), 1.0)
E       AssertionError: 2.718281828459045 != 1.0

@jolyonb
Copy link
Contributor Author

jolyonb commented Feb 1, 2018

Huh. There's a bug in the underlying code that's been dormant for years! This one isn't our fault!

@nedbat
Copy link
Contributor

nedbat commented Feb 2, 2018

How do we get confidence that others aren't using these constants and will be broken if we remove them?

Also, the tests have to pass. We can't merge to master with a failing test.

@nedbat
Copy link
Contributor

nedbat commented Feb 2, 2018

This is still labeled as WIP. Ping me when you are ready for a review.

@openedx-webhooks openedx-webhooks added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. and removed needs triage labels Feb 2, 2018
@jolyonb
Copy link
Contributor Author

jolyonb commented Feb 2, 2018

I don't know that other people aren't using them, and this may well break some things. I want to begin a discussion regarding them though. From my discussions with other MOOC creators in physics and math, these are universally reviled as creating frustrations for students and extra work for staff on the discussion boards.

@jefrench
Copy link

jefrench commented Feb 8, 2018

I build the math MOOCs at MIT, and I can say that I have never used the built in suffixes or prefixes ever in all of the 3000+ problems I've build over the years. I imagine these were built in specifically for the original course 6.002x. I imagine that it is so case specific, that it is not very valuable for most others.

@nedbat
Copy link
Contributor

nedbat commented Feb 26, 2018

@sstack22 Can we get a product assessment about changing these details of calc's behavior?

@nedbat
Copy link
Contributor

nedbat commented Feb 26, 2018

jenkins run python

@nedbat
Copy link
Contributor

nedbat commented Feb 26, 2018

jenkins run quality

@openedx-webhooks openedx-webhooks added product review PR requires product review before merging and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Feb 28, 2018
@pdpinch pdpinch force-pushed the pdpinch/remove-constansts-and-suffixes branch from 43e5ae0 to c4ff00a Compare March 2, 2018 14:22
@sstack22
Copy link

sstack22 commented Mar 2, 2018

@nedbat - @shamck and @scottrish are triaging incoming Educator OSPRS, adding them here.

@edx-status-bot
Copy link

Your PR has finished running tests.

@jolyonb
Copy link
Contributor Author

jolyonb commented Mar 14, 2018

jenkins run python

@edx-status-bot
Copy link

Your PR has finished running tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line has to go. The code gives unpredictable results when there is a name collision due to case insensitivity. This is an old issue, and not one that anybody actually runs into. Also, we should not be testing for unpredictable results.

@openedx-webhooks openedx-webhooks added awaiting prioritization and removed product review PR requires product review before merging labels Mar 15, 2018
@nedbat
Copy link
Contributor

nedbat commented Mar 15, 2018

@shamck Are you giving a "product thumbs-up" to this change?

@pdpinch pdpinch force-pushed the pdpinch/remove-constansts-and-suffixes branch from ca7b46a to ebfcd94 Compare March 20, 2018 15:14
@edx-status-bot
Copy link

Your PR has finished running tests.

1 similar comment
@edx-status-bot
Copy link

Your PR has finished running tests.

@pdpinch
Copy link
Contributor

pdpinch commented Mar 20, 2018

jenkins run python

@edx-status-bot
Copy link

Your PR has finished running tests.

@pdpinch pdpinch force-pushed the pdpinch/remove-constansts-and-suffixes branch from 875fde4 to 0419347 Compare March 21, 2018 17:03
@edx-status-bot
Copy link

Your PR has finished running tests.

@pdpinch pdpinch changed the title WIP: Remove physical constants and suffixes from calc.py Remove physical constants and suffixes from calc.py Mar 21, 2018
@pdpinch
Copy link
Contributor

pdpinch commented Mar 21, 2018

Squashed commits and removed the 'WIP' from the title.

@nedbat
Copy link
Contributor

nedbat commented Mar 23, 2018

@sstack22 @scottrish @shamck I don't understand Product's opinion here.

@shamck
Copy link

shamck commented Mar 26, 2018

Confirming that this has product approval and is ready to be assigned to a development team.

@miruto
Copy link

miruto commented Mar 29, 2018

Please make this change!! Having these constants pre-defined is messing up all of my students in 8.02x right now!

@jolyonb
Copy link
Contributor Author

jolyonb commented Apr 26, 2018

@nedbat Can we get an update on this please?

@nedbat nedbat merged commit 6c3bd5d into openedx:master Apr 26, 2018
@openedx-webhooks
Copy link

@jolyonb 🎉 Your pull request was merged!

Please take a moment to answer a two question survey so we can improve your experience in the future.

@pdpinch
Copy link
Contributor

pdpinch commented Apr 26, 2018 via email

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production on Friday, April 27, 2018.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

@pdpinch pdpinch deleted the pdpinch/remove-constansts-and-suffixes branch August 8, 2018 13:36
ghassanmas added a commit to ghassanmas/edx-platform that referenced this pull request Mar 7, 2022
  - It replicate this PR: frontend-app-learning/pull/825 which
  rewrite calcualtor tips since some tips are no longer relevant,
  hence: openedx#17368
rgraber pushed a commit that referenced this pull request Mar 10, 2022
- It replicate this PR: frontend-app-learning/pull/825 which
  rewrite calcualtor tips since some tips are no longer relevant,
  hence: #17368

Co-authored-by: Rebecca Graber <rgraber@edx.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged open-source-contribution PR author is not from Axim or 2U

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

Comments