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

Refine Label Image Rubric type #1756

Merged
merged 8 commits into from
Oct 17, 2024
Merged

Conversation

Myranae
Copy link
Contributor

@Myranae Myranae commented Oct 16, 2024

Summary:

As part of the Server Side Scoring project, this refactors Label Image's Rubric type based on current usage. It is not currently used in this widget. As we plan to review the use of rubric during LEMS-2440, the Rubric type was left in but changed to Empty. It was also added in one place where rubric was listed as a parameter (but was not in use).

Issue: LEMS-2468

Test plan:

  • Confirm all tests pass
  • Confirm the label image widget still works in Storybook

@Myranae Myranae self-assigned this Oct 16, 2024
Copy link
Contributor

github-actions bot commented Oct 16, 2024

npm Snapshot: Published

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

Example:

yarn add @khanacademy/perseus@PR1756

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

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

Copy link
Contributor

github-actions bot commented Oct 16, 2024

Size Change: +92 B (+0.01%)

Total Size: 866 kB

Filename Size Change
packages/perseus/dist/es/index.js 420 kB +92 B (+0.02%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 38.3 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-editor/dist/es/index.js 280 kB
packages/perseus-linter/dist/es/index.js 22.2 kB
packages/perseus/dist/es/strings.js 3.4 kB
packages/pure-markdown/dist/es/index.js 3.66 kB
packages/simple-markdown/dist/es/index.js 12.4 kB

compressed-size-action

@Myranae Myranae marked this pull request as ready for review October 16, 2024 19:31
@Myranae Myranae requested a review from handeyeco October 16, 2024 19:31
@khan-actions-bot khan-actions-bot requested a review from a team October 16, 2024 19:31
@khan-actions-bot
Copy link
Contributor

Gerald

Required Reviewers
  • @Khan/perseus for changes to .changeset/red-points-call.md, packages/perseus/src/validation.types.ts, packages/perseus/src/widgets/label-image/label-image-validator.ts, packages/perseus/src/widgets/label-image/label-image.tsx

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

Comment on lines +126 to +128
/* TODO(LEMS-2440): Should be removed or refactored. Grading info may need
to be moved to the rubric from userInput. */
export type PerseusLabelImageRubric = Empty;
Copy link
Contributor Author

@Myranae Myranae Oct 16, 2024

Choose a reason for hiding this comment

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

I originally just removed everything related to rubric, but I think we might want to pull answers out of userInput.

@@ -317,7 +320,8 @@ export class LabelImage
return {markers};
}

showRationalesForCurrentlySelectedChoices(rubric: LabelImageProps) {
// TODO(LEMS-2440): Can possibly remove rubric parameter during 2440? Or refactor
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the comment to reference LEMS-2544.

@@ -43,14 +43,15 @@ export function scoreMarker(
return score;
}

// TODO(LEMS-2440): Can possibly remove rubric parameter during 2440?
Copy link
Contributor

Choose a reason for hiding this comment

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

For LabelImage I don't think we'll be able to remove rubric. It'll be something like:

type PerseusLabelImageUserInput = {
    selected: ReadonlyArray<string>;
}

type PerseusLabelImageRubric = {
    answers: ReadonlyArray<string>;
}

We just have to untangle how LabelImage is mashing together WidgetOptions/Rubric/UserInput. No action needed right now, it'll be a part of LEMS-2440.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the comment to point out where answers is located.

@Myranae Myranae merged commit 3a208ba into main Oct 17, 2024
9 checks passed
@Myranae Myranae deleted the tb/LEMS-2468/label-image-refine-types branch October 17, 2024 14:38
mark-fitzgerald pushed a commit that referenced this pull request Oct 17, 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

-   [#1747](#1747) [`81ee69b0a`](81ee69b) Thanks [@kevinb-khan](https://github.com/kevinb-khan)! - Update nodes.js to use ES6 classes


-   [#1748](#1748) [`93bd39b6b`](93bd39b) Thanks [@kevinb-khan](https://github.com/kevinb-khan)! - Convert nodes.js to use TypeScript

## @khanacademy/[email protected]

### Patch Changes

-   [#1751](#1751) [`c95d08056`](c95d080) Thanks [@Myranae](https://github.com/Myranae)! - Refine InputNumber's rubric type


-   [#1756](#1756) [`3a208ba12`](3a208ba) Thanks [@Myranae](https://github.com/Myranae)! - Refine LabelImage's Rubric type


-   [#1762](#1762) [`a0f438fd7`](a0f438f) Thanks [@mark-fitzgerald](https://github.com/mark-fitzgerald)! - BUGFIX - [Number Line] - Some exercises with fractions wouldn't render

-   Updated dependencies \[[`81ee69b0a`](81ee69b), [`93bd39b6b`](93bd39b)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`81ee69b0a`](81ee69b), [`c95d08056`](c95d080), [`93bd39b6b`](93bd39b), [`3a208ba12`](3a208ba), [`a0f438fd7`](a0f438f)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`81ee69b0a`](81ee69b), [`93bd39b6b`](93bd39b)]:
    -   @khanacademy/[email protected]

Author: khan-actions-bot

Reviewers: mark-fitzgerald

Required Reviewers:

Approved By: mark-fitzgerald

Checks: ⏭️  Publish npm snapshot, ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ gerald

Pull Request URL: #1755
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.

3 participants