Browse Source

Erste komplett lauffaehige Version

Vinzent Reiß 7 years ago
parent
commit
3b21ddf71e
1 changed files with 17 additions and 9 deletions
  1. 17 9
      ToolV00.py

+ 17 - 9
ToolV00.py

@@ -26,7 +26,6 @@ def SchluesselDatenAbfragen():
26 26
 		name  = entry1.get()
27 27
 		date  = entry2.get()
28 28
 		root.destroy()
29
-#		button1.config(text = "Weiter", command = root.destroy)
30 29
 	def VerbergeHilfeName():
31 30
 		button3.config(text = "Hilfe", fg = "green", command = ZeigeHilfeName)
32 31
 	def ZeigeHilfeName():
@@ -91,7 +90,6 @@ def MindestPunktzahlAbfragen():
91 90
 		global ProzentSatz
92 91
 		ProzentSatz = float(entry1.get())
93 92
 		root.destroy()
94
-#		button1.config(text = "Weiter", command = root.destroy)
95 93
 	root = Tk()
96 94
 	root.title("Prozentsatz zum Bestehen")
97 95
 	Label(root, text = "Prozentsatz").grid(row = 0, column = 0)
@@ -177,13 +175,19 @@ def StudentenMaskeGenerieren():
177 175
 	button1.grid(row = 0, column = 2)
178 176
 	button2.grid(row = 1, column = 2)
179 177
 	root.mainloop()
178
+	PunkteProAufgabe = []
180 179
 def GesamtNoteBerechnen():
180
+	global Summe
181 181
 	global Studenten
182 182
 	global StudentenPunkte
183 183
 	global minEins
184 184
 	global minZwei
185 185
 	global minDrei
186 186
 	global BestehPunkte
187
+	print BestehPunkte
188
+	print minEins
189
+	print minZwei
190
+	print minDrei
187 191
 	for i in range(len(Studenten)):
188 192
 		tmpSumme = 0
189 193
 		for j in range(1,len(StudentenPunkte[i])):
@@ -198,6 +202,11 @@ def GesamtNoteBerechnen():
198 202
 			Studenten[i].append(2.0 + 1 - float(int(10 * ((tmpSumme - minZwei) / (minEins - minZwei)))) / 10.0)
199 203
 		else:
200 204
 			Studenten[i].append(1.0 + 1 - float(int(10 * ((tmpSumme - minEins) / (Summe - minEins)))) / 10.0)
205
+	Summe = 0
206
+	minEins = 0
207
+	minZwei = 0
208
+	minDrei = 0
209
+	BestehPunkte = 0
201 210
 def Notenspiegel():
202 211
 	global Notenverteilung
203 212
 	global Studenten
@@ -207,18 +216,13 @@ def Notenspiegel():
207 216
 		Vergleich = Studenten[j][2]
208 217
 		Notenverteilung[int(10*(Vergleich-1))] += 1
209 218
 def NotenspiegelAusgabe():
210
-	Farbauswahl = ["red", "black"]
211
-	Farbe = 0
212 219
 	root = Tk()
213 220
 	root.title("Notenspiegel")
214 221
 	for i in range(41):
215
-		if Farbe < 1:
216
-			Farbe += 1
217
-		else:
218
-			Farbe = 0
222
+		farbe = "#{:s}".format(str(2390*i).zfill(6))
219 223
 		tmp = 1.0 + float(i)/10.0
220 224
 		Label(root, text = tmp).grid(row = i, column = 0)
221
-		Label(root, width =  int(float(Notenverteilung[i])/float(len(Studenten))*128), background = Farbauswahl[Farbe]).grid(row = i, column = 1, sticky = W, pady = 4)
225
+		Label(root, width =  int(float(Notenverteilung[i])/float(len(Studenten))*128), background = farbe).grid(row = i, column = 1, sticky = W, pady = 4)
222 226
 	Button(root, text = "Beenden", command = root.destroy).grid(row = 0, column = 2)
223 227
 	root.mainloop()
224 228
 def DatenAnpassen():
@@ -228,6 +232,8 @@ def DatenAnpassen():
228 232
 		if len(Studenten[i][1]) >= 16:
229 233
 			Studenten[i][1] = Studenten[i][1][0:15]
230 234
 def TextdateiErstellen():
235
+	global Studenten
236
+	global StudentenPunkte
231 237
 	Datei = open(name, "w")
232 238
 	Datei.write("Name der Klausur:\t%s\n" % (name))
233 239
 	Datei.write("Datum der Klausur:\t%s\n" % (date))
@@ -235,6 +241,8 @@ def TextdateiErstellen():
235 241
 	for i in range(len(Studenten)):
236 242
 		Datei.write("|\t%8d\t|\t%16s\t|\t%4.1f\t|\n" % (Studenten[i][0], Studenten[i][1], Studenten[i][2]))
237 243
 	Datei.close()
244
+	Studenten = []
245
+	StudentenPunkte = []
238 246
 def ExistenzPruefung():
239 247
 	global name
240 248
 	foldercontent = os.listdir(".")