Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
Disallow degenerate case in rhombus creation
Browse files Browse the repository at this point in the history
Summary:
In `areas_of_trapezoids_rhombi_and_kites`, if the random values were drawn such that `SH == -B2`,
then the rhombus would be constructed in a way such that there wasn't room for the right angle
sign, leading to a JavaScript error. On mobile, this made such exercises uncompletable.

Test Plan:
- Run `python -m SimpleHTTPServer`.
- Navigate to `areas_of_trapezoids_rhombi_and_kites`.
- Load a bunch of times; verify that things are sane and that there are no errors.

Reviewers: emily

Reviewed By: emily

Subscribers: jared, #ios

Differential Revision: https://phabricator.khanacademy.org/D25841
  • Loading branch information
Charles Marsh committed Mar 10, 2016
1 parent 2a10441 commit e4440e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exercises/areas_of_trapezoids_rhombi_and_kites.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<var id="B2">randRange(2, 8)</var>
<var id="H">randRange(1, 6)</var>

<var id="SH">randRangeNonZero(-2, 2)</var>
<var id="SH">randRangeExclude(-2, 2, [0, -B2])</var>

<var id="K">1/2 * (B1 + B2) * H</var>
</div>
Expand Down

0 comments on commit e4440e2

Please sign in to comment.