Skip to content
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

Updating the objective-skill parent-child relationship is brittle, needs more logging #177

Open
normanbier opened this issue Jul 2, 2023 · 0 comments

Comments

@normanbier
Copy link

normanbier commented Jul 2, 2023

When attempting to convert a spreadsheet skills map, convert.ts can encounter values that break the conversion. These values in the spreadsheet are potentially mistakes and human correctable, but convert.ts does not provide enough context to locate the issue.

For example, in the attached spreadsheet, the issue is an extra space at the end of skill id (tab: LOs, cell 15:F). But the error message:

/Users/nbier/dev/torus_convert/course-digest/src/convert.ts:180
  m.objectives.forEach((a: Magic.SpreadsheetObjective) => {
               ^
TypeError: Cannot read properties of undefined (reading 'id')
    at /Users/nbier/dev/torus_convert/course-digest/src/convert.ts:188:30
    at Array.map (<anonymous>)
    at /Users/nbier/dev/torus_convert/course-digest/src/convert.ts:187:41
    at Array.forEach (<anonymous>)
    at applyMagic (/Users/nbier/dev/torus_convert/course-digest/src/convert.ts:180:16)
    at Object.applyMagicSpreadsheet (/Users/nbier/dev/torus_convert/course-digest/src/convert.ts:60:12)
    at /Users/nbier/dev/torus_convert/course-digest/src/index.ts:241:31
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

does not provide enough context for me to track down and correct the problem. I finally threw in some really ugly logging into convert.ts at line 181:

 console.log(
     `info: attempting to update the objective-skill parent-child realtionship for  ${JSON.stringify(byObjectiveId[a.id])}`
    );

that helped me tracked down the issue, but it was painful. Suggest additional logging/reporting on errors so that users can see what LO/Skill/Problem was being worked on at the time that the script breaks.

chem2_new.xlsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant