-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainPage.html
318 lines (275 loc) · 28.3 KB
/
mainPage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>BrushUp!: module mainPage</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>mainPage</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href="index.html">index</a><br></font></td></tr></table>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="StartApp">class <strong>StartApp</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>This is the class that will define the window where the game will appear, <br>
its configuration, the dictionaries and theory.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="StartApp-AddWord"><strong>AddWord</strong></a>(self, frame, word, example, meaning, syntax)</dt><dd><tt>This method obtains the data from the form and uses it to add a new word <br>
inside the database associated with the current user. <br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one. <br>
word: new word to be included<br>
example: example in which the word is used<br>
meaning: meaning of the word in the user's native language<br>
syntaxis: type of word (verb, preposition...)</tt></dd></dl>
<dl><dt><a name="StartApp-ByeWord"><strong>ByeWord</strong></a>(self, frame, word)</dt><dd><tt>This method obtains the data from the form and uses it to delete an<br>
existing word from the database associated with the current user. <br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one. <br>
word: word to be included</tt></dd></dl>
<dl><dt><a name="StartApp-ChangPass"><strong>ChangPass</strong></a>(self)</dt><dd><tt>Frame to change the password associated with the user whose session is <br>
opened.</tt></dd></dl>
<dl><dt><a name="StartApp-ChangePass"><strong>ChangePass</strong></a>(self, newpass, frame)</dt><dd><tt>This method connects to the database "users.db" and changes the user's <br>
password.</tt></dd></dl>
<dl><dt><a name="StartApp-Configure"><strong>Configure</strong></a>(self)</dt><dd><tt>Shows a frame with the different variables that can be modified. The <br>
user can modify:<br>
-The background colour. <br>
-If the user wants to activate the automatics mails (they are <br>
desactivated by default). The user can choose the content<br>
of the email (statistics and/or word of the day).<br>
-If the user wants to desactivate the automatics mails.<br>
-The number of options of the game (4,5 or 6)<br>
-If the user wants to restart the game (update the levels to 1).<br>
-If the user wants to import data from an external database.<br>
-If the user wants to open the log file.<br>
-The password</tt></dd></dl>
<dl><dt><a name="StartApp-GoToMenu"><strong>GoToMenu</strong></a>(self, frame)</dt><dd><tt>Destroys the current frame and shows the main menu.<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.</tt></dd></dl>
<dl><dt><a name="StartApp-MainMenu"><strong>MainMenu</strong></a>(self)</dt><dd><tt>Shows the main menu</tt></dd></dl>
<dl><dt><a name="StartApp-Play"><strong>Play</strong></a>(self, frame, level, wordOrMeaning, wordType)</dt><dd><tt>Shows the question and the options<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one. <br>
level: level of the words that can be selected for the game. If all<br>
levels can be picked out, then level="all levels".<br>
wordOrMeaning: "Choose meaning" if the options to chose are the <br>
meanings, or "Choose word" if the options to chose are the word<br>
names. <br>
wordType: word type of the words that can be selected for the game.<br>
If all word types can be picked out, then wordType="all".</tt></dd></dl>
<dl><dt><a name="StartApp-__init__"><strong>__init__</strong></a>(self, loggedUser)</dt><dd><tt>Once this class is executed, this function is run. <br>
<br>
This method creates the window in which the user can play with his/her <br>
content. The properties of the new window are obtained from the <br>
properties file.<br>
<br>
The self is defined</tt></dd></dl>
<dl><dt><a name="StartApp-answerPlay"><strong>answerPlay</strong></a>(self, frame, answer, word, level, wordOrMeaning, wordType)</dt><dd><tt>Shows if the player's answer is correct, update the level (+1 if <br>
correct; -1 if wrong. Levels between 1 and 10), adn shows the <br>
information about the correct answer (word name, meaning, example <br>
-if there is-,new level).<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one. <br>
answer: option picked out by the user<br>
word: correct answer<br>
level: level of the words that can be selected for the game. If all<br>
levels can be picked out, then level="all levels".<br>
wordOrMeaning: "Choose meaning" if the options to chose are the <br>
meanings, or "Choose word" if the options to chose are the word<br>
names. <br>
wordType: word type of the words that can be selected for the game.<br>
If all word types can be picked out, then wordType="all".</tt></dd></dl>
<dl><dt><a name="StartApp-areDifferent"><strong>areDifferent</strong></a>(self, frame)</dt><dd><tt>Returns an error if 2 inputs dont match while trying to change the <br>
current user's password.<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.</tt></dd></dl>
<dl><dt><a name="StartApp-automails"><strong>automails</strong></a>(self, frame, includeword, includestats, mail, bool)</dt><dd><tt>This method allows to change the information about the mails. It <br>
connects to the properties file and save the new configuration.<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.<br>
includeword: boolean. If True, the email will include information <br>
about one of the words in the user's database. This word is <br>
randomly generated.<br>
includestats: boolean. If True, the email will include the <br>
statistics about the game to the user. <br>
mail: name of the recipient.<br>
bool: boolean. If True, the automatic mails are activated. False <br>
otherwise</tt></dd></dl>
<dl><dt><a name="StartApp-changeColour"><strong>changeColour</strong></a>(self, frame)</dt><dd><tt>This method allows to change the information about the background colour. <br>
It connects to the properties file and save the new configuration.<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.</tt></dd></dl>
<dl><dt><a name="StartApp-changeNoptions"><strong>changeNoptions</strong></a>(self, frame, value)</dt><dd><tt>This method allows to change the number of options of the game.<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.<br>
value: new number of options of the game. It is 4 by default. This <br>
value is stored in the properties file.</tt></dd></dl>
<dl><dt><a name="StartApp-checkIfPlay"><strong>checkIfPlay</strong></a>(self, frame, level, wordOrMeaning, wordType)</dt><dd><tt>Checks if there are words enough before proceeding to play<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one. <br>
level: level of the words that can be selected for the game. If all<br>
levels can be picked out, then level="all levels".<br>
wordOrMeaning: "Choose meaning" if the options to chose are the <br>
meanings, or "Choose word" if the options to chose are the word<br>
names. <br>
wordType: word type of the words that can be selected for the game.<br>
If all word types can be picked out, then wordType="all".</tt></dd></dl>
<dl><dt><a name="StartApp-consPron"><strong>consPron</strong></a>(self, frame)</dt><dd><tt>This method shows the theory associated with the prounuciation of the <br>
consonants. <br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.</tt></dd></dl>
<dl><dt><a name="StartApp-createFile"><strong>createFile</strong></a>(self, frame, orderBy, orderType)</dt><dd><tt>This method creates a pdf with the words stored in the database. The<br>
details have been obtained from the method <a href="#StartApp-showWords">showWords</a>() and are<br>
passed as arguments.<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.<br>
orderBy: indicates the column to choose the order ("date","word",<br>
"level" or "word type")<br>
orderType: select the order type (ascending ,"ASC", or descending,<br>
DESC")</tt></dd></dl>
<dl><dt><a name="StartApp-credits"><strong>credits</strong></a>(self)</dt><dd><tt>This method shows information about the application.</tt></dd></dl>
<dl><dt><a name="StartApp-deleteWord"><strong>deleteWord</strong></a>(self)</dt><dd><tt>This method obtains the data from the word that the user wants to delete. <br>
This word is picked out from a ComboBox.</tt></dd></dl>
<dl><dt><a name="StartApp-dictionary"><strong>dictionary</strong></a>(self, frame, inputword='brush up')</dt><dd><tt>This method shows the details associated with a specific word. If no<br>
word is provided, the default one is "brush up".<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one. <br>
inputword: word whose details has to be shown to the user. This <br>
details are: word name, meaning, example (if it was provided<br>
when the word was added to the database) and level. If no<br>
word is provided, the default one is "brush up".</tt></dd></dl>
<dl><dt><a name="StartApp-diptPron"><strong>diptPron</strong></a>(self, frame)</dt><dd><tt>This method shows the theory associated with the prounuciation of the <br>
diphthongs. <br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.</tt></dd></dl>
<dl><dt><a name="StartApp-exit"><strong>exit</strong></a>(self)</dt><dd><tt>Closes the window and sends the daily mail if required</tt></dd></dl>
<dl><dt><a name="StartApp-goToTheory"><strong>goToTheory</strong></a>(self, frame)</dt><dd><tt>This method shows the index associated with the prounuciation theory. <br>
<br>
If the file "DOCS/book.pdf" exists, it creates a button to open it. <br>
This file should be a grammar book. The developer of this code does <br>
not accept any liability with regard to the copyright permissions to <br>
show that book.<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.</tt></dd></dl>
<dl><dt><a name="StartApp-importData"><strong>importData</strong></a>(self, frame)</dt><dd><tt>Chooses an external ddbb and imports its words. <br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.</tt></dd></dl>
<dl><dt><a name="StartApp-isCurpass"><strong>isCurpass</strong></a>(self, curp)</dt><dd><tt>Checks if 2 inputs dont match while trying to change the current user's <br>
password.<br>
<br>
Args:<br>
curp: string provided for the new user's password</tt></dd></dl>
<dl><dt><a name="StartApp-letsPlay"><strong>letsPlay</strong></a>(self)</dt><dd><tt>Shows a form with the configuration for the game.</tt></dd></dl>
<dl><dt><a name="StartApp-lookUpWord"><strong>lookUpWord</strong></a>(self, frame, word='brush')</dt><dd><tt>This method shows the phonetic transcription associated with a specific <br>
word. If no word is provided, the default one is "brush".<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one. <br>
word: word whose phonetic transcription has to be shown to the user. <br>
This transcription is shown as an image. If no word is provided, <br>
the default one is "brush".</tt></dd></dl>
<dl><dt><a name="StartApp-newWord"><strong>newWord</strong></a>(self)</dt><dd><tt>This method presents a frame to fill in a form with the data of the new <br>
word to add.</tt></dd></dl>
<dl><dt><a name="StartApp-raise_frame"><strong>raise_frame</strong></a>(self, frame)</dt><dd><tt>Raises a new frame inside the window.<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.</tt></dd></dl>
<dl><dt><a name="StartApp-restartLevels"><strong>restartLevels</strong></a>(self, frame)</dt><dd><tt>This method connects to the database and updates the levels to 1</tt></dd></dl>
<dl><dt><a name="StartApp-showWords"><strong>showWords</strong></a>(self)</dt><dd><tt>This method is executed when the user wants to obtain a pdf with the <br>
words stored in his/her database. Shows a form to obtain the <br>
details: order by "date","word","level" or "word type" and <br>
"ascending" or "descending" order</tt></dd></dl>
<dl><dt><a name="StartApp-statistics"><strong>statistics</strong></a>(self, frame)</dt><dd><tt>Frame to show the statistics related to the number of words per level.<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.</tt></dd></dl>
<dl><dt><a name="StartApp-statsWord"><strong>statsWord</strong></a>(self, frame)</dt><dd><tt>Frame to show the statistics related to the number of words per word <br>
type.<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.</tt></dd></dl>
<dl><dt><a name="StartApp-updateSize"><strong>updateSize</strong></a>(self, frame, widthNew, heightNew)</dt><dd><tt>This method allows to change the information about the size of the <br>
window. It connects to the properties file and save the new <br>
configuration.<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.<br>
widthNew: new width<br>
heightNew: new height</tt></dd></dl>
<dl><dt><a name="StartApp-vowelsPron"><strong>vowelsPron</strong></a>(self, frame)</dt><dd><tt>This method shows the theory associated with the prounuciation of the <br>
vowels. <br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.</tt></dd></dl>
<hr>
Static methods defined here:<br>
<dl><dt><a name="StartApp-redirect"><strong>redirect</strong></a>(event)</dt><dd><tt>This method opens the predefined web browser and shows the <br>
"wordreference" website. <br>
<br>
Static method</tt></dd></dl>
<dl><dt><a name="StartApp-showError1"><strong>showError1</strong></a>()</dt><dd><tt>Returns an error related to incomplete information when the user is<br>
filling in a form<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.</tt></dd></dl>
<dl><dt><a name="StartApp-showError2"><strong>showError2</strong></a>()</dt><dd><tt>Returns an error if the number of characters exceeds the minimum value <br>
allowed (100)<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.</tt></dd></dl>
<dl><dt><a name="StartApp-showError3"><strong>showError3</strong></a>()</dt><dd><tt>Returns an error if the word type is not valid<br>
<br>
Args:<br>
frame: previous frame of the window to be deleted before creating <br>
the new one.</tt></dd></dl>
<dl><dt><a name="StartApp-warnCopy"><strong>warnCopy</strong></a>()</dt><dd><tt>This method shows warning related to the copyright permissions.<br>
<br>
Static method</tt></dd></dl>
</div>
</body></html>