Skip to content

Commit

Permalink
Remove unused rubric type for iFrame (#1996)
Browse files Browse the repository at this point in the history
## Summary:
The initial goal was to separate out answers from the userInput, but iFrame is a unique widget in that the answers aren't actually contained in what is sent to the scoring function. Scoring happens via the iFrame, and the scoring function is told if the user is correct, incorrect, and incomplete. Additionally, validation happens after both types of scoring, so it most likely will not be possible to have a validation function for this widget either.

Question:
Would it be useful to change what the `scoreIframe` parameter is called as it is not actually the user's input, but a summary of the results of checking the user's input? We could revert the argument back to `state` or maybe `results`, but then would we change the type name? I wonder if that would be confusing down the road, but we do have comments explaining it somewhat.

Issue: LEMS-2440

## Test plan:
- Confirm all checks pass
- Confirm widget still works as expected via a ZND (iframe tends not to be testable locally)

Author: Myranae

Reviewers: Myranae, jeremywiebe, handeyeco

Required Reviewers:

Approved By: jeremywiebe, handeyeco

Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ⏹️  [cancelled] Publish npm snapshot (ubuntu-latest, 20.x), ⏹️  [cancelled] Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ⏹️  [cancelled] Check builds for changes in size (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ⏹️  [cancelled] Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ⏹️  [cancelled] Cypress (ubuntu-latest, 20.x)

Pull Request URL: #1996
  • Loading branch information
Myranae authored Dec 17, 2024
1 parent 0464a76 commit b6623bb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-ghosts-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": patch
---

Remove unused iframe rubric type
4 changes: 0 additions & 4 deletions packages/perseus/src/validation.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ export type PerseusGrapherRubric = {

export type PerseusGrapherUserInput = PerseusGrapherRubric["correct"];

// TODO(LEMS-2440): Can possibly be removed during 2440; only userInput used
export type PerseusIFrameRubric = Empty;

export type PerseusIFrameUserInput = {
status: UserInputStatus;
message: string | null;
Expand Down Expand Up @@ -238,7 +235,6 @@ export type Rubric =
| PerseusGradedGroupRubric
| PerseusGradedGroupSetRubric
| PerseusGrapherRubric
| PerseusIFrameRubric
| PerseusInputNumberRubric
| PerseusInteractiveGraphRubric
| PerseusLabelImageRubric
Expand Down
3 changes: 1 addition & 2 deletions packages/perseus/src/widgets/iframe/iframe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {scoreIframe} from "./score-iframe";
import type {PerseusIFrameWidgetOptions} from "../../perseus-types";
import type {WidgetExports, WidgetProps, Widget} from "../../types";
import type {
PerseusIFrameRubric,
PerseusIFrameUserInput,
UserInputStatus,
} from "../../validation.types";
Expand All @@ -36,7 +35,7 @@ type RenderProps = PerseusIFrameWidgetOptions & {
height: string;
};

type Props = WidgetProps<RenderProps, PerseusIFrameRubric>;
type Props = WidgetProps<RenderProps>;

type DefaultProps = {
status: Props["status"];
Expand Down

0 comments on commit b6623bb

Please sign in to comment.