-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spike: swap input-number with numeric-input 😈
- Loading branch information
1 parent
e05504d
commit 63e4cac
Showing
34 changed files
with
1,135 additions
and
1,103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@khanacademy/perseus": minor | ||
--- | ||
|
||
Configure Perseus to render numeric-input widgets in place of input-number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 18 additions & 11 deletions
29
packages/perseus-editor/src/__testdata__/input-number_testdata.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
// @flow | ||
import type {PerseusRenderer, InputNumberWidget} from "@khanacademy/perseus"; | ||
import type {PerseusRenderer, NumericInputWidget} from "@khanacademy/perseus"; | ||
|
||
export const question1: PerseusRenderer = { | ||
content: | ||
"A sequence is defined recursively as follows:\n\n\n$\\qquad\\displaystyle{{a}_{n}}=-\\frac{1}{a_{n-1}-1} \n~~~~~~\\text{ with}\\qquad\\displaystyle{{a}_{0}}=\\frac{1}{2}\\,$\n\n\nFind the term $a_3$ in the sequence.\n\n[[\u2603 input-number 1]]", | ||
content: "$5008 \\div 4 =$ [[\u2603 numeric-input 1]] ", | ||
images: {}, | ||
widgets: { | ||
"input-number 1": ({ | ||
"numeric-input 1": ({ | ||
graded: true, | ||
version: { | ||
major: 0, | ||
minor: 0, | ||
}, | ||
static: false, | ||
type: "input-number", | ||
type: "numeric-input", | ||
options: { | ||
maxError: 0.1, | ||
inexact: false, | ||
value: 0.5, | ||
simplify: "required", | ||
answerType: "number", | ||
coefficient: false, | ||
static: false, | ||
answers: [ | ||
{ | ||
status: "correct", | ||
maxError: null, | ||
strict: false, | ||
value: 1252, | ||
simplify: "required", | ||
message: "", | ||
}, | ||
], | ||
labelText: "", | ||
size: "normal", | ||
}, | ||
alignment: "default", | ||
}: InputNumberWidget), | ||
}: NumericInputWidget), | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.