Skip to content

Commit 1ef9cf3

Browse files
API integration and application management
1 parent ff0725d commit 1ef9cf3

File tree

9 files changed

+655
-105
lines changed

9 files changed

+655
-105
lines changed

Index.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#--------------------- APP-1 ---------------------#
2+
3+
from ast import If
4+
from pickle import GLOBAL
5+
from PyQt5.QtWidgets import QMainWindow, QApplication
6+
from PyQt5 import QtCore, QtGui, QtWidgets
7+
from PyQt5.uic import loadUi
8+
import sys
9+
from QuestionPage import QuestionPage
10+
import UserData
11+
12+
# Created a class object
13+
14+
class Main(QMainWindow):
15+
16+
def __init__(self):
17+
super(Main, self).__init__()
18+
loadUi('Login.ui', self)
19+
20+
# ~~---------- Ui Logic -------------~~
21+
22+
# set the page base settings
23+
self.setWindowTitle("Exium - Login")
24+
self.setFixedSize(430, 721)
25+
26+
# Adding difficulties to the combo box
27+
self.comboBox.addItems('easy medium hard'.split())
28+
self.comboBox.setStyleSheet('background-color: white')
29+
30+
# OnClick Get Started button -> start the game
31+
self.pushButton.clicked.connect(lambda:self.Login())
32+
33+
# Get Started button behavior
34+
def Login(self):
35+
36+
# Pass Name & Difficulty to the next window
37+
UserData.student_name = self.textEdit.toPlainText()
38+
UserData.student_score = 0
39+
UserData.question_index = 0
40+
UserData.difficulty = self.comboBox.currentText()
41+
print(UserData.student_name, UserData.difficulty)
42+
43+
# Transport to the next window
44+
self.anotherwindow = QuestionPage()
45+
self.anotherwindow.show()
46+
self.hide()
47+
48+
49+
50+
if __name__ == '__main__':
51+
app = QApplication(sys.argv)
52+
ui = Main()
53+
ui.show()
54+
app.exec_()

Login.ui

Lines changed: 110 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ui version="4.0">
3-
<class>MainWindow</class>
4-
<widget class="QMainWindow" name="MainWindow">
3+
<class>LoginWindow</class>
4+
<widget class="QMainWindow" name="LoginWindow">
55
<property name="geometry">
66
<rect>
77
<x>0</x>
@@ -15,7 +15,6 @@
1515
</property>
1616
<property name="styleSheet">
1717
<string notr="true">QMainWindow {
18-
1918
background: rgb(46, 49, 146);
2019
}</string>
2120
</property>
@@ -49,70 +48,29 @@
4948
<property name="frameShadow">
5049
<enum>QFrame::Raised</enum>
5150
</property>
52-
<widget class="QLabel" name="headline_2">
53-
<property name="geometry">
54-
<rect>
55-
<x>71</x>
56-
<y>103</y>
57-
<width>121</width>
58-
<height>21</height>
59-
</rect>
60-
</property>
61-
<property name="font">
62-
<font>
63-
<family>Sitka Text Semibold</family>
64-
<pointsize>-1</pointsize>
65-
<weight>50</weight>
66-
<italic>false</italic>
67-
<bold>false</bold>
68-
</font>
69-
</property>
70-
<property name="layoutDirection">
71-
<enum>Qt::LeftToRight</enum>
72-
</property>
73-
<property name="styleSheet">
74-
<string notr="true">QLabel {
75-
id: headline_1;
76-
font : 15px;
77-
color: rgb(244, 178, 0);
78-
background: transparent;
79-
}</string>
80-
</property>
81-
<property name="text">
82-
<string>Exium everyday</string>
83-
</property>
84-
<property name="textFormat">
85-
<enum>Qt::AutoText</enum>
86-
</property>
87-
<property name="alignment">
88-
<set>Qt::AlignCenter</set>
89-
</property>
90-
</widget>
9151
<widget class="QLabel" name="headline">
9252
<property name="geometry">
9353
<rect>
94-
<x>71</x>
95-
<y>25</y>
96-
<width>286</width>
54+
<x>70</x>
55+
<y>32</y>
56+
<width>271</width>
9757
<height>81</height>
9858
</rect>
9959
</property>
10060
<property name="font">
10161
<font>
10262
<family>Sitka Text Semibold</family>
103-
<pointsize>-1</pointsize>
104-
<weight>50</weight>
63+
<pointsize>53</pointsize>
64+
<weight>75</weight>
10565
<italic>false</italic>
106-
<bold>false</bold>
66+
<bold>true</bold>
10767
</font>
10868
</property>
10969
<property name="layoutDirection">
11070
<enum>Qt::LeftToRight</enum>
11171
</property>
11272
<property name="styleSheet">
11373
<string notr="true">QLabel {
114-
id: headline;
115-
font : 90px;
11674
color: whitesmoke;
11775
}</string>
11876
</property>
@@ -129,28 +87,26 @@
12987
<widget class="QLabel" name="headline_3">
13088
<property name="geometry">
13189
<rect>
132-
<x>197</x>
133-
<y>103</y>
134-
<width>171</width>
90+
<x>174</x>
91+
<y>116</y>
92+
<width>191</width>
13593
<height>21</height>
13694
</rect>
13795
</property>
13896
<property name="font">
13997
<font>
140-
<family>Sitka Text Semibold</family>
141-
<pointsize>-1</pointsize>
142-
<weight>50</weight>
98+
<family>Palatino Linotype</family>
99+
<pointsize>9</pointsize>
100+
<weight>75</weight>
143101
<italic>false</italic>
144-
<bold>false</bold>
102+
<bold>true</bold>
145103
</font>
146104
</property>
147105
<property name="layoutDirection">
148106
<enum>Qt::LeftToRight</enum>
149107
</property>
150108
<property name="styleSheet">
151109
<string notr="true">QLabel {
152-
id: headline_1;
153-
font : 15px;
154110
color: whitesmoke;
155111
background: transparent;
156112
}</string>
@@ -176,8 +132,6 @@
176132
</property>
177133
<property name="styleSheet">
178134
<string notr="true">QPushButton {
179-
id:pushButton;
180-
font: 20px;
181135
font-weight:700;
182136
color: rgb(43, 45, 135);
183137
background:rgb(244, 178, 0) ;
@@ -196,9 +150,15 @@
196150
<height>31</height>
197151
</rect>
198152
</property>
153+
<property name="font">
154+
<font>
155+
<pointsize>9</pointsize>
156+
<weight>87</weight>
157+
<bold>true</bold>
158+
</font>
159+
</property>
199160
<property name="styleSheet">
200161
<string notr="true">QLabel {
201-
font: 16px;
202162
font-weight:700;
203163
color:whitesmoke;
204164
}</string>
@@ -216,9 +176,15 @@
216176
<height>41</height>
217177
</rect>
218178
</property>
179+
<property name="font">
180+
<font>
181+
<pointsize>12</pointsize>
182+
<weight>75</weight>
183+
<bold>true</bold>
184+
</font>
185+
</property>
219186
<property name="styleSheet">
220187
<string notr="true">QTextEdit {
221-
font: 25px;
222188
background:white;
223189
border: 1px solid white;
224190
border-radius: 5px;
@@ -242,10 +208,6 @@
242208
</property>
243209
<property name="styleSheet">
244210
<string notr="true">QLabel {
245-
id:label_2;
246-
font: 16px;
247-
font-weight:700;
248-
color:black;
249211
background:white;
250212
border: 1px solid white;
251213
border-radius: 10px 2px;
@@ -261,13 +223,87 @@
261223
<bool>true</bool>
262224
</property>
263225
</widget>
264-
<zorder>headline</zorder>
265-
<zorder>headline_2</zorder>
266-
<zorder>headline_3</zorder>
267-
<zorder>pushButton</zorder>
268-
<zorder>label</zorder>
269-
<zorder>textEdit</zorder>
270-
<zorder>label_2</zorder>
226+
<widget class="QComboBox" name="comboBox">
227+
<property name="geometry">
228+
<rect>
229+
<x>60</x>
230+
<y>370</y>
231+
<width>311</width>
232+
<height>51</height>
233+
</rect>
234+
</property>
235+
<property name="font">
236+
<font>
237+
<pointsize>20</pointsize>
238+
</font>
239+
</property>
240+
<property name="styleSheet">
241+
<string notr="true"/>
242+
</property>
243+
</widget>
244+
<widget class="QLabel" name="label_3">
245+
<property name="geometry">
246+
<rect>
247+
<x>60</x>
248+
<y>330</y>
249+
<width>331</width>
250+
<height>31</height>
251+
</rect>
252+
</property>
253+
<property name="font">
254+
<font>
255+
<pointsize>9</pointsize>
256+
<weight>87</weight>
257+
<bold>true</bold>
258+
</font>
259+
</property>
260+
<property name="styleSheet">
261+
<string notr="true">QLabel {
262+
font-weight:700;
263+
color:whitesmoke;
264+
}</string>
265+
</property>
266+
<property name="text">
267+
<string>Select Questions Difficulty :</string>
268+
</property>
269+
</widget>
270+
<widget class="QLabel" name="headline_10">
271+
<property name="geometry">
272+
<rect>
273+
<x>24</x>
274+
<y>116</y>
275+
<width>191</width>
276+
<height>21</height>
277+
</rect>
278+
</property>
279+
<property name="font">
280+
<font>
281+
<family>Palatino Linotype</family>
282+
<pointsize>9</pointsize>
283+
<weight>75</weight>
284+
<italic>false</italic>
285+
<bold>true</bold>
286+
</font>
287+
</property>
288+
<property name="layoutDirection">
289+
<enum>Qt::LeftToRight</enum>
290+
</property>
291+
<property name="styleSheet">
292+
<string notr="true">QLabel {
293+
color: rgb(244, 178, 0);
294+
background: transparent;
295+
}</string>
296+
</property>
297+
<property name="text">
298+
<string>Exium everyday</string>
299+
</property>
300+
<property name="textFormat">
301+
<enum>Qt::AutoText</enum>
302+
</property>
303+
<property name="alignment">
304+
<set>Qt::AlignCenter</set>
305+
</property>
306+
</widget>
271307
</widget>
272308
</widget>
273309
<widget class="QStatusBar" name="statusbar"/>

0 commit comments

Comments
 (0)