45 lines
1.4 KiB
Python
45 lines
1.4 KiB
Python
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
|
from Ui_根据正确率选择题号 import Ui_widget
|
|
from database_tools_2 import *
|
|
|
|
class MyWindow(QWidget,Ui_widget):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.setupUi(self)
|
|
self.bind()
|
|
|
|
def bind(self):
|
|
self.pushButton_exec.clicked.connect(self.exec)
|
|
|
|
|
|
def exec(self):
|
|
startdate = self.lineEdit_startdate.text()
|
|
enddate = self.lineEdit_enddate.text()
|
|
interval = [float(self.lineEdit_lowerbound.text()),float(self.lineEdit_upperbound.text())]
|
|
classregex = self.lineEdit_classregex.text()
|
|
chosendict,cautionlist,usedlist = ChooseIDsByUsageInterval(startdate,enddate,interval,classregex)
|
|
self.plainTextEdit_ids.setPlainText(generate_exp(list(chosendict.keys())))
|
|
self.plainTextEdit_cautionids.setPlainText(generate_exp(cautionlist))
|
|
subp_output = ""
|
|
for id in chosendict.keys():
|
|
if chosendict[id] != []:
|
|
subp_output += f"题号 {id}: "
|
|
for s in chosendict[id]:
|
|
subp_output += f"第 ({s}) 小题 "
|
|
subp_output += "\n"
|
|
self.plainTextEdit_subproblems.setPlainText(subp_output)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
app = QApplication([])
|
|
windows = MyWindow()
|
|
windows.show()
|
|
app.exec()
|
|
|