Skip to content

Commit

Permalink
API integration and application management
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammedKAldin committed Jul 28, 2022
1 parent ff0725d commit 1ef9cf3
Show file tree
Hide file tree
Showing 9 changed files with 655 additions and 105 deletions.
54 changes: 54 additions & 0 deletions Index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#--------------------- APP-1 ---------------------#

from ast import If
from pickle import GLOBAL
from PyQt5.QtWidgets import QMainWindow, QApplication
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.uic import loadUi
import sys
from QuestionPage import QuestionPage
import UserData

# Created a class object

class Main(QMainWindow):

def __init__(self):
super(Main, self).__init__()
loadUi('Login.ui', self)

# ~~---------- Ui Logic -------------~~

# set the page base settings
self.setWindowTitle("Exium - Login")
self.setFixedSize(430, 721)

# Adding difficulties to the combo box
self.comboBox.addItems('easy medium hard'.split())
self.comboBox.setStyleSheet('background-color: white')

# OnClick Get Started button -> start the game
self.pushButton.clicked.connect(lambda:self.Login())

# Get Started button behavior
def Login(self):

# Pass Name & Difficulty to the next window
UserData.student_name = self.textEdit.toPlainText()
UserData.student_score = 0
UserData.question_index = 0
UserData.difficulty = self.comboBox.currentText()
print(UserData.student_name, UserData.difficulty)

# Transport to the next window
self.anotherwindow = QuestionPage()
self.anotherwindow.show()
self.hide()



if __name__ == '__main__':
app = QApplication(sys.argv)
ui = Main()
ui.show()
app.exec_()
184 changes: 110 additions & 74 deletions Login.ui
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<class>LoginWindow</class>
<widget class="QMainWindow" name="LoginWindow">
<property name="geometry">
<rect>
<x>0</x>
Expand All @@ -15,7 +15,6 @@
</property>
<property name="styleSheet">
<string notr="true">QMainWindow {

background: rgb(46, 49, 146);
}</string>
</property>
Expand Down Expand Up @@ -49,70 +48,29 @@
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QLabel" name="headline_2">
<property name="geometry">
<rect>
<x>71</x>
<y>103</y>
<width>121</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<family>Sitka Text Semibold</family>
<pointsize>-1</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="styleSheet">
<string notr="true">QLabel {
id: headline_1;
font : 15px;
color: rgb(244, 178, 0);
background: transparent;
}</string>
</property>
<property name="text">
<string>Exium everyday</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="headline">
<property name="geometry">
<rect>
<x>71</x>
<y>25</y>
<width>286</width>
<x>70</x>
<y>32</y>
<width>271</width>
<height>81</height>
</rect>
</property>
<property name="font">
<font>
<family>Sitka Text Semibold</family>
<pointsize>-1</pointsize>
<weight>50</weight>
<pointsize>53</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>false</bold>
<bold>true</bold>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="styleSheet">
<string notr="true">QLabel {
id: headline;
font : 90px;
color: whitesmoke;
}</string>
</property>
Expand All @@ -129,28 +87,26 @@
<widget class="QLabel" name="headline_3">
<property name="geometry">
<rect>
<x>197</x>
<y>103</y>
<width>171</width>
<x>174</x>
<y>116</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<family>Sitka Text Semibold</family>
<pointsize>-1</pointsize>
<weight>50</weight>
<family>Palatino Linotype</family>
<pointsize>9</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>false</bold>
<bold>true</bold>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="styleSheet">
<string notr="true">QLabel {
id: headline_1;
font : 15px;
color: whitesmoke;
background: transparent;
}</string>
Expand All @@ -176,8 +132,6 @@
</property>
<property name="styleSheet">
<string notr="true">QPushButton {
id:pushButton;
font: 20px;
font-weight:700;
color: rgb(43, 45, 135);
background:rgb(244, 178, 0) ;
Expand All @@ -196,9 +150,15 @@
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>87</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">QLabel {
font: 16px;
font-weight:700;
color:whitesmoke;
}</string>
Expand All @@ -216,9 +176,15 @@
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">QTextEdit {
font: 25px;
background:white;
border: 1px solid white;
border-radius: 5px;
Expand All @@ -242,10 +208,6 @@
</property>
<property name="styleSheet">
<string notr="true">QLabel {
id:label_2;
font: 16px;
font-weight:700;
color:black;
background:white;
border: 1px solid white;
border-radius: 10px 2px;
Expand All @@ -261,13 +223,87 @@
<bool>true</bool>
</property>
</widget>
<zorder>headline</zorder>
<zorder>headline_2</zorder>
<zorder>headline_3</zorder>
<zorder>pushButton</zorder>
<zorder>label</zorder>
<zorder>textEdit</zorder>
<zorder>label_2</zorder>
<widget class="QComboBox" name="comboBox">
<property name="geometry">
<rect>
<x>60</x>
<y>370</y>
<width>311</width>
<height>51</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>20</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>60</x>
<y>330</y>
<width>331</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>87</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">QLabel {
font-weight:700;
color:whitesmoke;
}</string>
</property>
<property name="text">
<string>Select Questions Difficulty :</string>
</property>
</widget>
<widget class="QLabel" name="headline_10">
<property name="geometry">
<rect>
<x>24</x>
<y>116</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<family>Palatino Linotype</family>
<pointsize>9</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="styleSheet">
<string notr="true">QLabel {
color: rgb(244, 178, 0);
background: transparent;
}</string>
</property>
<property name="text">
<string>Exium everyday</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</widget>
</widget>
<widget class="QStatusBar" name="statusbar"/>
Expand Down
Loading

0 comments on commit 1ef9cf3

Please sign in to comment.