1 /***************************************************************************
2                           helpalgeriaform.cpp  -  description
3                              -------------------
4     begin                : September 2, 2011
5     copyright            : (C) 2011 by Lalescu Liviu
6     email                : Please see https://lalescu.ro/liviu/ for details about contacting Liviu Lalescu (in particular, you can find here the e-mail address)
7  ***************************************************************************/
8 
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17 
18 #include "helpalgeriaform.h"
19 
20 #include "timetable_defs.h"
21 
22 #include <QCoreApplication>
23 
HelpAlgeriaForm(QWidget * parent)24 HelpAlgeriaForm::HelpAlgeriaForm(QWidget* parent): QDialog(parent)
25 {
26 	setupUi(this);
27 
28 	connect(closePushButton, SIGNAL(clicked()), this, SLOT(close()));
29 
30 	centerWidgetOnScreen(this);
31 	restoreFETDialogGeometry(this);
32 
33 	QString s=QString("");
34 
35 	s+=tr("This help by Liviu Lalescu, last modified on %1").arg(tr("10 June 2020"));
36 	s+="\n\n";
37 
38 	s+=tr("FET mornings-afternoons with unrestricted mornings/afternoons for teachers was originally designed for Algerian schools (as requested by the user aissa)"
39 	 ", but it can be used in other institutions working in two shifts where teachers can work both in the morning and in the evening on the same day.");
40 
41 	s+="\n\n";
42 
43 	s+=tr("Please define days in FET to be double of the real days, that is if your week has "
44 	 "5 days, define 10 FET days. First day is for morning, second day is for afternoon, and so on.");
45 
46 	s+="\n\n";
47 
48 	s+=tr("Very important about constraint min days between activities: probably you will need to "
49 	 "add min days = 1 for all constraints. I modified the sources and min 1 day means "
50 	 "that the activities must be in different real days, so it cannot be that one activity "
51 	 "is in the morning and another is in the afternoon. If you need constraint to be always respected, "
52 	 "please use 100% weight. If you allow weight under 100% and select consecutive if same day, "
53 	 "then activities must be either in the morning or exclusively in the afternoon.");
54 
55 	s+="\n\n";
56 
57 	s+=tr("Min 1 day means that the activities cannot be in REAL same day (so they can be "
58 	"on Monday afternoon and Tuesday morning, but not both on Monday).");
59 
60 	s+="\n\n";
61 
62 	s+=tr("Min 2 days means that the activities must be 2 REAL days apart (so they "
63 	 "can be on Monday afternoon and Wednesday morning, but not on Monday and Tuesday).");
64 
65 	s+="\n\n";
66 
67 	s+=tr("If your data is too difficult (impossible), maybe you can de-activate force consecutive if same day "
68 	 "for all constraints min days between activities (from the modify multiple constraints at once dialog "
69 	 "which can be activated from the min days constraints dialog).");
70 
71 	s+="\n\n";
72 
73 	s+=tr("Constraint max days between activities considers real days.");
74 	s+="\n\n";
75 
76 	s+=tr("The constraint students (set) min hours daily without allowing empty days is for real days, and for nonempty FET days (half days)"
77 	 " it respects the minimum number of hours daily.");
78 
79 	s+="\n\n";
80 
81 	s+=QCoreApplication::translate("HelpForMorningsAfternoons", "This question and answer by bachiri401 and Liviu Lalescu:");
82 	s+="\n\n";
83 	s+=QCoreApplication::translate("HelpForMorningsAfternoons", "bachiri401: In Algeria, we can not teach the same subject in the same real day. For example a subject divided into 3 activities (1+1+1)"
84 	 " must be on three different real days. The constraint min days between activities here is great (working for real days).");
85 	s+="\n\n";
86 	s+=QCoreApplication::translate("HelpForMorningsAfternoons", "But for example we have students styding math and sport. We want math and sport not to be on the same half day but they can be on the same real day.");
87 	s+="\n\n";
88 	s+=QCoreApplication::translate("HelpForMorningsAfternoons", "bachiri401 also said that for this problem he uses a trick, adding a constraint min gaps between the activities.");
89 	s+="\n\n";
90 	s+=QCoreApplication::translate("HelpForMorningsAfternoons", "And indeed, Liviu Lalescu says this: I checked the code. There is no need for a new constraint. Please use a constraint min gaps between activities"
91 	 " with min gaps = the number of hours per half day (the maximum FET allows). Add all the math and sport activities for a students set for your example. It is implemented"
92 	 " efficiently for this case.");
93 
94 	textBrowser->setText(s);
95 }
96 
~HelpAlgeriaForm()97 HelpAlgeriaForm::~HelpAlgeriaForm()
98 {
99 	restoreFETDialogGeometry(this);
100 }
101