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

[Feature] Client Validation #2031

Merged
merged 19 commits into from
Jan 23, 2025
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
99cd254
Swap out deprecated input-number with numeric-input in some tests (#1…
jeremywiebe Dec 13, 2024
0db68d2
SSS: Hook emptyWidgets() up to validation functions (#2000)
jeremywiebe Dec 14, 2024
193d913
Add test to document empty expression can be a correct answer (#2003)
jeremywiebe Dec 16, 2024
0464a76
Remove unused rubric type for CS Program (#1997)
Myranae Dec 17, 2024
b6623bb
Remove unused rubric type for iFrame (#1996)
Myranae Dec 17, 2024
0f2bec3
Refactor LabelImage to separate out answers from userInput into scori…
Myranae Dec 17, 2024
55ad836
Label-image: Extract validation out of scoring (#2016)
Myranae Dec 18, 2024
879d2a5
Rename usages of rubric to scoringData (#2006)
Myranae Dec 18, 2024
e6f7cc9
Fix some naming discrepancies and simplify Matcher scoring type (#2038)
Myranae Dec 19, 2024
a1e22a4
SSS: Improve types for validation (#2002)
jeremywiebe Dec 20, 2024
a423410
Merge branch 'main' into feature/client-validation
Myranae Dec 20, 2024
9c3e02e
Merge branch 'main' into feature/client-validation
jeremywiebe Jan 7, 2025
0a4163a
Merge branch 'main' into feature/client-validation
jeremywiebe Jan 7, 2025
5f79a67
Merge branch 'main' into feature/client-validation
jeremywiebe Jan 15, 2025
1a75ca6
[Client Validation] Fixes after merging main (#2122)
jeremywiebe Jan 21, 2025
4c10af1
[Client Validation] Use emptyWidgetsFunctional in scoring (#2083)
jeremywiebe Jan 21, 2025
39da8f0
Merge branch 'main' into feature/client-validation
jeremywiebe Jan 21, 2025
1105fa5
Remove unused parameter in `validateMatrix`
jeremywiebe Jan 21, 2025
cd0e130
Merge branch 'main' into feature/client-validation
jeremywiebe Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unused rubric type for iFrame (#1996)
## 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
Myranae authored Dec 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit b6623bb569c8776ad5bf4e770789e4b079e230e0
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
@@ -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;
@@ -238,7 +235,6 @@ export type Rubric =
| PerseusGradedGroupRubric
| PerseusGradedGroupSetRubric
| PerseusGrapherRubric
| PerseusIFrameRubric
| PerseusInputNumberRubric
| PerseusInteractiveGraphRubric
| PerseusLabelImageRubric
3 changes: 1 addition & 2 deletions packages/perseus/src/widgets/iframe/iframe.tsx
Original file line number Diff line number Diff line change
@@ -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";
@@ -36,7 +35,7 @@ type RenderProps = PerseusIFrameWidgetOptions & {
height: string;
};

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

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