Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UnlimitedPolygon] Fix open polygon scoring issues. #1999

Merged
merged 10 commits into from
Dec 16, 2024

Conversation

catandthemachines
Copy link
Member

@catandthemachines catandthemachines commented Dec 13, 2024

Summary:

This PR fixes and adds 3 things to the Unlimited Polygon Experience:

  1. Only closed unlimited polygons are scorable.
  2. Correct Unlimited Polygons in our editor are closed when rendered (i.e. unlimited polygons that are rendered with exisitng coordinates of 3 or more are closed at start).
  3. Added save warnings to editor to notify content creators to close their unlimited polygons before saving.

Issue: LEMS-2682

Test plan:

  1. Go to http://localhost:6006/?path=/story/perseuseditor-widgets-interactive-graph--interactive-graph-unlimited-polygon.
  2. Notice that the unlimited polygon correct answer is automatically closed on render.
  3. Go to http://localhost:6006/?path=/story/perseus-widgets-interactive-graph--unlimited-polygon-with-mafs
  4. Draw a polygon and check it when it's open, you should see the score is type invalid
  5. Close the polygon and git it again, it should be a valid score.

@catandthemachines catandthemachines self-assigned this Dec 13, 2024
Copy link
Contributor

github-actions bot commented Dec 13, 2024

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (cf99339) and published it to npm. You
can install it using the tag PR1999.

Example:

yarn add @khanacademy/perseus@PR1999

If you are working in Khan Academy's webapp, you can run:

./dev/tools/bump_perseus_version.sh -t PR1999

Copy link
Contributor

github-actions bot commented Dec 13, 2024

Size Change: +261 B (+0.02%)

Total Size: 1.27 MB

Filename Size Change
packages/perseus-editor/dist/es/index.js 688 kB +89 B (+0.01%)
packages/perseus/dist/es/index.js 416 kB +172 B (+0.04%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 39 kB
packages/keypad-context/dist/es/index.js 760 B
packages/kmath/dist/es/index.js 4.27 kB
packages/math-input/dist/es/index.js 78 kB
packages/math-input/dist/es/strings.js 1.79 kB
packages/perseus-core/dist/es/index.js 1.48 kB
packages/perseus-linter/dist/es/index.js 22.2 kB
packages/perseus/dist/es/strings.js 4.12 kB
packages/pure-markdown/dist/es/index.js 3.67 kB
packages/simple-markdown/dist/es/index.js 12.5 kB

compressed-size-action

Copy link
Contributor

@nishasy nishasy left a comment

Choose a reason for hiding this comment

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

I like this approach. I like how straightforward it is.

@catandthemachines catandthemachines merged commit 278527b into main Dec 16, 2024
8 checks passed
@catandthemachines catandthemachines deleted the catjohnson/fix-scorable-polygon branch December 16, 2024 16:55
somewhatabstract added a commit that referenced this pull request Dec 16, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @khanacademy/[email protected]

### Patch Changes

- [#2014](#2014)
[`763d2d0f1`](763d2d0)
Thanks [@somewhatabstract](https://github.com/somewhatabstract)! -
Migrate off deprecated ID generation APIs


- [#2009](#2009)
[`b09d19b7b`](b09d19b)
Thanks [@catandthemachines](https://github.com/catandthemachines)! -
Fixing bug in creating concave shapes in unlimited polygons.


- [#1978](#1978)
[`81632c326`](81632c3)
Thanks [@nishasy](https://github.com/nishasy)! - [Polygon] Remove
duplicate points when determining if a polygon can be closed


- [#1999](#1999)
[`278527b08`](278527b)
Thanks [@catandthemachines](https://github.com/catandthemachines)! -
Fixing open polygon scoring issues within exercises and editors.

## @khanacademy/[email protected]

### Patch Changes

- [#2014](#2014)
[`763d2d0f1`](763d2d0)
Thanks [@somewhatabstract](https://github.com/somewhatabstract)! -
Migrate off deprecated ID generation APIs


- [#1978](#1978)
[`81632c326`](81632c3)
Thanks [@nishasy](https://github.com/nishasy)! - [Polygon] Remove
duplicate points when determining if a polygon can be closed


- [#1999](#1999)
[`278527b08`](278527b)
Thanks [@catandthemachines](https://github.com/catandthemachines)! -
Fixing open polygon scoring issues within exercises and editors.

- Updated dependencies
\[[`763d2d0f1`](763d2d0),
[`b09d19b7b`](b09d19b),
[`81632c326`](81632c3),
[`278527b08`](278527b)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

- [#2014](#2014)
[`763d2d0f1`](763d2d0)
Thanks [@somewhatabstract](https://github.com/somewhatabstract)! -
Migrate off deprecated ID generation APIs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants