FET Forum

FET Support (English) => Programming Help => Topic started by: castonepatha on January 20, 2023, 07:10:19 PM

Title: ID of activities in HTML
Post by: castonepatha on January 20, 2023, 07:10:19 PM
Hi, I'm new here and I hope you can give me some advice. It would help us a lot at school if we could display the ID of the activity in the html page of the schedule. Can you help me? Thanks.
Title: Re: ID of activities in HTML
Post by: Liviu Lalescu on January 20, 2023, 07:23:20 PM
Hello, and welcome to the forum!

Of course this can be done. The code to be modified should be in src/engine/timetableexport.cpp -- unfortunately it was done by Volker and I am not so well accustomed to it, but I think I can manage, if he cannot help.

In what HTML timetables would you like to see the ID-s of the activities?

Would you like only the exact instructions to modify the code, the modified code, or the executable (for what platform?)?
Title: Re: ID of activities in HTML
Post by: castonepatha on January 20, 2023, 07:37:43 PM
Thank you for very fast response.  :) I'm using linux version in most cases. I'm able to compile FET app from source but not sure what to change now. It will be nice to see it everywhere.

I'm just going through it briefly and trying to understand the code. I created my first schedule in this software and I'm amazed at what an excellent tool it is. This function is important for us for checking and other corrections in the schedule. It may not be in the final version, but at least it would help us a lot when creating the schedule. Maybe a few instructions would be enough. I really don't want to bother anyone, but if you can help me I will be very grateful. 
Title: Re: ID of activities in HTML
Post by: Liviu Lalescu on January 20, 2023, 08:09:14 PM
I did something: https://lalescu.ro/liviu/fet/download/custom/castonepatha/

I did a kind of hack, added 2 short lines in src/engine/timetableexport.cpp. It might not be perfect, but it is something to work with.

If you need more/other changes, let me know.
Title: Re: ID of activities in HTML
Post by: castonepatha on January 20, 2023, 08:28:48 PM
Would it be a big problem if you compiled the binary for me? It will take me a while to get new the virtual machine on the server run with whole environment (x86_64). I don't want to break a solution that is in active operation. Well, on my laptop I have an M1 and the arm virtual machine version of ubuntu, which doesn't help me much.
Title: Re: ID of activities in HTML
Post by: Liviu Lalescu on January 20, 2023, 08:33:29 PM
OK, sure, what version would you need? AppImage or gnu-linux-executable (AppDir)? It will take me 7.5 minutes to compile + a bit more for the other operations.
Title: Re: ID of activities in HTML
Post by: castonepatha on January 20, 2023, 08:40:24 PM
The Appimage will be perfect. Once again I want to thank you for your help. You are a very smart person.
How can I donate to your project?
Title: Re: ID of activities in HTML
Post by: castonepatha on January 20, 2023, 08:48:13 PM
It would be great if you will implemented this function in main version as well. Or with some possibility to turn it off and on. Of course, please you can take it as a recommendation only. I know it's not that simple. "How can I donate to your project?" - I have found :)
Title: Re: ID of activities in HTML
Post by: Liviu Lalescu on January 20, 2023, 09:15:59 PM
It is done: https://lalescu.ro/liviu/fet/download/custom/castonepatha/

If it is not nice, we can work on it.

Thank you very much for your kind words and intention!

I will write down your suggestion in the TODO list. It is not at all difficult, but until now we did not consider it useful -- on the contrary, we considered that it might clutter the timetables.

I think there was a single other person suggesting this idea.

I'll think about it -- if it can be added as an option to the official FET. @Volker Dirr , what do you say?
Title: Re: ID of activities in HTML
Post by: castonepatha on January 20, 2023, 09:23:46 PM
Thank you very much.

It is really very useful. Mainly for the back check of activities and subsequent corrections. Imagine that someone sends you requests for changes. For me, the ID is more important than the subject name (more repeated subjects and groups). It can be solved in a different way, but it will be great this way.
Title: Re: ID of activities in HTML
Post by: castonepatha on January 20, 2023, 09:36:33 PM
I am testing it. It is fantastic :) Wooooou. You are genius.
Title: Re: ID of activities in HTML
Post by: Liviu Lalescu on January 20, 2023, 09:38:21 PM
I added your suggestion in the TODO file/list (on my hard disk). We'll analyze this.

However, did you notice that with each completely generated there will be generated a file named ..._data_and_timetable.fet, which has each activity locked and should generate instantly? This might help, as in the FET interface > view timetable you can view the activities ID-s, if you click on the table cell.
Title: Re: ID of activities in HTML
Post by: Liviu Lalescu on January 20, 2023, 09:40:22 PM
Oh... thank you! :)
Title: Re: ID of activities in HTML
Post by: castonepatha on January 20, 2023, 10:38:18 PM
I am testing it already and it works...I did not notice that file. It is very fast (I have it remotely on server). I am now switching between official and "castonepatha" version if i want to show IDs I will use moded version and I am locking whole timetable if im switching between versions. It looks taht ist does not break nothing in timetable I am still able to mod timetable data or lock vice versa between versions. "This might help, as in the FET interface > view timetable you can view the activities ID-s, if you click on the table cell." - not sure what do you mean...This function is not there...or do you mean that it will be there implemented? Btw that advanced filter for locking is coool feature that I had missing (before I ve been using 6.7.7).   
Title: Re: ID of activities in HTML
Post by: Liviu Lalescu on January 20, 2023, 10:53:05 PM
Quote from: castonepatha on January 20, 2023, 10:38:18 PMI am testing it already and it works...I did not notice that file. It is very fast (I have it remotely on server).

It should be normally good and very fast. For unusual files it might take longer or not finish (if you use in very peculiar cases 99.999999% for constraints which are broken in the final timetable). But don't worry about this. Also, if you use <100% preferred rooms or home rooms and in your final timetable an activity does not have a room, after generating on the locked timetable that activity might get a room. But this should not be a problem, I hope.

QuoteI am now switching between official and "castonepatha" version if i want to show IDs I will use moded version and I am locking whole timetable if im switching between versions. It looks taht ist does not break nothing in timetable I am still able to mod timetable data or lock vice versa between versions.

Do you mean the versions are interchangeable? Of course! :)

Quote"This might help, as in the FET interface > view timetable you can view the activities ID-s, if you click on the table cell." - not sure what do you mean...This function is not there...or do you mean that it will be there implemented?

It is there, but might be hidden if you resized the splitters to remove the text detailed description of the activity. There should be a text description, beginning with the activity ID, in the days horizontal and time horizontal timetable view from interface -- just click on a table cell with an activity in it. If you want, you can restore all the default FET settings if you lost this text description (but be careful, you will lose the settings).

QuoteBtw that advanced filter for locking is coool feature that I had missing (before I ve been using 6.7.7).   

I'm glad it is useful! :) I think you refer to the filter suggested by giardiniere in FET-6.8.1?
Title: Re: ID of activities in HTML
Post by: castonepatha on January 20, 2023, 11:12:01 PM
Yes, that I mean. It is very useful. it is quite difficult to create schedules. I'm learning every day. But it would be hell without this tool. I look forward to further cooperation. I will send you the promised reward. If it is accepted at our faculty, it will be propably adopt on entire university. I I have been working on it for several months. Thank you very much for help :)
Title: Re: ID of activities in HTML
Post by: Liviu Lalescu on January 20, 2023, 11:17:07 PM
Thank you for your kind words and intention! Donations are highly appreciated!

We will surely cooperate, and I am glad when FET is used intensively. What faculty and what university? (if you are allowed to write this.)
Title: Re: ID of activities in HTML
Post by: castonepatha on January 21, 2023, 08:35:33 AM
Faculty of Management, Comenius University Bratislava. I am not shure if is also possible write here private messages. I can send you result of prototype. You will see logic behind. It is difficult to modify internal processes and change thinking and everything :)
Title: Re: ID of activities in HTML
Post by: Liviu Lalescu on January 21, 2023, 08:46:33 AM
Thank you for letting us know! You can write here private messages, but without attachments. If you want to send me privately your fet file, you can write me an email.
Title: Re: ID of activities in HTML
Post by: Volker Dirr on January 22, 2023, 10:31:52 AM
hmm...
Maybe i am wrong, but I don't like the idea very much; because of 2 reasons:

1. Reason:
It might be a bit different for universities that doesn't split activities. But "normal" school use a lot of those sub-activities. If those school try to solve a problem by "fixing" the problem of that id only, then the problem isn't solved since the same bug might occur with the similar sub-activity.
I guess low skilled timetable makers will fail if they think about ids (only). They always need to think about teachers, students and rooms; not about ids.
Activities are easy to find if those normal school timetable makers work with the activity planning dialog. In fact i nearly never use the activity list, only the activity planning dialog. (and of course constraints list)
It looks like an id might be useful for "normal" schools if they want to lock/unlock to do a few manual swaps. But even in that case the lock/unlock dialog in FET (or the planning dialog in TiTiTo) is much better, since you don't need to know the id for that, since you can see the activity in the table.
So i fear displaying an id will tempt timetable makers to do a bad/complicated work flow.

2. Reason:
a)
The html tables are not for the timetable maker, they are for the users/teachers/students.
The other teachers and students don't need to know an id. It is only unneeded information for them wich is confusing them and wasting space. Some school already have problems to print large tables on a paper. Printing now an id will increase the problem.
b)
Even if a timetable maker might use the ids sometimes:
The timetable maker should use the timetable view in FET (not the html tables), so printing an id in the FET view is ok, but not in html.