Skip to content

Bugfix: Text Input problem type expects numeric answer when correct answer starts with a number - #19510

Merged
nasthagiri merged 1 commit into
openedx:masterfrom
weaveeducation:text-input-problem-pr
Feb 25, 2019
Merged

Bugfix: Text Input problem type expects numeric answer when correct answer starts with a number#19510
nasthagiri merged 1 commit into
openedx:masterfrom
weaveeducation:text-input-problem-pr

Conversation

@dmitry-viskov

Copy link
Copy Markdown
Contributor

Example:

>>Question.<<

= 100 test
or=test 100

Because the correct answer option (= 100 test) is a string that begins with the number, edX is treating the problem as though it requires a number answer, rather than a text string that can include letters and numbers. If the user enters an answer with text instead of just numbers, an error message that says "Error, couldn't parse formula" appears.

screenshot 2018-12-26 18 41 51

screenshot 2018-12-26 18 42 01

@openedx-webhooks

openedx-webhooks commented Dec 26, 2018

Copy link
Copy Markdown

Thanks for the pull request, @dmitry-viskov! I've created OSPR-2930 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR.

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

  • supporting documentation
  • Open edX discussion forum 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 be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@openedx-webhooks openedx-webhooks added needs triage open-source-contribution PR author is not from Axim or 2U labels Dec 26, 2018
@natabene

Copy link
Copy Markdown
Contributor

@dmitry-viskov This is great, thank you for your contribution. Please let me know once it is ready to be reviewed.

@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 Dec 26, 2018
@dmitry-viskov

Copy link
Copy Markdown
Contributor Author

@natabene hi. it is already ready for review. jenkins quality issues are not mine

@natabene

Copy link
Copy Markdown
Contributor

@edx/testeng Could you help us out with jenkins/quality test here?

@estute

estute commented Dec 27, 2018

Copy link
Copy Markdown
Contributor

@dmitry-viskov - I checked out the quality failures, and you are right- the build failed because you edited a file containing preexisting xsscommit-lint failures. The issue of running into older xss lint issues was recently discussed on another pull request: https://github.com/edx/edx-platform/pull/19385#issuecomment-448678120. From the PR:
Fixing the XSS warnings is strongly encouraged, but not strictly required. We have a backlog of these "might be a serious problem" code spots identified by the linter, and are trying to fix them as other work is being done in the same files (when the context of that part of the code is already fresh in mind). Documentation on how to avoid and fix these problems can be found here, and this is information that we'd like anybody working on HTML templates or code-generated HTML in Open edX to understand. But if there's a good case for not tackling the issues surfaced by xsscommitlint right now, we can merge the PR despite the linter failure.

@dmitry-viskov

Copy link
Copy Markdown
Contributor Author

@natabene ^

@natabene

Copy link
Copy Markdown
Contributor

@dmitry-viskov Got it, I will queue it for engineering review, though might take a while due to holidays.

@natabene

Copy link
Copy Markdown
Contributor

@edx/educator-admins Can you have a look when you have a chance?

@schenedx schenedx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I do prefer you can fix the linting issue identified by our quality check. Do you have a strong a reason not to do so?

checkIsNumeric = function(stringValue) {
// remove OLX feedback
if ((stringValue.indexOf('{{') !== -1) && (stringValue.indexOf('}}') !== -1)) {
stringValue = stringValue.replace(/{{[\s\S]*?}}/g, '').trim();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add some comment on what this replace is meant to do? Is it trying to remove all white space from this string?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

= 3.14159 +- .02   {{ Pie for everyone!   }}

->

= 3.14159 +- .02

@dmitry-viskov

Copy link
Copy Markdown
Contributor Author

Can you add some comment on what this replace is meant to do? Is it trying to remove all white space from this string?

@schenedx sorry but i'm not going to fix your internal issues

@schenedx

Copy link
Copy Markdown
Contributor

jenkins run quality

@edx-status-bot

Copy link
Copy Markdown

Your PR has finished running tests. The following contexts failed:

  • jenkins/quality

@schenedx

Copy link
Copy Markdown
Contributor

@robrap I need your help here.
Since this PR touches the file https://github.com/edx/edx-platform/blob/master/common/lib/xmodule/xmodule/js/src/problem/edit.js, xsslinter would complain about all the xss issues it identified on this file. There are 24 of these issues. I am not even sure how to fix these. What should we do in this case?

@robrap

robrap commented Feb 24, 2019

Copy link
Copy Markdown
Contributor

@schenedx: Happy to look on Monday with you. We can determine effort of fixing or commenting, or allow merge with it broken.

@schenedx schenedx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Upon review, I believe the code change here looks good. 👍
The xss-lint failures have nothing to do with this code change. We will merge this in as it is.

@natabene

Copy link
Copy Markdown
Contributor

@schenedx Great, thanks! Please merge when you are ready to do so - OSPR contributors don't have permissions to merge.

@nasthagiri
nasthagiri merged commit 3b41189 into openedx:master Feb 25, 2019
@openedx-webhooks

Copy link
Copy Markdown

@dmitry-viskov 🎉 Your pull request was merged!

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

@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production on Tuesday, February 26, 2019.

@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

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

@dmitry-viskov
dmitry-viskov deleted the text-input-problem-pr branch May 21, 2019 13:44
@openedx-webhooks openedx-webhooks added merged and removed awaiting prioritization waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Dec 18, 2020
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.

9 participants