You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hints: fix hints type on PerseusItem to be correct (#1489)
## Summary:
Our `hints` type on `ItemRenderer` used the `PerseusRenderer` type. That's mostly correct, except that a Hint can also have the `replace` key.
Issue: "none"
## Test plan:
`yarn typecheck` ✅
Author: jeremywiebe
Reviewers: jeremywiebe, benchristel
Required Reviewers:
Approved By: benchristel
Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Jest Coverage (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), ✅ Cypress (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: #1489
Copy file name to clipboardExpand all lines: packages/perseus/src/perseus-types.ts
+10-3
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ export type PerseusItem = {
87
87
// The details of the question being asked to the user.
88
88
question: PerseusRenderer;
89
89
// A collection of hints to be offered to the user that support answering the question.
90
-
hints: ReadonlyArray<PerseusRenderer>;
90
+
hints: ReadonlyArray<Hint>;
91
91
// Details about the tools the user might need to answer the question
92
92
answerArea: PerseusAnswerArea|null|undefined;
93
93
// Multi-item should only show up in Test Prep content and it is a variant of a PerseusItem
@@ -116,8 +116,6 @@ export type PerseusRenderer = {
116
116
content: string;
117
117
// A dictionary of {[widgetName]: Widget} to be referenced from the content field
118
118
widgets: PerseusWidgetsMap;
119
-
// Used only for PerseusItem.hints. If true, it replaces the previous hint in the list with the current one. This allows for hints that build upon each other.
120
-
replace?: boolean;
121
119
// Used in the PerseusGradedGroup widget. A list of "tags" that are keys that represent other content in the system. Not rendered to the user.
122
120
// NOTE: perseus_data.go says this is required even though it isn't necessary.
123
121
metadata?: ReadonlyArray<string>;
@@ -127,6 +125,15 @@ export type PerseusRenderer = {
127
125
};
128
126
};
129
127
128
+
exporttypeHint=PerseusRenderer&{
129
+
/**
130
+
* When `true`, causes the previous hint to be replaced with this hint when
131
+
* displayed. When `false`, the previous hint remains visible when this one
132
+
* is displayed. This allows for hints that build upon each other.
"In conclusion, the vertex of the parabola is at\n\n$(3,-8)$\n\nand the zeros are\n\n$(5,0)$ and $(1,0)$\n\nIn order to graph, we need the vertex and another point. That other point can be one of the zeros we found, like $(1,0)$:\n\n[[☃ grapher 1]]",
"###The answer\n\nWe found that the graph of $y=-4\\cos\\left(x\\right)+3$ has a minimum point at $(0,-1)$ and then intersects its midline at $\\left(\\dfrac{1}{2}\\pi,3\\right)$.\n\n[[☃ grapher 3]]\n ",
0 commit comments