pie-framework / pie-elements

A collection of pies for rendering interactions in an assessment environment
http://pie-website.surge.sh
ISC License
0 stars 7 forks source link

fix(passage): fix print not working PD-4148 #2186

Closed PatriciaRomaniuc closed 1 month ago

PatriciaRomaniuc commented 2 months ago

https://illuminate.atlassian.net/browse/PD-4148

andreeapescar commented 2 months ago

I had to manually release a version for this fix from my local machine, on the version they're using.

Here's the code that I wrote: `const preparePrintPassage = (model, opts) => { const isInstructor = opts.role === 'instructor'; const teacherInstructionsEnabled = model.teacherInstructionsEnabled || model.teacherInstructionsEnabled === undefined || model.teacherInstructionsEnabled === null; const textEnabled = model.textEnabled || model.textEnabled === undefined || model.textEnabled === null;

return model.passages.map((passage, index) => ({ id: index, teacherInstructions: teacherInstructionsEnabled ? (isInstructor && passage.teacherInstructions) || '' : '', label: passage.title || Passage ${index + 1}, title: model.titleEnabled ? passage.title || '' : '', author: model.authorEnabled ? passage.author || '' : '', subtitle: model.subtitleEnabled ? passage.subtitle || '' : '', text: textEnabled ? passage.text || '' : '', })); }; `

andreeapescar commented 2 months ago

https://www.npmjs.com/package/@pie-element/passage/v/2.21.7-beta.0