liavt / Scheduler

Scheduler for school.
https://liavt.github.io/Scheduler
MIT License
1 stars 1 forks source link

Multi-grade level support #10

Closed liavt closed 8 years ago

liavt commented 8 years ago

Mrs. Hirsh has asked to make this compatible with 10th graders. This means there are 2 separate control panel spreadsheets. We need to find a way to 1. figure out which grade the user is 2. get the correct schedule from the correct grade

PoisonNinja commented 8 years ago

Can we not build a customized spreadsheet? Create a new spreadsheet and update the remote URL. I would prefer to not mix the two grades together.

liavt commented 8 years ago

But then we need 2 different versions of the code, which is annoying

liavt commented 8 years ago

I have an idea. We add another user property that represents grade, and based on that, it chooses the control panel.

liavt commented 8 years ago

To figure out grade, we can do 3 things:

  1. Ask the user for grade (probably easiest)
  2. Figure out their grade by their name by comparing it against both spreadsheets
  3. 2 separate spreadsheets that have a different grade number hard coded

But before we can start on anything, we need to get the roster for the second years to test.

PoisonNinja commented 8 years ago

I think it would be easier to ask them only for their name, and then we can figure out what grade they're in. I agree that we should ask them before loading the spreadsheet though.

liavt commented 8 years ago

But we should also create a debug spreadsheet, program, and branch to test this.

PoisonNinja commented 8 years ago

I did create a test spreadsheet. See the link in Issue #11, or in "Shared with me" on Google Drive.

PoisonNinja commented 8 years ago

@liavt do you have a copy of the control panel?

liavt commented 8 years ago

Adding one now to the folder

liavt commented 8 years ago

https://docs.google.com/spreadsheets/d/1Yk2b9Ha0msdyD7h-D0yh0ZiXPoKgODrrWLHWbx4noLo/edit#gid=0

PoisonNinja commented 8 years ago

Changes have been merged in. I think we are ready to go live with this.

PoisonNinja commented 8 years ago

@liavt I'm trying to figure out a way to present a menu, but the menu always gets overwritten by the next message. Any ideas?

liavt commented 8 years ago

Sorry I didn't respond. I was out of town. But about the overwriting, can you possibly show me where this is happening?

PoisonNinja commented 8 years ago

I already reverted that, since it was broken, but here's a summary of what happened.

I tried doing a while loop that blocked until the valid grade variable was set to true, but that just froze the entire script.

PoisonNinja commented 8 years ago

To test, try the code from here. grade.html already exists in the test script, so just paste in the code and go. You'll see what I mean.

liavt commented 8 years ago

Make another user variable called "init" which is set to true after their grade is set. If init is false or null, checkVersion() doesn't do anything

PoisonNinja commented 8 years ago

That causes the entire script to terminate, which means that you need to refresh in order for it to continue and ask you for your name.

PoisonNinja commented 8 years ago

I think this is ready to go. The menu is something we can work on later, but it's not very important. When deploying this, make sure to update the link to the 10th grade control panel in the getGradeSpreadsheet() function.