Feature Proposal: Export/Import Teacher Not Available Times as CSV

Started by TongThanhKieu, September 01, 2025, 02:29:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TongThanhKieu

Dear Liviu,

First of all, thank you very much for your continuous work on FET. It is an outstanding timetabling tool that has been extremely useful for schools worldwide.

I would like to propose a new feature for your consideration:

Feature Request:
In the Time → All time constraints tab, please add two new buttons:

Export: to extract all existing "Teacher not available times" constraints into a CSV file (UTF-8 encoded).

Import: to load such constraints back into FET from a previously exported CSV (UTF-8).

Motivation / Use Case:

Many schools frequently update teacher unavailability data. Having an export/import mechanism would make it much easier to back up constraints, share them between different FET files, or update them in bulk using external tools like Excel.

Currently, this process requires manual editing or re-entering the constraints, which is time-consuming and prone to human error.

A standardized CSV (UTF-8) format would ensure compatibility and avoid encoding issues.

Possible Implementation Idea:

The CSV structure could follow a simple format with teacher ID/name, day, and time slots.

The Export button would write all constraints into a CSV file.

The Import button would parse a CSV file and add/update the corresponding constraints in the FET project.

I believe this feature would significantly improve usability for schools with large numbers of teachers and frequent schedule updates.

Thank you again for your dedication and for considering this suggestion.

Best regards,

Volker Dirr

the "add/update" part might be critical.
I think the "easiest" variant will be "if there is a single new not available time slot, then delete all values of the constraint and place the new ones".
Because if you don't do it that way and if you want to keep the old values, then it mean you also need a variant how to remove old values.

Liviu Lalescu

Dear TongThanh,

Thank you for your kind words!

I wrote down your suggestion.

Volker Dirr

I just got again a request by email for this feature.

hmmm... still the question how to write it.

There are different variants for this with different advantages/disadvantages.

Variant 1:
teacher name, weight, day, hour
"Tom", 100, "Monday", "1st"
"Tom", 100, "Monday", "2nd"
...

This is valid csv. A bit tricky will be the detection if this is only one constraint or more. Might not 100% valid without more information, but i think a good automatic algorithm will care about this in most situations fine without more information.


Variant 2:
teacher name, weight, day, hour, day, hour, ...
"Tom", 100, "Monday", "1st", "Monday", "2nd"
...

This is NOT valid csv. It doesn't has got the disadvantage of variant 1, but in fact this is not valid, since the number of columns is not fixed.



Variant 3:
teacher name, weight, day-hour-pairs
"Tom", 100, "Monday|1st|Monday|2nd"
...

This is valid csv if you check the header. But in fact it is a bit "bad", since it needs at least one more character to split the day and hour names.


So if anyone need a constraint like this: What do you think should we code? Variant 1,2 or 3. Please let me know why do you think these Variants are fine or bad. Maybe you know a better csv variant?

Volker Dirr

Or Variant 4:
teacher name, weight, Monday-1, Monday-2, Monday-3, ...
"Tom", 100, x, x, , ,

I guess this has the advantage that there is a nice matrix for editing in a sheet software.
The disadvantage is that need to read the header carefully and it must fit more or less (depending on how i code it) to day and hour names in FET.
So there might be problems like: What to do if there are more or less days/hours in fet?

Steffen Schiedek

Hi,
I would maybe propose more of a table style with each lesson of the day as a column and each day a row. Best solution could than be the weight of each lesson in this "table" - putting a weight of 0 for "teacher is available". So:

teacher name, day, weight_1st_lesson, weight_2nd_lesson, ..., comments
"Tom", "Monday", 100, 100, 0, 0, 90, 90, 0, 0, ..., comments
"Tom", "Tuesday", 0, 0, 0, 0, 0, 0, 0, 0, ..., comments
"Tom", "Wednesday", 100, 100, 100, 100, 100, 100, 100, 100, ..., comments
"Tom", ...

Advantages:
The "table style" should be easy to view/understand/edit and allows for different weights throughout the week (which allows variations of "teacher is available", "teacher is truly 100% not available Monday 1st/2nd" and "teacher whishes rather not to be available Monday 5th/6th, but could be as it is only a wish").
The number of columns is fixed and can be checked for matching the number of lessons a day before importing, the number of rows for a teacher can be checked for matching the number of days.
Comments can be added/imported/exported, for example for writing the date the restriction was put - this way maybe a check could be made for existing not available times before/while importing (i.e. "do you really want to import times for "Tom"? There are times with comments "01.04.2026" in this file.")
Disadvantages:
Easy viewing of the individual weights of each lesson does not equal easy collecting into a restriction of the same weight for each teacher. :-(

Would it maybe be possible to also export/import the other ("easier") restrictions of each teacher (max days per week, min days per week, a teacher does not work two consecutive days, ..., min resting hours for a teacher) as well? Those I also collect from my teachers before starting to build a timetable.
That could/would just be
teacher name, weight, name of restriction, value of restriction

Thanks a lot to all of you for working/thinking/living FET!

Regards,

Steffen

Liviu Lalescu

Thank you for your kind words, Steffen!

Note that teacher not available can have only 100% weight; I did this because the gaps are not counted, and I need to have something constant to not count gaps. If you want <100%, you need to add activities preferred time slots for this teacher.

Steffen Schiedek

Uups - that I did oversee. But that could be the perfect import: If the weight is below 100%, than fill the "a set of activities has a set of preferred time slots" with only this teacher selected and the given weight?

Liviu Lalescu


Volker Dirr

Ah... Sorry. I was the guy who added the weight "wrong".

hmm...
Also a variant.
The small problem might be if you write different comments in different rows. In that case I need to a) add a second constraint or b) merge the comments.

Of course stuff like that could be done with every constraint, but it will be a lot of work to code it.

Volker Dirr

About the use of the comments:
I think the comment should just be added as comment.

Asking/checking for special comments if it should be imported or not is, in my opinion, not good, since you also get problems with only want to modify 1st hour, but not 2nd hour.

In my opinion before importing such a csv file, we can max. ask for 3 situations:
a) keep old data and also add the new data from csv
b) delete all old constraints of that type (and import the new data)
c) only delete constraint of teachers that are in the csb file (and import all other data in the file and also keep the data of teachers that are not mention in the csv file)