Similar to zyBooks if you are familiar with it, I want to track the sections the user has read through and checked completed with a button.
However, conceptually I am having trouble thinking of what to store in my mongo database, besides just an object or an array of objects that contains each section and bool values, to track their progress. A section will have around 10 subsections. But there will be around 8 sections total. So a total of 80 subsections to keep track of.
This is what I was thinking of but it seems inefficient.
const sectionArray = [
{
section: "1",
completed: false,
subsections: [
{
name: "1.1",
completed: false,
},
{
name: "1.2",
completed: false,
},
{
name: "1.3",
completed: false,
},
],
},
{
section: "2",
completed: false,
subsections: [
{
name: "2.1",
completed: false,
},
{
name: "2.2",
completed: false,
},
{
name: "2.3",
completed: false,
},
],
},
...
];
I will also display a section and its subsections content depending on which the user decides to view using react and material ui.
I do not want to commit to my method if there is a better alternative.