Skip to content

Instantly share code, notes, and snippets.

@meekg33k
Last active March 21, 2021 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meekg33k/1a6adb6a193b7b0430cb40172eae0f64 to your computer and use it in GitHub Desktop.
Save meekg33k/1a6adb6a193b7b0430cb40172eae0f64 to your computer and use it in GitHub Desktop.
Flattened tree hierarchy for learning content schema
{
byId: {
'entity-id': {
//Any of Class, Subject, Module or any other entity
}
},
subjects: {
byClass: {
'class-id-1': ['class-id-1-subject-id-1', 'class-id-1-subject-id-2',...],
'class-id-2': ['class-id-2-subject-id-1', 'class-id-2-subject-id-2',...],
}
},
modules: {
byClass: {
'class-id-1': ['class-id-1-module-id-1', 'class-id-1-module-id-2',...],
'class-id-2': ['class-id-2-module-id-1', 'class-id-2-module-id-2',...],
}
bySubject: {
'subject-id-1': ['subject-id-1-module-id-1', 'subject-id-1-module-id-2',...],
'subject-id-2': ['subject-id-2-module-id-1', 'subject-id-2-module-id-2',...],
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment