oppia: [BUG]: TODO(wxy): Validate that inputs.a <= inputs.b.

Describe the bug

The HasLengthInclusivelyBetween method currently does not perform any validation on the inputs, potentially leading to incorrect behavior if inputs.a is greater than inputs.b. The TODO comment indicates the need to validate that inputs.a is less than or equal to inputs.b.

This issue aims to add the necessary validation logic to ensure the inputs are correctly validated before processing.

Code location: extensions/interactions/MusicNotesInput/directives/music-notes-input-rules.service.ts

URL of the page where the issue is observed.

No response

Steps To Reproduce

  1. Open the file containing the MusicNotesInputRulesService class.
  2. Locate the HasLengthInclusivelyBetween method and its TODO comment.

Expected Behavior

The HasLengthInclusivelyBetween method should validate that inputs.a is less than or equal to inputs.b before proceeding with the length check. If the validation fails, the method should handle the error appropriately, either by returning false or throwing an error.

Screenshots/Videos

No response

What device are you using?

No response

Operating System

No response

What browsers are you seeing the problem on?

No response

Browser version

No response

Additional context

  • Ensure that the rest of the method executes only if the validation passes.
  • Ensure that the validation logic covers all possible edge cases to prevent invalid configurations.

Tips for developers

Before addressing the bug, please identify which PR caused the issue (you can follow the steps here). If you identify the PR, comment on the issue with a link to it. If not, mention the commit hash of the oldest commit you saw the bug on (and the month and year it was made in).

Then, please leave a comment with details of the approach that you plan to take to fix the issue (see example).

Note: If this is your first Oppia issue, please make sure to follow our guidelines for choosing an issue and setting things up. You will also need to show a demo of the fix working correctly on your local machine. Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 23 (19 by maintainers)

Commits related to this issue

Most upvoted comments

@HardikGoyal2003 Thank you Hardik, I have run the front end tests and attached a screenshot of the successful tests in this PR: https://github.com/oppia/oppia/pull/20977

Hey @sonu4578 Solution looks good!! Assigning the issue to you!!