Complex Student Set grouping

Started by aang, January 18, 2011, 03:35:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

aang


This software is quite a piece of work. thank you.
I have a complex scenario that i really need help on.

Our school has 4 years[1,2,3,4]. y 1 and 2 have 5 classes[e,w,n,s,x], year 3 has 6 [e,w,n,s,x,y] and year 4 has 4[e,w,n,s]. In year 4, the setup is as below:

All students choose on of (agr, bus, mus, bus) which are done simultaneously (5 lessons each) and the 4 classes combine in one room for each of the subjects with the same teacher. They all choose between (geo, hist) which are also done at the same time (4 lessons each) and 2 classes are combined for one teacher for each of the subjects.

Also they can take either two of bio, phy and cre but not the 3. Bio and Phy are taught by different teachers for each form but CRE students are divided into two groups taught by two different teachers at either different times or can be simultaneous. Normally the setup is that while two classes take Bio, the other two take Phy and all of the take CRE (with one teacher) in one lesson and the next lesson they swap bio and phy with a different CRE teacher.

The rest of the subjects are compulsory (eng, kis, mat, chem) and are taught by 1 teacher per class per subject.

Liviu Lalescu

I think of this: year 4. The first group of subjects (agr, bus, mus, bus) - you don't need to create a category for them. Just add an activity with Y4, 4 teachers, and maybe consider 3 additional activities with no teachers/students, same starting time, so that they occupy 4 rooms.

Category (geo, hist), maybe same as above.

Category maybe: bio, phy, cre: make 3 divisions: bio_phy, bio_cre, phy_cre, or bio_phy, bio_cre1, bio_cre2, phy_cre1, phy_cre2.

If they swap subjects, maybe you can combine like the first group of subjects (agr, bus, mus, bus above).

Liviu Lalescu

#2
For bio, phy and cre, maybe another solution (suggested also here: http://lalescu.ro/liviu/fet/forum/index.php?topic=366.msg2041#msg2041 ):

I think in this case the activities for bio, phy and cre should be non-overlapping. So, just add three activities, subjects bio, phy and cre respectively, with all year 4 for each one, so they will be non-overlapping, and consider for yourself that in each activity there will be only a part of year 4.

aang

#3
QuoteI think of this: year 4. The first group of subjects (agr, bus, mus, bus) - you don't need to create a category for them. Just add an activity with Y4, 4 teachers, and maybe consider 3 additional activities with no teachers/students, same starting time, so that they occupy 4 rooms.

Category (geo, hist), maybe same as above.

Category maybe: bio, phy, cre: make 3 divisions: bio_phy, bio_cre, phy_cre, or bio_phy, bio_cre1, bio_cre2, phy_cre1, phy_cre2.

If they swap subjects, maybe you can combine like the first group of subjects (agr, bus, mus, bus above).
Thanks so much for the reply. The last solution seems beautiful and understandable. The category (geo,hist) also seems fine.
Let me try out and give a feedback.

Liviu Lalescu

#4
For your old text (which you edited and is no longer available), in which you told that you wanted the timetable of students to contain only the needed subjects:

You said that:

1) e, w, n, s (basic divisions)
2) agr, bus, mus, comp (subjects)

a) for agr and bus, e and w are taught by teacher T1 and n and s are taught by teacher T2
b) mus is only taught to e and w (or something like that, I am not sure)

Then, another possible solution would be to divide year 4 by 2 categories: 1) and 2) (each has 4 divisions).

You obtain subgroups 4_e_agr and 4_w_agr to add to activities of agr, with teacher T1 (two subgroups per activity).

You obtain subgroups 4_n_agr and 4_s_agr to add to activities of agr, with teacher T2 (two subgroups per activity).

You obtain subgroups 4_e_bus and 4_w_bus to add to activities of agr, with teacher T3 (two subgroups per activity).

You obtain subgroups 4_n_bus and 4_s_bus to add to activities of agr, with teacher T4 (two subgroups per activity).

You obtain subgroups 4_e_mus and 4_w_mus to add to activities of mus.

Edited to add: division of years is nice, the only thing is that you have maximum 3 categories, with maximum 12, 6 and 6 divisions respectively. Also, too many divisions may slow down the generation of the timetable - that is why I imposed these limits.

If you want, I can remove this post (referring to no longer available text by you), but I hope it is useful.

aang

#5
QuoteFor bio, phy and cre, maybe another solution (suggested also here: http://lalescu.ro/liviu/fet/forum/index.php?topic=366.msg2041#msg2041 ):

I think in this case the activities for bio, phy and cre should be non-overlapping. So, just add three activities, subjects bio, phy and cre respectively, with all year 4 for each one, so they will be non-overlapping, and consider for yourself that in each activity there will be only a part of year 4.

they can overlap, this is how the manual timetable works.
Bio and Phy each have 5 lessons [1 theory and 2 double lesson practicals]. When say E/W are taking bio theory, N/S are taking physics theory and all the CRE1 students have CRE simultaneously. Later E/W have phy while N/S have bio and all CRE2 students have CRE.
When E has a bio practical, they take it with one lesson of CRE1 followed by a gap. When E has a phy practical they take one lesson of CRE2 followed by a gap.

I have noticed that the above plan is in err. So i want to currently ignore CRE it will be done manually. But the number of activities are more than the number of available slots. Some of these activities are simultaneous. What am i missing?

aang

Allow me to share with you this file.

This is what i was trying originally. The problem is that if you generate, it is overlapping AGR/COMP/BUS/MUS with GEO/HIST or CRE1/CRE2. (try generate from the file). Kindly advise from here.

Liviu Lalescu

#7
Quotethey can overlap, this is how the manual timetable works.
Bio and Phy each have 5 lessons [1 theory and 2 double lesson practicals]. When say E/W are taking bio theory, N/S are taking physics theory and all the CRE1 students have CRE simultaneously. Later E/W have phy while N/S have bio and all CRE2 students have CRE.
When E has a bio practical, they take it with one lesson of CRE1 followed by a gap. When E has a phy practical they take one lesson of CRE2 followed by a gap.

I have noticed that the above plan is in err. So i want to currently ignore CRE it will be done manually. But the number of activities are more than the number of available slots. Some of these activities are simultaneous. What am i missing?

I would suggest this: 3 categories, the first two as above, and the third:

3) bio, phy, cre

Then, you can use a combination of the subgroups to create a multi-set of students for each activity. Like:

E/W are taking bio theory -> consider subgroups 4_e_agr_bio + 4_e_bus_bio + 4_e_mus_bio + 4_e_comp_bio +
4_w_agr_bio + 4_w_bus_bio + 4_w_mus_bio + 4_w_comp_bio.

Please try this and tell me if it works.

Edited to add: the activities for the first two categories will include now all 3 subgroups for each bio, phy and cre, in the activities.

Edited to add (2): you may have 4 categories, if you use this trick: year 4 is defined in FET as 4 years: 4_e, 4_w, 4_n, 4_s, and divide each year 4_e, 4_w, 4_n, 4_s, by 3 categories.

Dividing by categories: I mean use the option from the years dialog, "Divide year automatically by selecting categories".

Liviu Lalescu

QuoteAllow me to share with you this file.

This is what i was trying originally. The problem is that if you generate, it is overlapping AGR/COMP/BUS/MUS with GEO/HIST or CRE1/CRE2. (try generate from the file). Kindly advise from here.

I think the error is that you have put AGR/COMP/BUS/MUS / GEO/HIST / CRE1/CRE2 in the same category. You need to make 4 years:

4_e
4_w
4_n
4_s

and divide each one by 3 categories:

1) AGR/COMP/BUS/MUS
2) GEO/HIST
3) CRE1/CRE2

(My answer is for this post, but I am not sure if these are the exact divisions, it is a difficult situation for me to understand. I hope you can understand the idea, not the exact details).

aang

Hi Liviu,

Thanks so much. I'd originally thought of this approach but stalled on seeing so many subgroups.
The last category should be BIOCRE1,BIOCRE2, BIOPHY, PHYCRE1, PHYCRE2

Regards,

Liviu Lalescu

#10
Quote
The last category should be BIOCRE1,BIOCRE2, BIOPHY, PHYCRE1, PHYCRE2

I hope this is correct.

Please inform me of your results.

aang

Hi Liviu, the method worked and generated the timetable correctly. I have a problem though in the formatting of the html files and consequently the printing. Now, an activity will be printed with six subgroups on the timetable making it unusually wide(or tall) and the subgroup names do not actually reflect the student set that should be displayed e.g Mwaniki-CRE-4 E BIOCRE1, 4 E PHYCRE1, 4 W BIOCRE1, 4 W PHYCRE1, 4 N BIOCRE1, 4 N PHYCRE1, 4 S BIOCRE1, 4 S PHYCRE1
instead of Mwaniki-CRE-4 CRE1 or Mwaniki-CRE-4. This means i edit the timetable manually after every generation to make this changes. I suggest adding a displayname tag to the activity which defaults to the current display name(without the activityID :) ) and using this to determine what is displayed for the activity.

The other thing is can i get a subject color propagated to the entire activity td so that i can color the timetable depending on the subject only. so that every activity of the Subject will have one color and not just the subject span only while the student set, location and teacher spans remain uncolored.

Lastly, for activities with same starting time is it possible to have the in one column/row so that the number of rows/columns is fixed to the either the number of days or lessons(depending on the selected timetable. This way it is easier to print.

I have checked the source code and i could trace where writing to the HTML and CSS files is taking place.

Love your tidy programming!

Liviu Lalescu

Volker can answer better than me.

I added your suggestions in the TODO list.

aang

Hi Liviu,

I found out that the method that writeStudents in timetableexport.cpp goes through all the StudentNames set for an activity and writes them. I would like to add a 'display name' field in the modify and add activity dialogs so that this method checks if the display-name is not empty then it writes it to the xhtml rather than adding the individual student-sets. Am not very familiar with Qt (am a .NET C# person). Would you kindly help tell me how many files these changes will affect and which ones they are and how. Will greatly appreciate. I think Volker is not available. I just need the guidance and then i will make the changes and build. Just downloaded Qt 4.7 SDK and the addin for Visual studio (i guess you understand why :) ).

Thanks.

Liviu Lalescu

OK :-)

In activity.h, add a member QString overwriteDescription. Modify functions Activity (1) and (2) variants, to include this new QString.

In activity.cpp, modify Activity (1) and (2) and the 4 functions get...Description.

rules.cpp, line 6112, add code to care about QString overwriteDescription.

In rules.h, search for Activity and Subactivity strings (not ActivityTag - ignore it). Modify the functions' interfaces (about 6 I think). Then, modify the functions' code in rules.cpp.

Then, modify timetableexport.cpp, I think you found the function.

I would advise you to check that this code works (what we did above). To be able to compile, you'll need to modify also addactivityform.h&cpp and modifyactivityform.h&cpp (add the new QString overwriteDescription, for now initialized as void). You can modify manually the .fet file, load and save the .fet file. Do not modify the activity, as this will erase the overwriteDescription QString.

If this works, you need to operate the change in the interface. In add/modify activityform .h, .cpp & _template.ui. Open the ui's with Qt Designer and drag into those dialogs a QTextEdit or QLineEdit. The forms have a layout, maybe you need to break it and redo it after your work.

Let me know your problems.