This repository has been archived on 2024-06-23. You can view files and clone it, but cannot push or open issues or pull requests.
mathdeptv2/工具v4/根据正确率选择题号.py

49 lines
1.5 KiB
Python

from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
from Ui_根据正确率选择题号 import Ui_widget
from database_tools_2 import *
class MyWindow_ndsx(QWidget,Ui_widget):
def __init__(self,database_name):
super().__init__()
self.database_name = database_name
self.setupUi(self)
self.bind()
def bind(self):
self.pushButton_exec.clicked.connect(self.exec)
def setdbname(self,string):
self.database_name = string
print(self.database_name)
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.database_name)
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()