-
Notifications
You must be signed in to change notification settings - Fork 0
/
NMbasedScore_S1.py
172 lines (120 loc) · 5.27 KB
/
NMbasedScore_S1.py
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
from PyQt5.QtCore import QStringListModel
from PyQt5.QtWidgets import QListView
import deleteCoursePage
from PyQt5 import QtWidgets
import NMbasedScore_S2
import ScorePanel
import re
from Ui.NMbasedScore_S1_Ui import Ui_Dialog
class NMbasedScore_S1(QtWidgets.QDialog,Ui_Dialog):
_stype1 = ""
_stype2 = ""
_isSubtype = False
_subtypeName = ""
_stype=""
_percent = 0
_isMbased = True
def __init__(self, cname):
super(NMbasedScore_S1, self).__init__()
self.setupUi(self)
if self.comboBox_3.currentText() =="Yes":
self.label_7.setVisible(False)
self.label_8.setVisible(False)
self.label_9.setVisible(False)
self.label_2.setVisible(False)
self.label_10.setVisible(False)
self.lineEdit.setVisible(False)
self.lineEdit_3.setVisible(False)
self._stype1 = self.comboBox.currentText()
self._stype2 = ""
self._subtypeName = ""
self.comboBox_2.addItem("Mid-term test")
self.comboBox_2.addItem("Group Project")
course_code, course_title,course_session = cname.split("#")
self.lineEdit_2.setText(course_title)
self.lineEdit_ccode.setText(course_code)
self.lineEdit_sno.setText(course_session)
self.comboBox_3.activated.connect(self.combox3_choose)
self.comboBox.activated.connect(self.comboBox_act)
self.comboBox_2.activated.connect(self.comboBox_2_act)
self.setWindowTitle("Import Matrix based Score - Step 1")
self.lineEdit.textChanged.connect(self.setPercentChange)
self.lineEdit_3.textChanged.connect(self.setSubTypeName)
self.commandLinkButton.clicked.connect(lambda :self.toNMbasedScore_S2(cname,self._stype, str(self._percent)))
self.pushButton.clicked.connect(lambda :self.goback(cname))
def toNMbasedScore_S2(self,cname,stype, percent):
if self.comboBox_2.isVisible()==True and self.comboBox_2.currentText()=="default value":
msg_box = QtWidgets.QMessageBox()
msg_box.information(self,"Alert Message","Please choose the sub-type of Continuous Assessment")
elif self.comboBox_3.currentText()=="No" and self.comboBox_3.isVisible()==True:
if self.lineEdit_3.text()=="":
msg_box = QtWidgets.QMessageBox()
msg_box.information(self,"Alert Message","Please name your score sub-type")
elif self.lineEdit.text()=="":
msg_box = QtWidgets.QMessageBox()
msg_box.information(self,"Alert Message","Please set the percentage!")
else:
self.hide()
self.s = NMbasedScore_S2.NMbasedScore_S2(cname,stype, percent)
self.s.show()
else:
self.hide()
self.s = NMbasedScore_S2.NMbasedScore_S2(cname,stype, percent)
self.s.show()
def combox3_choose(self):
if self.comboBox_3.currentText()== "Yes":
self.label_7.setVisible(False)
self.label_8.setVisible(False)
self.label_9.setVisible(False)
self.lineEdit.setVisible(False)
self.label_2.setVisible(False)
self.label_10.setVisible(False)
self.lineEdit_3.setVisible(False)
self._isSubtype = False
elif self.comboBox_3.currentText()=="No":
# self.label_7.setVisible(True)
self.label_8.setVisible(True)
self.label_9.setVisible(True)
self.lineEdit.setVisible(True)
self.label_2.setVisible(True)
self.label_10.setVisible(True)
self.lineEdit_3.setVisible(True)
self._isSubtype = True
# print("No")
def goback(self,cname):
self.hide()
self.s = ScorePanel.ScorePanel(cname)
self.s.show()
def comboBox_act(self):
self._stype1=""
self._stype2=""
self._isSubtype = False
if self.comboBox.currentText()=="Final Exam Score File":
self.comboBox_2.setVisible(False)
self.comboBox_3.setVisible(False)
self.label_6.setVisible(False)
self.label_2.setVisible(False)
self.label_10.setVisible(False)
self.lineEdit_3.setVisible(False)
self.lineEdit.setVisible(False)
self.label_8.setVisible(False)
self.label_9.setVisible(False)
self._stype1 = self.comboBox.currentText()
self._stype = self._stype1+","+self._stype2+","+str(self._isSubtype)+","+self._subtypeName
if self.comboBox.currentText()=="Continuous Assessment Score File":
self.comboBox_2.setVisible(True)
self.comboBox_3.setVisible(True)
self.label_6.setVisible(True)
self._stype1 = self.comboBox.currentText()
# print("_stype:", self._stype)
def comboBox_2_act(self):
self._stype2 = ""
self._stype2 = self.comboBox_2.currentText()
def setPercentChange(self):
self._percent = 0
self._percent = self.lineEdit.text()
def setSubTypeName(self):
self._isSubtype = True
self._subtypeName = ""
self._subtypeName = self.lineEdit_3.text()
self._stype = self._stype1+";"+self._stype2+";"+str(self._isSubtype)+";"+self._subtypeName