-
Notifications
You must be signed in to change notification settings - Fork 357
Proof-of-concept: Use the object path as the ID of radio choices #2664
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
base: main
Are you sure you want to change the base?
Conversation
Size Change: +144 B (+0.03%) Total Size: 496 kB
ℹ️ View Unchanged
|
@@ -75,6 +75,7 @@ const parseRadioWidgetV2 = parseWidgetWithVersion( | |||
isNoneOfTheAbove: optional(boolean), | |||
// deprecated | |||
widgets: parseWidgetsMapOrUndefined, | |||
id: defaulted(string, (_, ctx) => ctx.getPath().join(".")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to be totally sure the path is unique, we could use formatPath
from object-path.ts
here.
Closing this PR because I don't think we're going to go this route for assigning IDs to choices. |
🗄️ Schema Change: Changes Detected
|
🛠️ Item Splitting: Changes Detected
|
…r version and update snapshots
33bb9f0
to
5233d5c
Compare
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (c9db91a) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR2664 If you are working in Khan Academy's frontend, you can run the below command. ./dev/tools/bump_perseus_version.ts -t PR2664 If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -t PR2664 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anakaren-rojas this commit has the relevant change: 7daa1ae
content: choice.content, | ||
rationale: choice.clue, | ||
correct: choice.correct, | ||
isNoneOfTheAbove: choice.isNoneOfTheAbove, | ||
id: [...ctx.getPath(), "options", "choices", i].join("."), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh interesting, I tried getting access to the path here but got stuck on the implementation
Issue: none
Test plan:
TODO