@khanacademy/perseus-core 0.0.0-PR2931-20250929193309 → 0.0.0-PR2946-20251002221300
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/index.js +2 -2
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/es/index.js
CHANGED
|
@@ -227,7 +227,7 @@ const parseUserInputMap=(rawValue,ctx)=>{if(!isPlainObject(rawValue)){return ctx
|
|
|
227
227
|
|
|
228
228
|
function parsePerseusItem(json){if(isRealJSONParse(JSON.parse)){return JSON.parse(json)}throw new Error("Something went wrong.")}function parseAndMigratePerseusItem(data){throwErrorIfCheatingDetected();const object=typeof data==="string"?JSON.parse(data):data;const result=parse(object,parsePerseusItem$1);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function parseAndMigratePerseusArticle(data){throwErrorIfCheatingDetected();const object=typeof data==="string"?JSON.parse(data):data;const result=parse(object,parsePerseusArticle);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function parseAndMigrateUserInputMap(data){const object=typeof data==="string"?JSON.parse(data):data;const result=parse(object,parseUserInputMap);if(isFailure(result)){return failure({message:result.detail,invalidObject:object})}return result}function throwErrorIfCheatingDetected(){if(!isRealJSONParse(JSON.parse)){throw new Error("Something went wrong.")}}
|
|
229
229
|
|
|
230
|
-
const libName="@khanacademy/perseus-core";const libVersion="19.
|
|
230
|
+
const libName="@khanacademy/perseus-core";const libVersion="19.4.0";addLibraryVersionToPerseusDebug(libName,libVersion);
|
|
231
231
|
|
|
232
232
|
const Errors=Object.freeze({Unknown:"Unknown",Internal:"Internal",InvalidInput:"InvalidInput",NotAllowed:"NotAllowed",TransientService:"TransientService",Service:"Service"});
|
|
233
233
|
|
|
@@ -335,7 +335,7 @@ const defaultWidgetOptions$5={programID:"",height:400};const pythonProgramWidget
|
|
|
335
335
|
|
|
336
336
|
function getRadioChoicePublicData(choice){const{id,content,isNoneOfTheAbove}=choice;return {id,content,isNoneOfTheAbove}}function usesNumCorrect(multipleSelect,countChoices,numCorrect){return multipleSelect&&countChoices&&numCorrect}function getRadioPublicWidgetOptions(options){const{numCorrect,choices,multipleSelect,countChoices}=options;return {...options,numCorrect:usesNumCorrect(multipleSelect,countChoices,numCorrect)?numCorrect:undefined,choices:choices.map(getRadioChoicePublicData)}}
|
|
337
337
|
|
|
338
|
-
const currentVersion={major:
|
|
338
|
+
const currentVersion={major:3,minor:0};const defaultWidgetOptions$4={choices:[{content:"",id:"radio-choice-0"},{content:"",id:"radio-choice-1"},{content:"",id:"radio-choice-2"},{content:"",id:"radio-choice-3"}],randomize:false,hasNoneOfTheAbove:false,multipleSelect:false,countChoices:false,deselectEnabled:false};const radioWidgetLogic={name:"radio",version:currentVersion,defaultWidgetOptions:defaultWidgetOptions$4,getPublicWidgetOptions:getRadioPublicWidgetOptions,accessible:true};
|
|
339
339
|
|
|
340
340
|
function getSorterPublicWidgetOptions(options){return {...options,correct:sortAllButFirst(options.correct)}}function shuffleSorter(options,problemNum){const{correct}=options;const rng=seededRNG(problemNum??0);return shuffleDisplacingFirst(correct,rng)}function sortAllButFirst([first,...rest]){return [first,...rest.sort()]}function shuffleDisplacingFirst(array,rng){function isFirstElementDisplaced(shuffled){return shuffled[0]!==array[0]}return constrainedShuffle(array,rng,isFirstElementDisplaced)}
|
|
341
341
|
|