GibbonEdu / core

Gibbon is a flexible, open source school management platform designed to make life better for teachers, students, parents and leaders.
https://gibbonedu.org
GNU General Public License v3.0
482 stars 306 forks source link

Bug: Planner time slots stop auto-filling #1639

Closed fvlasie closed 2 years ago

fvlasie commented 2 years ago

Describe the Bug

When adding lesson plans to the planner, usually the page will advance to the next available time slot. This stops working after adding several lesson plans into the future. In my case, entering lesson 1 through 10 automatically added the proper time slot and day. Every lesson I add after that will not have the time and day prefilled for the next timeslot after clicking Submit.

To Reproduce

Go to Planner Choose a class Add a lesson Click Submit Add a lesson Click Submit repeat until the time and day fields are no longer prefilled

Expected behavior

Time and day fields should always be prefilled as long as the term is not exhausted.

Actual behavior

Time and day fields stop prefilling.

Screenshots

No response

Gibbon version

25

Browser

Safari

Browser Version

16

Additional Context

PHP 8

yookoala commented 2 years ago

Hi @fvlasie. I'm not very familiar with the actual operation of Gibbon. I tried to follow your steps. But I have trouble following the steps.

  1. I installed locally with demo data. Then I manually created the course and class to test with.

  2. Then I go to "Learn" > "Planner" in the top menu. Screenshot from 2022-09-15 17-32-20

  3. Problem: There is no place to "Choose a class". Screenshot from 2022-09-15 17-26-23

  4. I proceed to create a new Lesson Plan by clicking on the "New" button on top. Screenshot from 2022-09-15 17-27-59

  5. After creating a new Lesson Plan, I'm staying on the same page without anything filled in. Is this the problematic behaviour you mentioned? Screenshot from 2022-09-15 17-30-01

fvlasie commented 2 years ago

Choose a class is the menu on the left:

Screenshot 2022-09-15 at 12 29 23 PM
fvlasie commented 2 years ago

You have to have a class that is tied to the timetable. This requires quite a bit of setup so I recommend using the demo data.

SKuipers commented 2 years ago

Hi FV, I've checked out the code and it looks like this is by design. It will look up to ten lessons into the future to check for upcoming dates when you click the add button, all based on the current date. Checking every possible lesson would add quite the overhead to this script. This check will happen if you click "Add" from the planner, and I suspect is helpful for planning upcoming lessons and ad-hoc planning.

If teachers are planning a whole year or whole unit in advance, the Year Overview link from the Planner is more helpful, as it shows all upcoming lessons at a glance, and there is a plus button to add a lesson for that date. Teachers can also access the Add button from their timetable, which is a nice visual way to see and add lesson plans.

fvlasie commented 2 years ago

Could it look ten lessons into the future from the current lesson position so the calculation is still limited but moves forward with the user? (I have had complaints about this from other users too.)

SKuipers commented 2 years ago

Hi @fvlasie, sure, I can see the utility value of that change. I've updated it for v25 to look for the most recent lesson and suggest the date for the next lesson in sequence, falling back to the current date if the lesson planner is empty. You can see and test out the change here: https://github.com/GibbonEdu/core/commit/402b7428ace02795c71bacd40edc64d7384ee798

fvlasie commented 2 years ago

Thank you Sandra!