Skip to content

[BUG]: Fractions Lesson accepts incorrect integer/fraction inputs [Developer Build] #5983

@Rd4dev

Description

@Rd4dev

Describe the bug

The Prototype Exploration -> Fraction Lesson
Qn: "What fraction represents half of something?" accepts incorrect answers.

This is caused by the test asset: test_exp_id_2.json

"rule_specs": [
  {
    "rule_type": "IsExactlyEqualTo",
    "inputs": {
      "f": { "isNegative": false, "wholeNumber": 0, "numerator": 1, "denominator": 2 }
    }
  },
  {
    "rule_type": "HasIntegerPartEqualTo",
    "inputs": { "x": 1 }
  }
]
  • The first rule expects exactly 1/2.
  • The second rule accepts any fraction with integer part = 1, including 1, 1 1/2, 1 3/4, 1 5/6, 1 99/100.
  • This leads to incorrect answers being marked as correct, e.g., 1 and 1 5/6.

The second rule incorrectly allows fractions or integers that are not actually “half”, causing misalignment between the intended answer and the current rules.

Steps To Reproduce

  1. Run the oppia_dev build of the app.
  2. Open Prototype Explorations.
  3. Open Fractions Lesson.
  4. Navigate to the Question: “What fraction represents half of something?”
  5. Enter the following inputs:
    • 1 → accepted (incorrect)
    • 1 5/6 →accepted (incorrect)
    • 1/2 → accepted (correct)
    • 0 1/2 → accepted (correct)

Expected Behavior

  • To Only accept exactly 1/2
  • Seek clarification from the team (if optionally equivalent fractions like 2/4, 50/100 should be considered).

Proposed Solution

Note from team: The developer version should mirror the production app as closely as possible.
And to revert the PR changes.

  • Remove HasIntegerPartEqualTo from this answer group:
    • In the JSON.
    • In the textprotos
  • Add proper verifications to validate the expected behavior and prevent regressions in future.

Screenshots/Videos

Ans: 1 Ans: 1 5/6 Ans: 1/2 Ans: 0 1/2
Image Image Image Image

What device/emulator are you using?

Nexus 5X

Which Android version is your device/emulator running?

API 27

Which version of the Oppia Android app are you using?

d7ef1d5

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Impact: MediumModerate perceived user impact (non-blocking bugs and general improvements).Work: LowSolution is clear and broken into good-first-issue-sized chunks.bugEnd user-perceivable behaviors which are not desirable.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions