Skip to content

Commit

Permalink
PhET widget: remove simpleValidate (#1578)
Browse files Browse the repository at this point in the history
## Summary:
Remove `simpleValidate()` from the PhET widget because it is a non-answerable widget.
* Because widgets without a `simpleValidate()` are handled correctly by our grading infrastructure (they are simply not graded), as per Jeremy's suggestion, we will remove the function from PhET!
* Also resolves `TypeError: JE.validate is not a function` error on PhET simulation content

Issue: LEMS-2287

## Test plan:
* `yarn jest packages/perseus/src/widgets/__tests__/phet-simulation.test.ts`
* `yarn jest packages/perseus-editor/src/widgets/__tests__/phet-simulation-editor.test.tsx`
* Verify that the widget and editor still show up in Storybook
* Verify that the widget shows up and remains ungraded on [Test Everything](https://www.khanacademy.org/internal-courses/test-everything/test-everything-1/x6df8cbb5b9ebc9c6:phet-simulation/e/projectile-data-lab)

Author: aemandine

Reviewers: jeremywiebe

Required Reviewers:

Approved By: jeremywiebe

Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Check builds for changes in size (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, ⏭️  Upload Coverage, ✅ Publish npm snapshot (ubuntu-latest, 20.x), ❌ Jest Coverage (ubuntu-latest, 20.x), ✅ 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), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald

Pull Request URL: #1578
  • Loading branch information
aemandine authored Sep 3, 2024
1 parent a3e8fce commit 78bb857
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-colts-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": patch
---

Remove simpleValidate from PhET widget
5 changes: 0 additions & 5 deletions packages/perseus/src/widgets/phet-simulation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ export class PhetSimulation extends React.Component<Props, State> {
return Changeable.change.apply(this, args);
};

simpleValidate: (arg1: any) => any = (rubric) => {
// @ts-expect-error - TS2339 - Property 'validate' does not exist on type 'typeof PhetSimulation'.
return PhetSimulation.validate(this.getUserInput(), rubric);
};

// kaLocales and PhET locales use different formats and abbreviations.
// PhET accepts different formats, i.e. kaLocale's hyphens, but it does not accept
// different abbreviations, so in points of divergence of abbreviations, we need to
Expand Down

0 comments on commit 78bb857

Please sign in to comment.