Skip to content

Commit

Permalink
number-line
Browse files Browse the repository at this point in the history
  • Loading branch information
handeyeco committed Jan 15, 2025
1 parent bd6b1da commit 9ffb7db
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/perseus-score/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export {default as scoreCategorizer} from "./widgets/categorizer/score-categoriz
export {default as scoreCSProgram} from "./widgets/cs-program/score-cs-program";
export {default as scoreDropdown} from "./widgets/dropdown/score-dropdown";
export {default as scoreIframe} from "./widgets/iframe/score-iframe";
export {default as scoreNumberLine} from "./widgets/number-line/score-number-line";
export {default as scoreNumericInput} from "./widgets/numeric-input/score-numeric-input";
export {default as scoreRadio} from "./widgets/radio/score-radio";
export {default as scoreTable} from "./widgets/table/score-table";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import scoreNumberLine from "./score-number-line";
import type {
PerseusNumberLineScoringData,
PerseusNumberLineUserInput,
} from "@khanacademy/perseus-score";
} from "../../validation.types";

describe("scoreNumberLine", () => {
it("is invalid when end state is the same as beginning state", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {number as knumber} from "@khanacademy/kmath";
import validateNumberLine from "./validate-number-line";

import type {
PerseusScore,
PerseusNumberLineScoringData,
PerseusNumberLineUserInput,
} from "@khanacademy/perseus-score";
PerseusScore,
} from "../../validation.types";

function scoreNumberLine(
userInput: PerseusNumberLineUserInput,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import validateNumberLine from "./validate-number-line";

import type {PerseusNumberLineUserInput} from "@khanacademy/perseus-score";
import type {PerseusNumberLineUserInput} from "../../validation.types";

describe("validateNumberLine", () => {
it("is invalid when outside allowed range", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {
PerseusScore,
PerseusNumberLineUserInput,
} from "@khanacademy/perseus-score";
PerseusScore,
} from "../../validation.types";

/**
* Checks user input is within the allowed range and not the same as the initial
Expand Down
7 changes: 4 additions & 3 deletions packages/perseus/src/widgets/number-line/number-line.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import {number as knumber, KhanMath} from "@khanacademy/kmath";
import {
scoreNumberLine,
type PerseusNumberLineUserInput,
} from "@khanacademy/perseus-score";
import * as React from "react";
import ReactDOM from "react-dom";
import _ from "underscore";
Expand All @@ -13,13 +17,10 @@ import {ApiOptions} from "../../perseus-api";
import KhanColors from "../../util/colors";
import {getPromptJSON as _getPromptJSON} from "../../widget-ai-utils/number-line/number-line-ai-utils";

import scoreNumberLine from "./score-number-line";

import type {ChangeableProps} from "../../mixins/changeable";
import type {APIOptions, WidgetExports, FocusPath, Widget} from "../../types";
import type {NumberLinePromptJSON} from "../../widget-ai-utils/number-line/number-line-ai-utils";
import type {Relationship} from "@khanacademy/perseus-core";
import type {PerseusNumberLineUserInput} from "@khanacademy/perseus-score";

// @ts-expect-error - TS2339 - Property 'MovablePoint' does not exist on type 'typeof Graphie'.
const MovablePoint = Graphie.MovablePoint;
Expand Down

0 comments on commit 9ffb7db

Please sign in to comment.