Merge commit 'bdda463b520acc5cfa62f6c616eda0b064493e17'
This commit is contained in:
commit
12f421d9d5
|
|
@ -0,0 +1,218 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'tool_panel.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QHBoxLayout, QMainWindow, QMenuBar,
|
||||
QPushButton, QSizePolicy, QStatusBar, QTabWidget,
|
||||
QWidget)
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
if not MainWindow.objectName():
|
||||
MainWindow.setObjectName(u"MainWindow")
|
||||
MainWindow.resize(800, 600)
|
||||
self.centralwidget = QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName(u"centralwidget")
|
||||
self.tabWidget_main = QTabWidget(self.centralwidget)
|
||||
self.tabWidget_main.setObjectName(u"tabWidget_main")
|
||||
self.tabWidget_main.setGeometry(QRect(0, 40, 800, 520))
|
||||
self.tabWidget_main.setTabShape(QTabWidget.Triangular)
|
||||
self.tab_luru = QWidget()
|
||||
self.tab_luru.setObjectName(u"tab_luru")
|
||||
self.tabWidget_luru = QTabWidget(self.tab_luru)
|
||||
self.tabWidget_luru.setObjectName(u"tabWidget_luru")
|
||||
self.tabWidget_luru.setGeometry(QRect(0, 0, 800, 490))
|
||||
self.tabWidget_luru.setTabPosition(QTabWidget.West)
|
||||
self.tabWidget_luru.setTabShape(QTabWidget.Triangular)
|
||||
self.tab_kxth = QWidget()
|
||||
self.tab_kxth.setObjectName(u"tab_kxth")
|
||||
self.tabWidget_luru.addTab(self.tab_kxth, "")
|
||||
self.tab_bdsl = QWidget()
|
||||
self.tab_bdsl.setObjectName(u"tab_bdsl")
|
||||
self.tabWidget_luru.addTab(self.tab_bdsl, "")
|
||||
self.tab_tjgl = QWidget()
|
||||
self.tab_tjgl.setObjectName(u"tab_tjgl")
|
||||
self.tabWidget_luru.addTab(self.tab_tjgl, "")
|
||||
self.tabWidget_main.addTab(self.tab_luru, "")
|
||||
self.tab_weihu = QWidget()
|
||||
self.tab_weihu.setObjectName(u"tab_weihu")
|
||||
self.tabWidget_weihu = QTabWidget(self.tab_weihu)
|
||||
self.tabWidget_weihu.setObjectName(u"tabWidget_weihu")
|
||||
self.tabWidget_weihu.setGeometry(QRect(0, 0, 800, 490))
|
||||
sizePolicy = QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.tabWidget_weihu.sizePolicy().hasHeightForWidth())
|
||||
self.tabWidget_weihu.setSizePolicy(sizePolicy)
|
||||
self.tabWidget_weihu.setTabPosition(QTabWidget.West)
|
||||
self.tabWidget_weihu.setTabShape(QTabWidget.Triangular)
|
||||
self.tab_tjzd = QWidget()
|
||||
self.tab_tjzd.setObjectName(u"tab_tjzd")
|
||||
self.tabWidget_weihu.addTab(self.tab_tjzd, "")
|
||||
self.tab_bjtm = QWidget()
|
||||
self.tab_bjtm.setObjectName(u"tab_bjtm")
|
||||
self.tabWidget_weihu.addTab(self.tab_bjtm, "")
|
||||
self.tab_xxdr = QWidget()
|
||||
self.tab_xxdr.setObjectName(u"tab_xxdr")
|
||||
self.tabWidget_weihu.addTab(self.tab_xxdr, "")
|
||||
self.tab_sddr = QWidget()
|
||||
self.tab_sddr.setObjectName(u"tab_sddr")
|
||||
self.tabWidget_weihu.addTab(self.tab_sddr, "")
|
||||
self.tab_tkdr = QWidget()
|
||||
self.tab_tkdr.setObjectName(u"tab_tkdr")
|
||||
self.tabWidget_weihu.addTab(self.tab_tkdr, "")
|
||||
self.tab_dygg = QWidget()
|
||||
self.tab_dygg.setObjectName(u"tab_dygg")
|
||||
self.tabWidget_weihu.addTab(self.tab_dygg, "")
|
||||
self.tab_tqda = QWidget()
|
||||
self.tab_tqda.setObjectName(u"tab_tqda")
|
||||
self.tabWidget_weihu.addTab(self.tab_tqda, "")
|
||||
self.tab_gxsy = QWidget()
|
||||
self.tab_gxsy.setObjectName(u"tab_gxsy")
|
||||
self.tabWidget_weihu.addTab(self.tab_gxsy, "")
|
||||
self.tab_tjjc = QWidget()
|
||||
self.tab_tjjc.setObjectName(u"tab_tjjc")
|
||||
self.tabWidget_weihu.addTab(self.tab_tjjc, "")
|
||||
self.tab_xxxz = QWidget()
|
||||
self.tab_xxxz.setObjectName(u"tab_xxxz")
|
||||
self.tabWidget_weihu.addTab(self.tab_xxxz, "")
|
||||
self.tabWidget_main.addTab(self.tab_weihu, "")
|
||||
self.tab_shiyong = QWidget()
|
||||
self.tab_shiyong.setObjectName(u"tab_shiyong")
|
||||
self.tabWidget_shiyong = QTabWidget(self.tab_shiyong)
|
||||
self.tabWidget_shiyong.setObjectName(u"tabWidget_shiyong")
|
||||
self.tabWidget_shiyong.setGeometry(QRect(0, 0, 800, 490))
|
||||
self.tabWidget_shiyong.setTabPosition(QTabWidget.West)
|
||||
self.tabWidget_shiyong.setTabShape(QTabWidget.Triangular)
|
||||
self.tab_sxth = QWidget()
|
||||
self.tab_sxth.setObjectName(u"tab_sxth")
|
||||
self.tabWidget_shiyong.addTab(self.tab_sxth, "")
|
||||
self.tab_ndsx = QWidget()
|
||||
self.tab_ndsx.setObjectName(u"tab_ndsx")
|
||||
self.tabWidget_shiyong.addTab(self.tab_ndsx, "")
|
||||
self.tab_xtby = QWidget()
|
||||
self.tab_xtby.setObjectName(u"tab_xtby")
|
||||
self.tabWidget_shiyong.addTab(self.tab_xtby, "")
|
||||
self.tab_sctp = QWidget()
|
||||
self.tab_sctp.setObjectName(u"tab_sctp")
|
||||
self.tabWidget_shiyong.addTab(self.tab_sctp, "")
|
||||
self.tab_hqth = QWidget()
|
||||
self.tab_hqth.setObjectName(u"tab_hqth")
|
||||
self.tabWidget_shiyong.addTab(self.tab_hqth, "")
|
||||
self.tabWidget_main.addTab(self.tab_shiyong, "")
|
||||
self.tab_beikezu = QWidget()
|
||||
self.tab_beikezu.setObjectName(u"tab_beikezu")
|
||||
self.tabWidget_beikezu = QTabWidget(self.tab_beikezu)
|
||||
self.tabWidget_beikezu.setObjectName(u"tabWidget_beikezu")
|
||||
self.tabWidget_beikezu.setGeometry(QRect(0, 0, 800, 490))
|
||||
self.tabWidget_beikezu.setTabPosition(QTabWidget.West)
|
||||
self.tabWidget_beikezu.setTabShape(QTabWidget.Triangular)
|
||||
self.tab_jglr = QWidget()
|
||||
self.tab_jglr.setObjectName(u"tab_jglr")
|
||||
self.tabWidget_beikezu.addTab(self.tab_jglr, "")
|
||||
self.tab_dtlr = QWidget()
|
||||
self.tab_dtlr.setObjectName(u"tab_dtlr")
|
||||
self.tabWidget_beikezu.addTab(self.tab_dtlr, "")
|
||||
self.tab_jysc = QWidget()
|
||||
self.tab_jysc.setObjectName(u"tab_jysc")
|
||||
self.tabWidget_beikezu.addTab(self.tab_jysc, "")
|
||||
self.tabWidget_main.addTab(self.tab_beikezu, "")
|
||||
self.tab_latex = QWidget()
|
||||
self.tab_latex.setObjectName(u"tab_latex")
|
||||
self.tabWidget = QTabWidget(self.tab_latex)
|
||||
self.tabWidget.setObjectName(u"tabWidget")
|
||||
self.tabWidget.setGeometry(QRect(0, 0, 800, 490))
|
||||
self.tabWidget.setTabPosition(QTabWidget.West)
|
||||
self.tabWidget.setTabShape(QTabWidget.Triangular)
|
||||
self.tab_wbzh = QWidget()
|
||||
self.tab_wbzh.setObjectName(u"tab_wbzh")
|
||||
self.tabWidget.addTab(self.tab_wbzh, "")
|
||||
self.tab_hist = QWidget()
|
||||
self.tab_hist.setObjectName(u"tab_hist")
|
||||
self.tabWidget.addTab(self.tab_hist, "")
|
||||
self.tabWidget_main.addTab(self.tab_latex, "")
|
||||
self.horizontalLayoutWidget = QWidget(self.centralwidget)
|
||||
self.horizontalLayoutWidget.setObjectName(u"horizontalLayoutWidget")
|
||||
self.horizontalLayoutWidget.setGeometry(QRect(30, 0, 741, 31))
|
||||
self.horizontalLayout = QHBoxLayout(self.horizontalLayoutWidget)
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.pushButton_tiku = QPushButton(self.horizontalLayoutWidget)
|
||||
self.pushButton_tiku.setObjectName(u"pushButton_tiku")
|
||||
|
||||
self.horizontalLayout.addWidget(self.pushButton_tiku)
|
||||
|
||||
self.pushButton_tikutest = QPushButton(self.horizontalLayoutWidget)
|
||||
self.pushButton_tikutest.setObjectName(u"pushButton_tikutest")
|
||||
|
||||
self.horizontalLayout.addWidget(self.pushButton_tikutest)
|
||||
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QMenuBar(MainWindow)
|
||||
self.menubar.setObjectName(u"menubar")
|
||||
self.menubar.setGeometry(QRect(0, 0, 800, 22))
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.statusbar = QStatusBar(MainWindow)
|
||||
self.statusbar.setObjectName(u"statusbar")
|
||||
MainWindow.setStatusBar(self.statusbar)
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
|
||||
self.tabWidget_main.setCurrentIndex(3)
|
||||
self.tabWidget_luru.setCurrentIndex(2)
|
||||
self.tabWidget_weihu.setCurrentIndex(5)
|
||||
self.tabWidget_shiyong.setCurrentIndex(4)
|
||||
self.tabWidget_beikezu.setCurrentIndex(1)
|
||||
self.tabWidget.setCurrentIndex(1)
|
||||
|
||||
|
||||
QMetaObject.connectSlotsByName(MainWindow)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"\u9898\u5e93\u5de5\u5177\u9762\u677fv4", None))
|
||||
self.tabWidget_luru.setTabText(self.tabWidget_luru.indexOf(self.tab_kxth), QCoreApplication.translate("MainWindow", u"\u7a7a\u95f2\u9898\u53f7", None))
|
||||
self.tabWidget_luru.setTabText(self.tabWidget_luru.indexOf(self.tab_bdsl), QCoreApplication.translate("MainWindow", u"\u6bd4\u5bf9\u5e76\u6536\u5f55", None))
|
||||
self.tabWidget_luru.setTabText(self.tabWidget_luru.indexOf(self.tab_tjgl), QCoreApplication.translate("MainWindow", u"\u6dfb\u52a0\u5173\u8054", None))
|
||||
self.tabWidget_main.setTabText(self.tabWidget_main.indexOf(self.tab_luru), QCoreApplication.translate("MainWindow", u"\u5f55\u5165", None))
|
||||
self.tabWidget_weihu.setTabText(self.tabWidget_weihu.indexOf(self.tab_tjzd), QCoreApplication.translate("MainWindow", u"\u6dfb\u52a0\u5b57\u6bb5\u6570\u636e", None))
|
||||
self.tabWidget_weihu.setTabText(self.tabWidget_weihu.indexOf(self.tab_bjtm), QCoreApplication.translate("MainWindow", u"\u7f16\u8f91\u9898\u76ee", None))
|
||||
self.tabWidget_weihu.setTabText(self.tabWidget_weihu.indexOf(self.tab_xxdr), QCoreApplication.translate("MainWindow", u"\u5c0f\u95f2\u5bfc\u5165", None))
|
||||
self.tabWidget_weihu.setTabText(self.tabWidget_weihu.indexOf(self.tab_sddr), QCoreApplication.translate("MainWindow", u"\u624b\u52a8\u5bfc\u5165", None))
|
||||
self.tabWidget_weihu.setTabText(self.tabWidget_weihu.indexOf(self.tab_tkdr), QCoreApplication.translate("MainWindow", u"\u7edf\u8003\u5bfc\u5165", None))
|
||||
self.tabWidget_weihu.setTabText(self.tabWidget_weihu.indexOf(self.tab_dygg), QCoreApplication.translate("MainWindow", u"\u5355\u5143\u6302\u94a9", None))
|
||||
self.tabWidget_weihu.setTabText(self.tabWidget_weihu.indexOf(self.tab_tqda), QCoreApplication.translate("MainWindow", u"\u63d0\u53d6\u7b54\u6848", None))
|
||||
self.tabWidget_weihu.setTabText(self.tabWidget_weihu.indexOf(self.tab_gxsy), QCoreApplication.translate("MainWindow", u"\u5171\u4eab\u4f7f\u7528\u8bb0\u5f55", None))
|
||||
self.tabWidget_weihu.setTabText(self.tabWidget_weihu.indexOf(self.tab_tjjc), QCoreApplication.translate("MainWindow", u"\u6dfb\u52a0\u57fa\u7840\u77e5\u8bc6", None))
|
||||
self.tabWidget_weihu.setTabText(self.tabWidget_weihu.indexOf(self.tab_xxxz), QCoreApplication.translate("MainWindow", u"\u5c0f\u95f2\u4e0b\u8f7d", None))
|
||||
self.tabWidget_main.setTabText(self.tabWidget_main.indexOf(self.tab_weihu), QCoreApplication.translate("MainWindow", u"\u7ef4\u62a4", None))
|
||||
self.tabWidget_shiyong.setTabText(self.tabWidget_shiyong.indexOf(self.tab_sxth), QCoreApplication.translate("MainWindow", u"\u5173\u952e\u5b57\u7b5b\u9009\u9898\u53f7", None))
|
||||
self.tabWidget_shiyong.setTabText(self.tabWidget_shiyong.indexOf(self.tab_ndsx), QCoreApplication.translate("MainWindow", u"\u6b63\u786e\u7387\u7b5b\u9009\u9898\u53f7", None))
|
||||
self.tabWidget_shiyong.setTabText(self.tabWidget_shiyong.indexOf(self.tab_xtby), QCoreApplication.translate("MainWindow", u"\u9009\u9898\u7f16\u8bd1", None))
|
||||
self.tabWidget_shiyong.setTabText(self.tabWidget_shiyong.indexOf(self.tab_sctp), QCoreApplication.translate("MainWindow", u"\u9898\u53f7\u751f\u6210\u56fe\u7247", None))
|
||||
self.tabWidget_shiyong.setTabText(self.tabWidget_shiyong.indexOf(self.tab_hqth), QCoreApplication.translate("MainWindow", u"\u83b7\u53d6\u9898\u53f7", None))
|
||||
self.tabWidget_main.setTabText(self.tabWidget_main.indexOf(self.tab_shiyong), QCoreApplication.translate("MainWindow", u"\u4f7f\u7528", None))
|
||||
self.tabWidget_beikezu.setTabText(self.tabWidget_beikezu.indexOf(self.tab_jglr), QCoreApplication.translate("MainWindow", u"\u8bb2\u4e49\u7ed3\u6784\u7f16\u53f7\u5f55\u5165", None))
|
||||
self.tabWidget_beikezu.setTabText(self.tabWidget_beikezu.indexOf(self.tab_dtlr), QCoreApplication.translate("MainWindow", u"\u7b54\u9898\u7eb8\u5bf9\u5e94\u4fe1\u606f\u5f55\u5165", None))
|
||||
self.tabWidget_beikezu.setTabText(self.tabWidget_beikezu.indexOf(self.tab_jysc), QCoreApplication.translate("MainWindow", u"\u7cfb\u5217\u8bb2\u4e49\u751f\u6210", None))
|
||||
self.tabWidget_main.setTabText(self.tabWidget_main.indexOf(self.tab_beikezu), QCoreApplication.translate("MainWindow", u"\u5907\u8bfe\u7ec4", None))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_wbzh), QCoreApplication.translate("MainWindow", u"\u6587\u672c\u8f6c\u6362\u5904\u7406", None))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_hist), QCoreApplication.translate("MainWindow", u"\u76f4\u65b9\u56fe\u4ee3\u7801\u751f\u6210", None))
|
||||
self.tabWidget_main.setTabText(self.tabWidget_main.indexOf(self.tab_latex), QCoreApplication.translate("MainWindow", u"LaTeX\u4ee3\u7801\u76f8\u5173", None))
|
||||
self.pushButton_tiku.setText(QCoreApplication.translate("MainWindow", u"\u6b63\u5f0f\u6570\u636e\u5e93", None))
|
||||
self.pushButton_tikutest.setText(QCoreApplication.translate("MainWindow", u"\u6d4b\u8bd5\u6570\u636e\u5e93", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '下载小闲答题数据.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QHeaderView, QLabel, QLineEdit,
|
||||
QPushButton, QSizePolicy, QTableWidget, QTableWidgetItem,
|
||||
QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.pushButton_chrome = QPushButton(Form)
|
||||
self.pushButton_chrome.setObjectName(u"pushButton_chrome")
|
||||
self.pushButton_chrome.setGeometry(QRect(130, 10, 75, 24))
|
||||
self.pushButton_driver = QPushButton(Form)
|
||||
self.pushButton_driver.setObjectName(u"pushButton_driver")
|
||||
self.pushButton_driver.setGeometry(QRect(130, 50, 75, 24))
|
||||
self.pushButton_outputfolder = QPushButton(Form)
|
||||
self.pushButton_outputfolder.setObjectName(u"pushButton_outputfolder")
|
||||
self.pushButton_outputfolder.setGeometry(QRect(130, 90, 75, 24))
|
||||
self.label_chrome = QLabel(Form)
|
||||
self.label_chrome.setObjectName(u"label_chrome")
|
||||
self.label_chrome.setGeometry(QRect(210, 10, 221, 21))
|
||||
self.label_driver = QLabel(Form)
|
||||
self.label_driver.setObjectName(u"label_driver")
|
||||
self.label_driver.setGeometry(QRect(210, 50, 221, 21))
|
||||
self.label_outputfolder = QLabel(Form)
|
||||
self.label_outputfolder.setObjectName(u"label_outputfolder")
|
||||
self.label_outputfolder.setGeometry(QRect(210, 90, 221, 21))
|
||||
self.pushButton_openbrowser = QPushButton(Form)
|
||||
self.pushButton_openbrowser.setObjectName(u"pushButton_openbrowser")
|
||||
self.pushButton_openbrowser.setGeometry(QRect(130, 130, 71, 51))
|
||||
self.pushButton_login = QPushButton(Form)
|
||||
self.pushButton_login.setObjectName(u"pushButton_login")
|
||||
self.pushButton_login.setGeometry(QRect(210, 130, 71, 51))
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(400, 130, 201, 51))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(450, 10, 54, 16))
|
||||
self.label_2 = QLabel(Form)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setGeometry(QRect(450, 50, 54, 16))
|
||||
self.label_3 = QLabel(Form)
|
||||
self.label_3.setObjectName(u"label_3")
|
||||
self.label_3.setGeometry(QRect(450, 90, 71, 16))
|
||||
self.lineEdit_startdate = QLineEdit(Form)
|
||||
self.lineEdit_startdate.setObjectName(u"lineEdit_startdate")
|
||||
self.lineEdit_startdate.setGeometry(QRect(510, 10, 91, 20))
|
||||
self.lineEdit_enddate = QLineEdit(Form)
|
||||
self.lineEdit_enddate.setObjectName(u"lineEdit_enddate")
|
||||
self.lineEdit_enddate.setGeometry(QRect(510, 50, 91, 20))
|
||||
self.lineEdit_graderegex = QLineEdit(Form)
|
||||
self.lineEdit_graderegex.setObjectName(u"lineEdit_graderegex")
|
||||
self.lineEdit_graderegex.setGeometry(QRect(530, 90, 71, 20))
|
||||
self.pushButton_getlist = QPushButton(Form)
|
||||
self.pushButton_getlist.setObjectName(u"pushButton_getlist")
|
||||
self.pushButton_getlist.setGeometry(QRect(290, 130, 101, 51))
|
||||
self.tableWidget = QTableWidget(Form)
|
||||
if (self.tableWidget.columnCount() < 2):
|
||||
self.tableWidget.setColumnCount(2)
|
||||
__qtablewidgetitem = QTableWidgetItem()
|
||||
self.tableWidget.setHorizontalHeaderItem(0, __qtablewidgetitem)
|
||||
__qtablewidgetitem1 = QTableWidgetItem()
|
||||
self.tableWidget.setHorizontalHeaderItem(1, __qtablewidgetitem1)
|
||||
self.tableWidget.setObjectName(u"tableWidget")
|
||||
self.tableWidget.setGeometry(QRect(130, 190, 471, 271))
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u4e0b\u8f7d\u5c0f\u95f2\u7b54\u9898\u7eb8", None))
|
||||
self.pushButton_chrome.setText(QCoreApplication.translate("Form", u"chrome\u8def\u5f84", None))
|
||||
self.pushButton_driver.setText(QCoreApplication.translate("Form", u"driver\u8def\u5f84", None))
|
||||
self.pushButton_outputfolder.setText(QCoreApplication.translate("Form", u"\u8f93\u51fa\u8def\u5f84", None))
|
||||
self.label_chrome.setText(QCoreApplication.translate("Form", u"\u6b64\u5904\u663e\u793achrome.exe\u7684\u8def\u5f84", None))
|
||||
self.label_driver.setText(QCoreApplication.translate("Form", u"\u6b64\u5904\u663e\u793achrome webdriver\u7684\u8def\u5f84", None))
|
||||
self.label_outputfolder.setText(QCoreApplication.translate("Form", u"\u6b64\u5904\u663e\u793a\u8f93\u51fa\u7684zip\u6587\u4ef6\u7684\u8def\u5f84", None))
|
||||
self.pushButton_openbrowser.setText(QCoreApplication.translate("Form", u"\u5f00\u542f\u6d4f\u89c8\u5668", None))
|
||||
self.pushButton_login.setText(QCoreApplication.translate("Form", u"\u767b\u5f55", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u4e0b\u8f7d\u7b54\u9898\u60c5\u51b5", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u8d77\u59cb\u65e5\u671f", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u7ec8\u6b62\u65e5\u671f", None))
|
||||
self.label_3.setText(QCoreApplication.translate("Form", u"\u5e74\u7ea7(regex)", None))
|
||||
self.lineEdit_startdate.setPlaceholderText(QCoreApplication.translate("Form", u"yyyymmdd", None))
|
||||
self.lineEdit_enddate.setPlaceholderText(QCoreApplication.translate("Form", u"yyyymmdd", None))
|
||||
self.lineEdit_graderegex.setPlaceholderText(QCoreApplication.translate("Form", u"\u9ad8[\u4e00\u4e8c]", None))
|
||||
self.pushButton_getlist.setText(QCoreApplication.translate("Form", u"\u83b7\u53d6\u7b54\u9898\u5361\u5217\u8868", None))
|
||||
___qtablewidgetitem = self.tableWidget.horizontalHeaderItem(0)
|
||||
___qtablewidgetitem.setText(QCoreApplication.translate("Form", u"\u7b54\u9898\u7eb8\u540d\u79f0", None));
|
||||
___qtablewidgetitem1 = self.tableWidget.horizontalHeaderItem(1)
|
||||
___qtablewidgetitem1.setText(QCoreApplication.translate("Form", u"\u5df2\u4e0b\u8f7d", None));
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '修改metadata.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QPushButton, QSizePolicy, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(220, 190, 321, 101))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u4fee\u6539metadata", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u4fee\u6539metadata", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '共享使用记录.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QPushButton, QSizePolicy, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(270, 170, 251, 131))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u5171\u4eab\u4f7f\u7528\u8bb0\u5f55", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u76f8\u540c\u9898\u76ee\u5171\u4eab\u4f7f\u7528\u8bb0\u5f55", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '单一题号转为图片.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QLabel, QLineEdit, QPushButton,
|
||||
QSizePolicy, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(240, 160, 31, 16))
|
||||
self.lineEdit_ID = QLineEdit(Form)
|
||||
self.lineEdit_ID.setObjectName(u"lineEdit_ID")
|
||||
self.lineEdit_ID.setGeometry(QRect(270, 160, 71, 20))
|
||||
self.label_2 = QLabel(Form)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setGeometry(QRect(240, 190, 31, 16))
|
||||
self.lineEdit_dpi = QLineEdit(Form)
|
||||
self.lineEdit_dpi.setObjectName(u"lineEdit_dpi")
|
||||
self.lineEdit_dpi.setGeometry(QRect(270, 190, 71, 20))
|
||||
self.pushButton_convert = QPushButton(Form)
|
||||
self.pushButton_convert.setObjectName(u"pushButton_convert")
|
||||
self.pushButton_convert.setGeometry(QRect(350, 160, 75, 51))
|
||||
self.pushButton_open = QPushButton(Form)
|
||||
self.pushButton_open.setObjectName(u"pushButton_open")
|
||||
self.pushButton_open.setGeometry(QRect(430, 160, 75, 51))
|
||||
self.label_3 = QLabel(Form)
|
||||
self.label_3.setObjectName(u"label_3")
|
||||
self.label_3.setGeometry(QRect(240, 220, 51, 16))
|
||||
self.lineEdit_message = QLineEdit(Form)
|
||||
self.lineEdit_message.setObjectName(u"lineEdit_message")
|
||||
self.lineEdit_message.setGeometry(QRect(300, 220, 201, 20))
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u5355\u4e00\u9898\u53f7\u8f6c\u4e3a\u56fe\u7247", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u9898\u53f7", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"DPI", None))
|
||||
self.pushButton_convert.setText(QCoreApplication.translate("Form", u"\u8f6c\u6362", None))
|
||||
self.pushButton_open.setText(QCoreApplication.translate("Form", u"\u6253\u5f00", None))
|
||||
self.label_3.setText(QCoreApplication.translate("Form", u"\u9644\u52a0\u6587\u5b57", None))
|
||||
self.lineEdit_message.setPlaceholderText(QCoreApplication.translate("Form", u"\u8f93\u5165\u9644\u52a0\u6587\u5b57, \u7559\u7a7a\u8868\u793a\u65e0\u9644\u52a0\u6587\u5b57", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '单元挂钩.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QLabel, QLineEdit, QPushButton,
|
||||
QRadioButton, QSizePolicy, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(200, 190, 54, 16))
|
||||
self.radioButton_phase2 = QRadioButton(Form)
|
||||
self.radioButton_phase2.setObjectName(u"radioButton_phase2")
|
||||
self.radioButton_phase2.setGeometry(QRect(200, 240, 191, 20))
|
||||
self.lineEdit_ids = QLineEdit(Form)
|
||||
self.lineEdit_ids.setObjectName(u"lineEdit_ids")
|
||||
self.lineEdit_ids.setGeometry(QRect(200, 210, 271, 20))
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(490, 160, 71, 111))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
self.radioButton_phase1 = QRadioButton(Form)
|
||||
self.radioButton_phase1.setObjectName(u"radioButton_phase1")
|
||||
self.radioButton_phase1.setGeometry(QRect(200, 170, 141, 20))
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u5355\u5143\u6302\u94a9", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u9898\u53f7", None))
|
||||
self.radioButton_phase2.setText(QCoreApplication.translate("Form", u"\u6536\u5f55\u5355\u5143\u4fe1\u606f\u81f3metadata\u9636\u6bb5", None))
|
||||
self.lineEdit_ids.setPlaceholderText(QCoreApplication.translate("Form", u"\u8f93\u5165\u9898\u53f7, \u7559\u7a7a\u8868\u793a\u9488\u5bf9\u6240\u6709\u6ca1\u6709\u5bf9\u5e94\u5355\u5143\u7684\u9898\u76ee", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u8fd0\u884c", None))
|
||||
self.radioButton_phase1.setText(QCoreApplication.translate("Form", u"\u81ea\u9002\u5e94\u8d4b\u4e88\u5355\u5143\u4fe1\u606f", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '寻找空闲题号.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QFrame, QLabel, QPushButton,
|
||||
QSizePolicy, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.label_used = QLabel(Form)
|
||||
self.label_used.setObjectName(u"label_used")
|
||||
self.label_used.setGeometry(QRect(20, 50, 260, 401))
|
||||
self.label_used.setFrameShape(QFrame.StyledPanel)
|
||||
self.label_used.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
|
||||
self.label_available = QLabel(Form)
|
||||
self.label_available.setObjectName(u"label_available")
|
||||
self.label_available.setGeometry(QRect(290, 50, 260, 401))
|
||||
self.label_available.setFrameShape(QFrame.StyledPanel)
|
||||
self.label_available.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(30, 20, 71, 16))
|
||||
self.label_2 = QLabel(Form)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setGeometry(QRect(290, 20, 71, 16))
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(570, 50, 141, 401))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u5bfb\u627e\u7a7a\u95f2\u9898\u53f7", None))
|
||||
self.label_used.setText(QCoreApplication.translate("Form", u"TextLabel", None))
|
||||
self.label_available.setText(QCoreApplication.translate("Form", u"TextLabel", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u5df2\u4f7f\u7528\u9898\u53f7", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u7a7a\u95f2\u9898\u53f7", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u751f\u6210\u5df2\u4f7f\u7528\u9898\u53f7\u5217\u8868\n"
|
||||
"\u53ca\u7a7a\u95f2\u9898\u53f7\u5217\u8868", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '手动统计结果导入.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QLabel, QPlainTextEdit, QPushButton,
|
||||
QSizePolicy, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.plainTextEdit = QPlainTextEdit(Form)
|
||||
self.plainTextEdit.setObjectName(u"plainTextEdit")
|
||||
self.plainTextEdit.setEnabled(True)
|
||||
self.plainTextEdit.setGeometry(QRect(250, 150, 181, 141))
|
||||
self.plainTextEdit.setReadOnly(True)
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(250, 130, 101, 16))
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(440, 130, 75, 161))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u624b\u52a8\u7edf\u8ba1\u7ed3\u679c\u5bfc\u5165", None))
|
||||
self.plainTextEdit.setPlainText(QCoreApplication.translate("Form", u"[BEGIN]\n"
|
||||
"##20240101\n"
|
||||
"**2026\u5c4a\u9ad8\u4e0001\u73ed\n"
|
||||
"1 0.875\n"
|
||||
"10001 0.825 0.630\n"
|
||||
"[END]", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u624b\u52a8\u7edf\u8ba1\u7ed3\u679c\u6a21\u677f", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u5bfc\u5165\u4e3a\n"
|
||||
"metadata", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '批量收录新题.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QCheckBox, QHBoxLayout, QLabel,
|
||||
QLineEdit, QPlainTextEdit, QPushButton, QSizePolicy,
|
||||
QSplitter, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.plainTextEdit_raw = QPlainTextEdit(Form)
|
||||
self.plainTextEdit_raw.setObjectName(u"plainTextEdit_raw")
|
||||
self.plainTextEdit_raw.setGeometry(QRect(10, 30, 281, 441))
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(20, 10, 251, 16))
|
||||
self.pushButton_step1 = QPushButton(Form)
|
||||
self.pushButton_step1.setObjectName(u"pushButton_step1")
|
||||
self.pushButton_step1.setGeometry(QRect(300, 50, 70, 400))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_step1.setFont(font)
|
||||
self.label_2 = QLabel(Form)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setGeometry(QRect(360, 10, 321, 16))
|
||||
self.plainTextEdit_compared = QPlainTextEdit(Form)
|
||||
self.plainTextEdit_compared.setObjectName(u"plainTextEdit_compared")
|
||||
self.plainTextEdit_compared.setGeometry(QRect(380, 30, 281, 301))
|
||||
self.pushButton_step2 = QPushButton(Form)
|
||||
self.pushButton_step2.setObjectName(u"pushButton_step2")
|
||||
self.pushButton_step2.setGeometry(QRect(670, 50, 70, 400))
|
||||
self.pushButton_step2.setFont(font)
|
||||
self.splitter = QSplitter(Form)
|
||||
self.splitter.setObjectName(u"splitter")
|
||||
self.splitter.setGeometry(QRect(380, 340, 281, 131))
|
||||
self.splitter.setOrientation(Qt.Vertical)
|
||||
self.layoutWidget = QWidget(self.splitter)
|
||||
self.layoutWidget.setObjectName(u"layoutWidget")
|
||||
self.horizontalLayout = QHBoxLayout(self.layoutWidget)
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_3 = QLabel(self.layoutWidget)
|
||||
self.label_3.setObjectName(u"label_3")
|
||||
|
||||
self.horizontalLayout.addWidget(self.label_3)
|
||||
|
||||
self.lineEdit_startingid = QLineEdit(self.layoutWidget)
|
||||
self.lineEdit_startingid.setObjectName(u"lineEdit_startingid")
|
||||
self.lineEdit_startingid.setDragEnabled(False)
|
||||
self.lineEdit_startingid.setReadOnly(False)
|
||||
|
||||
self.horizontalLayout.addWidget(self.lineEdit_startingid)
|
||||
|
||||
self.splitter.addWidget(self.layoutWidget)
|
||||
self.layoutWidget_2 = QWidget(self.splitter)
|
||||
self.layoutWidget_2.setObjectName(u"layoutWidget_2")
|
||||
self.horizontalLayout_2 = QHBoxLayout(self.layoutWidget_2)
|
||||
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
|
||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_4 = QLabel(self.layoutWidget_2)
|
||||
self.label_4.setObjectName(u"label_4")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.label_4)
|
||||
|
||||
self.lineEdit_editor = QLineEdit(self.layoutWidget_2)
|
||||
self.lineEdit_editor.setObjectName(u"lineEdit_editor")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.lineEdit_editor)
|
||||
|
||||
self.splitter.addWidget(self.layoutWidget_2)
|
||||
self.layoutWidget_3 = QWidget(self.splitter)
|
||||
self.layoutWidget_3.setObjectName(u"layoutWidget_3")
|
||||
self.horizontalLayout_3 = QHBoxLayout(self.layoutWidget_3)
|
||||
self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
|
||||
self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_5 = QLabel(self.layoutWidget_3)
|
||||
self.label_5.setObjectName(u"label_5")
|
||||
|
||||
self.horizontalLayout_3.addWidget(self.label_5)
|
||||
|
||||
self.lineEdit_origin = QLineEdit(self.layoutWidget_3)
|
||||
self.lineEdit_origin.setObjectName(u"lineEdit_origin")
|
||||
|
||||
self.horizontalLayout_3.addWidget(self.lineEdit_origin)
|
||||
|
||||
self.splitter.addWidget(self.layoutWidget_3)
|
||||
self.layoutWidget_4 = QWidget(self.splitter)
|
||||
self.layoutWidget_4.setObjectName(u"layoutWidget_4")
|
||||
self.horizontalLayout_4 = QHBoxLayout(self.layoutWidget_4)
|
||||
self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
|
||||
self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_6 = QLabel(self.layoutWidget_4)
|
||||
self.label_6.setObjectName(u"label_6")
|
||||
|
||||
self.horizontalLayout_4.addWidget(self.label_6)
|
||||
|
||||
self.lineEdit_suffix = QLineEdit(self.layoutWidget_4)
|
||||
self.lineEdit_suffix.setObjectName(u"lineEdit_suffix")
|
||||
self.lineEdit_suffix.setEnabled(False)
|
||||
|
||||
self.horizontalLayout_4.addWidget(self.lineEdit_suffix)
|
||||
|
||||
self.checkBox_suffix = QCheckBox(self.layoutWidget_4)
|
||||
self.checkBox_suffix.setObjectName(u"checkBox_suffix")
|
||||
|
||||
self.horizontalLayout_4.addWidget(self.checkBox_suffix)
|
||||
|
||||
self.splitter.addWidget(self.layoutWidget_4)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u6279\u91cf\u6536\u5f55\u65b0\u9898", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u8981\u5904\u7406\u7684\u9898\u76ee(\u6309 item \u5207\u5206, \u53ef\u4ee5\u5305\u542b\u6587\u4ef6\u5934)", None))
|
||||
self.pushButton_step1.setText(QCoreApplication.translate("Form", u"\u65b0\u9898\u6bd4\u5bf9", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u542b\u6709\u76f8\u4f3c\u9898\u76ee\u7684LaTeX\u6e90\u4ee3\u7801, \u590d\u5236\u5230LaTeX\u7f16\u8f91\u5668\u4eba\u5de5\u6807\u6ce8", None))
|
||||
self.pushButton_step2.setText(QCoreApplication.translate("Form", u"\u6536\u5f55\u9898\u76ee", None))
|
||||
self.label_3.setText(QCoreApplication.translate("Form", u"\u8d77\u59cbID", None))
|
||||
self.lineEdit_startingid.setInputMask("")
|
||||
self.lineEdit_startingid.setPlaceholderText(QCoreApplication.translate("Form", u"\u6570\u5b57\u9898\u53f7(\u901a\u5e38\u662f10000n+1)", None))
|
||||
self.label_4.setText(QCoreApplication.translate("Form", u"\u7f16\u8f91\u8005", None))
|
||||
self.lineEdit_editor.setPlaceholderText(QCoreApplication.translate("Form", u"\u7f16\u8f91\u8005\u59d3\u540d", None))
|
||||
self.label_5.setText(QCoreApplication.translate("Form", u"\u6765\u6e90", None))
|
||||
self.lineEdit_origin.setText(QCoreApplication.translate("Form", u"\u81ea\u62df\u9898\u76ee", None))
|
||||
self.lineEdit_origin.setPlaceholderText(QCoreApplication.translate("Form", u"\u9898\u76ee\u6765\u6e90, \u901a\u5e38\u4e3a \u81ea\u62df\u9898\u76ee", None))
|
||||
self.label_6.setText(QCoreApplication.translate("Form", u"\u540e\u7f00", None))
|
||||
self.lineEdit_suffix.setText(QCoreApplication.translate("Form", u"\u8bd5\u9898", None))
|
||||
self.lineEdit_suffix.setPlaceholderText(QCoreApplication.translate("Form", u"\u901a\u5e38\u4e3a \u8bd5\u9898", None))
|
||||
self.checkBox_suffix.setText(QCoreApplication.translate("Form", u"\u4f7f\u7528\u540e\u7f00", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,256 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '指定题号编译pdf.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QCheckBox, QHBoxLayout, QLabel,
|
||||
QLineEdit, QPlainTextEdit, QPushButton, QRadioButton,
|
||||
QSizePolicy, QVBoxLayout, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(500, 279, 221, 131))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
self.label_3 = QLabel(Form)
|
||||
self.label_3.setObjectName(u"label_3")
|
||||
self.label_3.setGeometry(QRect(300, 79, 61, 16))
|
||||
self.lineEdit_path = QLineEdit(Form)
|
||||
self.lineEdit_path.setObjectName(u"lineEdit_path")
|
||||
self.lineEdit_path.setGeometry(QRect(300, 99, 421, 20))
|
||||
self.pushButton_SelectPath = QPushButton(Form)
|
||||
self.pushButton_SelectPath.setObjectName(u"pushButton_SelectPath")
|
||||
self.pushButton_SelectPath.setGeometry(QRect(640, 69, 81, 24))
|
||||
self.verticalLayoutWidget = QWidget(Form)
|
||||
self.verticalLayoutWidget.setObjectName(u"verticalLayoutWidget")
|
||||
self.verticalLayoutWidget.setGeometry(QRect(300, 139, 81, 271))
|
||||
self.verticalLayout = QVBoxLayout(self.verticalLayoutWidget)
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_4 = QLabel(self.verticalLayoutWidget)
|
||||
self.label_4.setObjectName(u"label_4")
|
||||
self.label_4.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignVCenter)
|
||||
|
||||
self.verticalLayout.addWidget(self.label_4)
|
||||
|
||||
self.radioButton_student = QRadioButton(self.verticalLayoutWidget)
|
||||
self.radioButton_student.setObjectName(u"radioButton_student")
|
||||
self.radioButton_student.setChecked(True)
|
||||
|
||||
self.verticalLayout.addWidget(self.radioButton_student)
|
||||
|
||||
self.radioButton_teacher = QRadioButton(self.verticalLayoutWidget)
|
||||
self.radioButton_teacher.setObjectName(u"radioButton_teacher")
|
||||
|
||||
self.verticalLayout.addWidget(self.radioButton_teacher)
|
||||
|
||||
self.verticalLayoutWidget_2 = QWidget(Form)
|
||||
self.verticalLayoutWidget_2.setObjectName(u"verticalLayoutWidget_2")
|
||||
self.verticalLayoutWidget_2.setGeometry(QRect(400, 139, 91, 271))
|
||||
self.verticalLayout_2 = QVBoxLayout(self.verticalLayoutWidget_2)
|
||||
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
|
||||
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_5 = QLabel(self.verticalLayoutWidget_2)
|
||||
self.label_5.setObjectName(u"label_5")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.label_5)
|
||||
|
||||
self.checkBox_space = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_space.setObjectName(u"checkBox_space")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_space)
|
||||
|
||||
self.checkBox_ans = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_ans.setObjectName(u"checkBox_ans")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_ans)
|
||||
|
||||
self.checkBox_objs = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_objs.setObjectName(u"checkBox_objs")
|
||||
self.checkBox_objs.setCheckable(True)
|
||||
self.checkBox_objs.setTristate(False)
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_objs)
|
||||
|
||||
self.checkBox_tags = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_tags.setObjectName(u"checkBox_tags")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_tags)
|
||||
|
||||
self.checkBox_solution = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_solution.setObjectName(u"checkBox_solution")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_solution)
|
||||
|
||||
self.checkBox_usages = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_usages.setObjectName(u"checkBox_usages")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_usages)
|
||||
|
||||
self.checkBox_origin = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_origin.setObjectName(u"checkBox_origin")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_origin)
|
||||
|
||||
self.checkBox_remark = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_remark.setObjectName(u"checkBox_remark")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_remark)
|
||||
|
||||
self.verticalLayoutWidget_3 = QWidget(Form)
|
||||
self.verticalLayoutWidget_3.setObjectName(u"verticalLayoutWidget_3")
|
||||
self.verticalLayoutWidget_3.setGeometry(QRect(500, 139, 222, 121))
|
||||
self.verticalLayout_usagepanel = QVBoxLayout(self.verticalLayoutWidget_3)
|
||||
self.verticalLayout_usagepanel.setObjectName(u"verticalLayout_usagepanel")
|
||||
self.verticalLayout_usagepanel.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_6 = QLabel(self.verticalLayoutWidget_3)
|
||||
self.label_6.setObjectName(u"label_6")
|
||||
|
||||
self.verticalLayout_usagepanel.addWidget(self.label_6)
|
||||
|
||||
self.horizontalLayout = QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.label_9 = QLabel(self.verticalLayoutWidget_3)
|
||||
self.label_9.setObjectName(u"label_9")
|
||||
|
||||
self.horizontalLayout.addWidget(self.label_9)
|
||||
|
||||
self.lineEdit_high = QLineEdit(self.verticalLayoutWidget_3)
|
||||
self.lineEdit_high.setObjectName(u"lineEdit_high")
|
||||
self.lineEdit_high.setEnabled(True)
|
||||
|
||||
self.horizontalLayout.addWidget(self.lineEdit_high)
|
||||
|
||||
self.label_10 = QLabel(self.verticalLayoutWidget_3)
|
||||
self.label_10.setObjectName(u"label_10")
|
||||
|
||||
self.horizontalLayout.addWidget(self.label_10)
|
||||
|
||||
self.lineEdit_low = QLineEdit(self.verticalLayoutWidget_3)
|
||||
self.lineEdit_low.setObjectName(u"lineEdit_low")
|
||||
|
||||
self.horizontalLayout.addWidget(self.lineEdit_low)
|
||||
|
||||
|
||||
self.verticalLayout_usagepanel.addLayout(self.horizontalLayout)
|
||||
|
||||
self.label_7 = QLabel(self.verticalLayoutWidget_3)
|
||||
self.label_7.setObjectName(u"label_7")
|
||||
|
||||
self.verticalLayout_usagepanel.addWidget(self.label_7)
|
||||
|
||||
self.lineEdit_grades = QLineEdit(self.verticalLayoutWidget_3)
|
||||
self.lineEdit_grades.setObjectName(u"lineEdit_grades")
|
||||
|
||||
self.verticalLayout_usagepanel.addWidget(self.lineEdit_grades)
|
||||
|
||||
self.plainTextEdit_allitems = QPlainTextEdit(Form)
|
||||
self.plainTextEdit_allitems.setObjectName(u"plainTextEdit_allitems")
|
||||
self.plainTextEdit_allitems.setGeometry(QRect(30, 219, 261, 191))
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(30, 199, 54, 16))
|
||||
self.label_2 = QLabel(Form)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setGeometry(QRect(31, 50, 60, 16))
|
||||
self.plainTextEdit_newitems = QPlainTextEdit(Form)
|
||||
self.plainTextEdit_newitems.setObjectName(u"plainTextEdit_newitems")
|
||||
self.plainTextEdit_newitems.setGeometry(QRect(30, 69, 261, 71))
|
||||
self.layoutWidget = QWidget(Form)
|
||||
self.layoutWidget.setObjectName(u"layoutWidget")
|
||||
self.layoutWidget.setGeometry(QRect(40, 149, 241, 28))
|
||||
self.horizontalLayout_4 = QHBoxLayout(self.layoutWidget)
|
||||
self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
|
||||
self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
|
||||
self.pushButton_add = QPushButton(self.layoutWidget)
|
||||
self.pushButton_add.setObjectName(u"pushButton_add")
|
||||
|
||||
self.horizontalLayout_4.addWidget(self.pushButton_add)
|
||||
|
||||
self.horizontalLayout_3 = QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
|
||||
self.pushButton_delete = QPushButton(self.layoutWidget)
|
||||
self.pushButton_delete.setObjectName(u"pushButton_delete")
|
||||
|
||||
self.horizontalLayout_3.addWidget(self.pushButton_delete)
|
||||
|
||||
self.horizontalLayout_2 = QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
|
||||
self.label_11 = QLabel(self.layoutWidget)
|
||||
self.label_11.setObjectName(u"label_11")
|
||||
self.label_11.setMaximumSize(QSize(20, 16777215))
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.label_11)
|
||||
|
||||
self.lineEdit_index = QLineEdit(self.layoutWidget)
|
||||
self.lineEdit_index.setObjectName(u"lineEdit_index")
|
||||
self.lineEdit_index.setMaximumSize(QSize(20, 16777215))
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.lineEdit_index)
|
||||
|
||||
self.label_12 = QLabel(self.layoutWidget)
|
||||
self.label_12.setObjectName(u"label_12")
|
||||
self.label_12.setMaximumSize(QSize(20, 16777215))
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.label_12)
|
||||
|
||||
|
||||
self.horizontalLayout_3.addLayout(self.horizontalLayout_2)
|
||||
|
||||
|
||||
self.horizontalLayout_4.addLayout(self.horizontalLayout_3)
|
||||
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u6307\u5b9a\u9898\u53f7\u7f16\u8bd1", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u5f00\u59cb\u751f\u6210\u4e0e\u7f16\u8bd1", None))
|
||||
self.label_3.setText(QCoreApplication.translate("Form", u"\u6587\u4ef6\u8def\u5f84", None))
|
||||
self.pushButton_SelectPath.setText(QCoreApplication.translate("Form", u"\u9009\u62e9\u8def\u5f84", None))
|
||||
self.label_4.setText(QCoreApplication.translate("Form", u"\u7248\u5f0f\u9009\u62e9", None))
|
||||
self.radioButton_student.setText(QCoreApplication.translate("Form", u"\u5b66\u751f\u7248", None))
|
||||
self.radioButton_teacher.setText(QCoreApplication.translate("Form", u"\u6559\u5e08\u7248", None))
|
||||
self.label_5.setText(QCoreApplication.translate("Form", u"\u5185\u5bb9\u9009\u9879", None))
|
||||
self.checkBox_space.setText(QCoreApplication.translate("Form", u"\u9898\u540e\u7a7a\u95f4", None))
|
||||
self.checkBox_ans.setText(QCoreApplication.translate("Form", u"\u7b54\u6848", None))
|
||||
self.checkBox_objs.setText(QCoreApplication.translate("Form", u"\u8bfe\u65f6\u76ee\u6807", None))
|
||||
self.checkBox_tags.setText(QCoreApplication.translate("Form", u"\u9898\u76ee\u6807\u7b7e", None))
|
||||
self.checkBox_solution.setText(QCoreApplication.translate("Form", u"\u89e3\u7b54\u4e0e\u63d0\u793a", None))
|
||||
self.checkBox_usages.setText(QCoreApplication.translate("Form", u"\u4f7f\u7528\u8bb0\u5f55", None))
|
||||
self.checkBox_origin.setText(QCoreApplication.translate("Form", u"\u6765\u6e90", None))
|
||||
self.checkBox_remark.setText(QCoreApplication.translate("Form", u"\u5907\u6ce8", None))
|
||||
self.label_6.setText(QCoreApplication.translate("Form", u"\u4f7f\u7528\u8bb0\u5f55\u9009\u62e9(\u90fd\u7559\u7a7a\u4e3a\u5168\u663e\u793a)", None))
|
||||
self.label_9.setText(QCoreApplication.translate("Form", u"\u9ad8", None))
|
||||
self.label_10.setText(QCoreApplication.translate("Form", u"\u4f4e", None))
|
||||
self.label_7.setText(QCoreApplication.translate("Form", u"\u5c4a\u522b\u9009\u62e9(\u7528 \",\" \u5206\u9694, \u7559\u7a7a\u4e3a\u5168\u663e\u793a)", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u9898\u53f7\u5217\u8868", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u6807\u9898\u4e0e\u9898\u53f7", None))
|
||||
self.plainTextEdit_newitems.setPlaceholderText(QCoreApplication.translate("Form", u"\u5982: \u96c6\u5408: 2:30,32 \u6216 \"\u96c6\u5408\": \"2:30\", \"\u51fd\u6570\": \"5,60,71:75\"(\u53ef\u6709\u56de\u8f66)", None))
|
||||
self.pushButton_add.setText(QCoreApplication.translate("Form", u"\u6dfb\u52a0\u4e00\u9879\u6216\u591a\u9879", None))
|
||||
self.pushButton_delete.setText(QCoreApplication.translate("Form", u"\u5220\u53bb\u4e00\u9879", None))
|
||||
self.label_11.setText(QCoreApplication.translate("Form", u"\u7b2c", None))
|
||||
self.label_12.setText(QCoreApplication.translate("Form", u"\u9879", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '文件或文本框提取答案.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QLabel, QLineEdit, QPlainTextEdit,
|
||||
QPushButton, QRadioButton, QSizePolicy, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.plainTextEdit_rawString = QPlainTextEdit(Form)
|
||||
self.plainTextEdit_rawString.setObjectName(u"plainTextEdit_rawString")
|
||||
self.plainTextEdit_rawString.setGeometry(QRect(40, 100, 311, 331))
|
||||
self.lineEdit_filepath = QLineEdit(Form)
|
||||
self.lineEdit_filepath.setObjectName(u"lineEdit_filepath")
|
||||
self.lineEdit_filepath.setGeometry(QRect(40, 50, 331, 20))
|
||||
self.lineEdit_filepath.setReadOnly(True)
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(40, 30, 54, 16))
|
||||
self.label_2 = QLabel(Form)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setGeometry(QRect(40, 80, 101, 16))
|
||||
self.lineEdit_2 = QLineEdit(Form)
|
||||
self.lineEdit_2.setObjectName(u"lineEdit_2")
|
||||
self.lineEdit_2.setGeometry(QRect(492, 50, 211, 20))
|
||||
self.label_3 = QLabel(Form)
|
||||
self.label_3.setObjectName(u"label_3")
|
||||
self.label_3.setGeometry(QRect(490, 30, 54, 16))
|
||||
self.radioButton_text = QRadioButton(Form)
|
||||
self.radioButton_text.setObjectName(u"radioButton_text")
|
||||
self.radioButton_text.setGeometry(QRect(610, 90, 95, 20))
|
||||
self.radioButton_file = QRadioButton(Form)
|
||||
self.radioButton_file.setObjectName(u"radioButton_file")
|
||||
self.radioButton_file.setGeometry(QRect(610, 120, 95, 20))
|
||||
self.pushButton_selectfilepath = QPushButton(Form)
|
||||
self.pushButton_selectfilepath.setObjectName(u"pushButton_selectfilepath")
|
||||
self.pushButton_selectfilepath.setGeometry(QRect(380, 50, 101, 24))
|
||||
self.label_4 = QLabel(Form)
|
||||
self.label_4.setObjectName(u"label_4")
|
||||
self.label_4.setGeometry(QRect(360, 80, 91, 16))
|
||||
self.plainTextEdit_ans = QPlainTextEdit(Form)
|
||||
self.plainTextEdit_ans.setObjectName(u"plainTextEdit_ans")
|
||||
self.plainTextEdit_ans.setGeometry(QRect(360, 100, 241, 331))
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(610, 150, 101, 281))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u6587\u4ef6\u6216\u6587\u672c\u6846\u63d0\u53d6\u7b54\u6848", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u6587\u4ef6\u8def\u5f84", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u542b\u7b54\u6848\u7684\u6e90\u4ee3\u7801", None))
|
||||
self.lineEdit_2.setText(QCoreApplication.translate("Form", u"\u7b54\u6848: \\textcolor{blue}{", None))
|
||||
self.label_3.setText(QCoreApplication.translate("Form", u"\u7b54\u6848\u524d\u7f00", None))
|
||||
self.radioButton_text.setText(QCoreApplication.translate("Form", u"\u6587\u672c\u6846\u751f\u6210", None))
|
||||
self.radioButton_file.setText(QCoreApplication.translate("Form", u"\u6587\u4ef6\u751f\u6210", None))
|
||||
self.pushButton_selectfilepath.setText(QCoreApplication.translate("Form", u"\u9009\u62e9\u6587\u4ef6\u8def\u5f84", None))
|
||||
self.label_4.setText(QCoreApplication.translate("Form", u"\u7b54\u6848metadata", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u63d0\u53d6\u7b54\u6848", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '文本转换处理.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QLabel, QPlainTextEdit, QPushButton,
|
||||
QRadioButton, QSizePolicy, QVBoxLayout, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.plainTextEdit_origin = QPlainTextEdit(Form)
|
||||
self.plainTextEdit_origin.setObjectName(u"plainTextEdit_origin")
|
||||
self.plainTextEdit_origin.setGeometry(QRect(10, 30, 310, 430))
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(10, 10, 54, 16))
|
||||
self.label_2 = QLabel(Form)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setGeometry(QRect(430, 10, 54, 16))
|
||||
self.plainTextEdit_dest = QPlainTextEdit(Form)
|
||||
self.plainTextEdit_dest.setObjectName(u"plainTextEdit_dest")
|
||||
self.plainTextEdit_dest.setGeometry(QRect(430, 30, 310, 430))
|
||||
self.plainTextEdit_dest.setAutoFillBackground(False)
|
||||
self.plainTextEdit_dest.setReadOnly(True)
|
||||
self.pushButton_convert = QPushButton(Form)
|
||||
self.pushButton_convert.setObjectName(u"pushButton_convert")
|
||||
self.pushButton_convert.setGeometry(QRect(330, 280, 91, 71))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_convert.setFont(font)
|
||||
self.layoutWidget = QWidget(Form)
|
||||
self.layoutWidget.setObjectName(u"layoutWidget")
|
||||
self.layoutWidget.setGeometry(QRect(330, 100, 97, 126))
|
||||
self.verticalLayout = QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.radioButton_mathpix = QRadioButton(self.layoutWidget)
|
||||
self.radioButton_mathpix.setObjectName(u"radioButton_mathpix")
|
||||
|
||||
self.verticalLayout.addWidget(self.radioButton_mathpix)
|
||||
|
||||
self.radioButton_textcircled = QRadioButton(self.layoutWidget)
|
||||
self.radioButton_textcircled.setObjectName(u"radioButton_textcircled")
|
||||
|
||||
self.verticalLayout.addWidget(self.radioButton_textcircled)
|
||||
|
||||
self.radioButton_multiple = QRadioButton(self.layoutWidget)
|
||||
self.radioButton_multiple.setObjectName(u"radioButton_multiple")
|
||||
|
||||
self.verticalLayout.addWidget(self.radioButton_multiple)
|
||||
|
||||
self.radioButton_puctuations = QRadioButton(self.layoutWidget)
|
||||
self.radioButton_puctuations.setObjectName(u"radioButton_puctuations")
|
||||
|
||||
self.verticalLayout.addWidget(self.radioButton_puctuations)
|
||||
|
||||
self.radioButton_answers = QRadioButton(self.layoutWidget)
|
||||
self.radioButton_answers.setObjectName(u"radioButton_answers")
|
||||
|
||||
self.verticalLayout.addWidget(self.radioButton_answers)
|
||||
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u6587\u672c\u8f6c\u6362\u5904\u7406", None))
|
||||
self.plainTextEdit_origin.setPlaceholderText(QCoreApplication.translate("Form", u"\u5c06\u6e90\u6587\u672c \u7c98\u8d34 \u5728\u8fd9\u4e2a\u6587\u672c\u6846\u5185", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u6e90\u6587\u672c", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u76ee\u6807\u6587\u672c", None))
|
||||
self.plainTextEdit_dest.setPlaceholderText(QCoreApplication.translate("Form", u"\u6309 \u8f6c\u6362 \u4ee5\u83b7\u5f97\u76ee\u6807\u6587\u672c", None))
|
||||
self.pushButton_convert.setText(QCoreApplication.translate("Form", u"\u8f6c\u6362", None))
|
||||
self.radioButton_mathpix.setText(QCoreApplication.translate("Form", u"Mathpix", None))
|
||||
self.radioButton_textcircled.setText(QCoreApplication.translate("Form", u"\u5706\u5708\u6570\u5b57", None))
|
||||
self.radioButton_multiple.setText(QCoreApplication.translate("Form", u"\u591a\u9009\u8f6c\u586b\u7a7a", None))
|
||||
self.radioButton_puctuations.setText(QCoreApplication.translate("Form", u"\u6807\u70b9\u8f6c\u534a\u89d2", None))
|
||||
self.radioButton_answers.setText(QCoreApplication.translate("Form", u"\u5df2\u6709\u7b54\u6848\u6807\u7ea2", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '新增基础知识梳理.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QLabel, QLineEdit, QPushButton,
|
||||
QSizePolicy, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(200, 160, 91, 16))
|
||||
self.lineEdit_filepath = QLineEdit(Form)
|
||||
self.lineEdit_filepath.setObjectName(u"lineEdit_filepath")
|
||||
self.lineEdit_filepath.setGeometry(QRect(200, 180, 381, 20))
|
||||
self.lineEdit_filepath.setReadOnly(True)
|
||||
self.pushButton_selectfilepath = QPushButton(Form)
|
||||
self.pushButton_selectfilepath.setObjectName(u"pushButton_selectfilepath")
|
||||
self.pushButton_selectfilepath.setGeometry(QRect(494, 150, 91, 24))
|
||||
self.label_2 = QLabel(Form)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setGeometry(QRect(200, 210, 291, 51))
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(500, 210, 81, 51))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u65b0\u589e\u57fa\u7840\u77e5\u8bc6\u68b3\u7406", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"LaTeX\u6587\u4ef6\u4f4d\u7f6e", None))
|
||||
self.pushButton_selectfilepath.setText(QCoreApplication.translate("Form", u"\u9009\u62e9\u6587\u4ef6", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"LaTeX\u6587\u4ef6\u4e2d\u6709\u4e00\u4e2aenumerate\u73af\u5883.\n"
|
||||
"\u6bcf\u4e00\u4e2aitem\u540e\u9762\u6709\u4e00\u4e2a\u4e2d\u62ec\u53f7\u5305\u56f4\u7684\u4fe1\u606f, \u4e4b\u540e\u662f\u5185\u5bb9.\n"
|
||||
"\u4f8b\u5982: \\item [K0101/K0101001B,K0101002B] \u5185\u5bb9", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u6dfb\u52a0\u57fa\u7840\u77e5\u8bc6", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '根据正确率选择题号.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QLabel, QLineEdit, QPlainTextEdit,
|
||||
QPushButton, QSizePolicy, QVBoxLayout, QWidget)
|
||||
|
||||
class Ui_widget(object):
|
||||
def setupUi(self, widget):
|
||||
if not widget.objectName():
|
||||
widget.setObjectName(u"widget")
|
||||
widget.resize(760, 490)
|
||||
self.verticalLayoutWidget = QWidget(widget)
|
||||
self.verticalLayoutWidget.setObjectName(u"verticalLayoutWidget")
|
||||
self.verticalLayoutWidget.setGeometry(QRect(180, 10, 91, 92))
|
||||
self.verticalLayout = QVBoxLayout(self.verticalLayoutWidget)
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.label = QLabel(self.verticalLayoutWidget)
|
||||
self.label.setObjectName(u"label")
|
||||
|
||||
self.verticalLayout.addWidget(self.label)
|
||||
|
||||
self.lineEdit_startdate = QLineEdit(self.verticalLayoutWidget)
|
||||
self.lineEdit_startdate.setObjectName(u"lineEdit_startdate")
|
||||
|
||||
self.verticalLayout.addWidget(self.lineEdit_startdate)
|
||||
|
||||
self.label_2 = QLabel(self.verticalLayoutWidget)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
|
||||
self.verticalLayout.addWidget(self.label_2)
|
||||
|
||||
self.lineEdit_enddate = QLineEdit(self.verticalLayoutWidget)
|
||||
self.lineEdit_enddate.setObjectName(u"lineEdit_enddate")
|
||||
|
||||
self.verticalLayout.addWidget(self.lineEdit_enddate)
|
||||
|
||||
self.verticalLayoutWidget_2 = QWidget(widget)
|
||||
self.verticalLayoutWidget_2.setObjectName(u"verticalLayoutWidget_2")
|
||||
self.verticalLayoutWidget_2.setGeometry(QRect(280, 10, 91, 92))
|
||||
self.verticalLayout_2 = QVBoxLayout(self.verticalLayoutWidget_2)
|
||||
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
|
||||
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_3 = QLabel(self.verticalLayoutWidget_2)
|
||||
self.label_3.setObjectName(u"label_3")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.label_3)
|
||||
|
||||
self.lineEdit_lowerbound = QLineEdit(self.verticalLayoutWidget_2)
|
||||
self.lineEdit_lowerbound.setObjectName(u"lineEdit_lowerbound")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.lineEdit_lowerbound)
|
||||
|
||||
self.label_4 = QLabel(self.verticalLayoutWidget_2)
|
||||
self.label_4.setObjectName(u"label_4")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.label_4)
|
||||
|
||||
self.lineEdit_upperbound = QLineEdit(self.verticalLayoutWidget_2)
|
||||
self.lineEdit_upperbound.setObjectName(u"lineEdit_upperbound")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.lineEdit_upperbound)
|
||||
|
||||
self.verticalLayoutWidget_3 = QWidget(widget)
|
||||
self.verticalLayoutWidget_3.setObjectName(u"verticalLayoutWidget_3")
|
||||
self.verticalLayoutWidget_3.setGeometry(QRect(380, 10, 91, 92))
|
||||
self.verticalLayout_3 = QVBoxLayout(self.verticalLayoutWidget_3)
|
||||
self.verticalLayout_3.setObjectName(u"verticalLayout_3")
|
||||
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_5 = QLabel(self.verticalLayoutWidget_3)
|
||||
self.label_5.setObjectName(u"label_5")
|
||||
self.label_5.setMaximumSize(QSize(16777215, 20))
|
||||
|
||||
self.verticalLayout_3.addWidget(self.label_5)
|
||||
|
||||
self.lineEdit_classregex = QLineEdit(self.verticalLayoutWidget_3)
|
||||
self.lineEdit_classregex.setObjectName(u"lineEdit_classregex")
|
||||
|
||||
self.verticalLayout_3.addWidget(self.lineEdit_classregex)
|
||||
|
||||
self.pushButton_exec = QPushButton(widget)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(480, 10, 91, 91))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
self.label_6 = QLabel(widget)
|
||||
self.label_6.setObjectName(u"label_6")
|
||||
self.label_6.setGeometry(QRect(180, 110, 54, 16))
|
||||
self.plainTextEdit_ids = QPlainTextEdit(widget)
|
||||
self.plainTextEdit_ids.setObjectName(u"plainTextEdit_ids")
|
||||
self.plainTextEdit_ids.setGeometry(QRect(180, 130, 391, 81))
|
||||
self.plainTextEdit_ids.setReadOnly(True)
|
||||
self.label_7 = QLabel(widget)
|
||||
self.label_7.setObjectName(u"label_7")
|
||||
self.label_7.setGeometry(QRect(180, 220, 141, 16))
|
||||
self.plainTextEdit_cautionids = QPlainTextEdit(widget)
|
||||
self.plainTextEdit_cautionids.setObjectName(u"plainTextEdit_cautionids")
|
||||
self.plainTextEdit_cautionids.setGeometry(QRect(180, 240, 391, 81))
|
||||
self.plainTextEdit_cautionids.setReadOnly(True)
|
||||
self.label_8 = QLabel(widget)
|
||||
self.label_8.setObjectName(u"label_8")
|
||||
self.label_8.setGeometry(QRect(180, 330, 54, 16))
|
||||
self.plainTextEdit_subproblems = QPlainTextEdit(widget)
|
||||
self.plainTextEdit_subproblems.setObjectName(u"plainTextEdit_subproblems")
|
||||
self.plainTextEdit_subproblems.setGeometry(QRect(180, 350, 391, 111))
|
||||
self.plainTextEdit_subproblems.setReadOnly(True)
|
||||
|
||||
self.retranslateUi(widget)
|
||||
|
||||
QMetaObject.connectSlotsByName(widget)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, widget):
|
||||
widget.setWindowTitle(QCoreApplication.translate("widget", u"\u6839\u636e\u6b63\u786e\u7387\u9009\u62e9\u9898\u53f7", None))
|
||||
self.label.setText(QCoreApplication.translate("widget", u"\u8d77\u59cb\u65e5\u671f", None))
|
||||
self.lineEdit_startdate.setPlaceholderText(QCoreApplication.translate("widget", u"yyyymmdd", None))
|
||||
self.label_2.setText(QCoreApplication.translate("widget", u"\u7ec8\u6b62\u65e5\u671f", None))
|
||||
self.lineEdit_enddate.setText("")
|
||||
self.lineEdit_enddate.setPlaceholderText(QCoreApplication.translate("widget", u"yyyymmdd", None))
|
||||
self.label_3.setText(QCoreApplication.translate("widget", u"\u6b63\u786e\u7387\u4e0b\u754c", None))
|
||||
self.lineEdit_lowerbound.setPlaceholderText(QCoreApplication.translate("widget", u"\u5982: 0.5", None))
|
||||
self.label_4.setText(QCoreApplication.translate("widget", u"\u6b63\u786e\u7387\u4e0a\u754c", None))
|
||||
self.lineEdit_upperbound.setText("")
|
||||
self.lineEdit_upperbound.setPlaceholderText(QCoreApplication.translate("widget", u"\u5982: 0.73", None))
|
||||
self.label_5.setText(QCoreApplication.translate("widget", u"\u73ed\u7ea7\u6b63\u5219\u8868\u8fbe\u5f0f", None))
|
||||
self.lineEdit_classregex.setText("")
|
||||
self.lineEdit_classregex.setPlaceholderText(QCoreApplication.translate("widget", u"\u5982: 2026", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("widget", u"\u751f\u6210\u5217\u8868", None))
|
||||
self.label_6.setText(QCoreApplication.translate("widget", u"\u9898\u53f7", None))
|
||||
self.label_7.setText(QCoreApplication.translate("widget", u"\u4f7f\u7528\u8bb0\u5f55\u957f\u5ea6\u4e0d\u4e00\u81f4\u9898\u53f7", None))
|
||||
self.label_8.setText(QCoreApplication.translate("widget", u"\u5173\u6ce8\u5c0f\u9898", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '添加关联题目.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QHBoxLayout, QLabel, QLineEdit,
|
||||
QPushButton, QSizePolicy, QVBoxLayout, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(460, 120, 81, 81))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
self.layoutWidget = QWidget(Form)
|
||||
self.layoutWidget.setObjectName(u"layoutWidget")
|
||||
self.layoutWidget.setGeometry(QRect(250, 120, 196, 80))
|
||||
self.verticalLayout = QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout = QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.label = QLabel(self.layoutWidget)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setMinimumSize(QSize(60, 0))
|
||||
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
|
||||
self.lineEdit_oldids = QLineEdit(self.layoutWidget)
|
||||
self.lineEdit_oldids.setObjectName(u"lineEdit_oldids")
|
||||
|
||||
self.horizontalLayout.addWidget(self.lineEdit_oldids)
|
||||
|
||||
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
|
||||
self.horizontalLayout_2 = QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
|
||||
self.label_2 = QLabel(self.layoutWidget)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.label_2)
|
||||
|
||||
self.lineEdit_newid = QLineEdit(self.layoutWidget)
|
||||
self.lineEdit_newid.setObjectName(u"lineEdit_newid")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.lineEdit_newid)
|
||||
|
||||
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
|
||||
self.horizontalLayout_3 = QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
|
||||
self.label_3 = QLabel(self.layoutWidget)
|
||||
self.label_3.setObjectName(u"label_3")
|
||||
self.label_3.setMinimumSize(QSize(60, 0))
|
||||
|
||||
self.horizontalLayout_3.addWidget(self.label_3)
|
||||
|
||||
self.lineEdit_editor = QLineEdit(self.layoutWidget)
|
||||
self.lineEdit_editor.setObjectName(u"lineEdit_editor")
|
||||
|
||||
self.horizontalLayout_3.addWidget(self.lineEdit_editor)
|
||||
|
||||
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_3)
|
||||
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u6dfb\u52a0\u5173\u8054\u9898\u76ee", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u6dfb\u52a0\u5173\u8054\u9898\u76ee", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u65e7\u9898\u53f7", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u65b0\u8d77\u59cb\u9898\u53f7", None))
|
||||
self.label_3.setText(QCoreApplication.translate("Form", u"\u7f16\u8f91\u8005", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '生成直方图代码.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QHBoxLayout, QLabel, QLineEdit,
|
||||
QPlainTextEdit, QPushButton, QSizePolicy, QTextBrowser,
|
||||
QVBoxLayout, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.pushButton_generatexlist = QPushButton(Form)
|
||||
self.pushButton_generatexlist.setObjectName(u"pushButton_generatexlist")
|
||||
self.pushButton_generatexlist.setGeometry(QRect(10, 130, 121, 24))
|
||||
self.textBrowser = QTextBrowser(Form)
|
||||
self.textBrowser.setObjectName(u"textBrowser")
|
||||
self.textBrowser.setEnabled(False)
|
||||
self.textBrowser.setGeometry(QRect(10, 160, 121, 211))
|
||||
self.label_6 = QLabel(Form)
|
||||
self.label_6.setObjectName(u"label_6")
|
||||
self.label_6.setGeometry(QRect(140, 10, 121, 16))
|
||||
self.plainTextEdit_yinfo = QPlainTextEdit(Form)
|
||||
self.plainTextEdit_yinfo.setObjectName(u"plainTextEdit_yinfo")
|
||||
self.plainTextEdit_yinfo.setGeometry(QRect(140, 30, 521, 181))
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(670, 30, 71, 181))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
self.label_7 = QLabel(Form)
|
||||
self.label_7.setObjectName(u"label_7")
|
||||
self.label_7.setGeometry(QRect(140, 220, 71, 16))
|
||||
self.plainTextEdit_latexcode = QPlainTextEdit(Form)
|
||||
self.plainTextEdit_latexcode.setObjectName(u"plainTextEdit_latexcode")
|
||||
self.plainTextEdit_latexcode.setGeometry(QRect(140, 240, 601, 221))
|
||||
self.layoutWidget = QWidget(Form)
|
||||
self.layoutWidget.setObjectName(u"layoutWidget")
|
||||
self.layoutWidget.setGeometry(QRect(10, 10, 121, 108))
|
||||
self.verticalLayout = QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout = QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.label = QLabel(self.layoutWidget)
|
||||
self.label.setObjectName(u"label")
|
||||
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
|
||||
self.lineEdit_xmin = QLineEdit(self.layoutWidget)
|
||||
self.lineEdit_xmin.setObjectName(u"lineEdit_xmin")
|
||||
|
||||
self.horizontalLayout.addWidget(self.lineEdit_xmin)
|
||||
|
||||
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
|
||||
self.horizontalLayout_2 = QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
|
||||
self.label_2 = QLabel(self.layoutWidget)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.label_2)
|
||||
|
||||
self.lineEdit_xmax = QLineEdit(self.layoutWidget)
|
||||
self.lineEdit_xmax.setObjectName(u"lineEdit_xmax")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.lineEdit_xmax)
|
||||
|
||||
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
|
||||
self.horizontalLayout_5 = QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
|
||||
self.label_5 = QLabel(self.layoutWidget)
|
||||
self.label_5.setObjectName(u"label_5")
|
||||
|
||||
self.horizontalLayout_5.addWidget(self.label_5)
|
||||
|
||||
self.lineEdit_xwidth = QLineEdit(self.layoutWidget)
|
||||
self.lineEdit_xwidth.setObjectName(u"lineEdit_xwidth")
|
||||
|
||||
self.horizontalLayout_5.addWidget(self.lineEdit_xwidth)
|
||||
|
||||
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_5)
|
||||
|
||||
self.horizontalLayout_4 = QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
|
||||
self.label_4 = QLabel(self.layoutWidget)
|
||||
self.label_4.setObjectName(u"label_4")
|
||||
|
||||
self.horizontalLayout_4.addWidget(self.label_4)
|
||||
|
||||
self.lineEdit_xlabel = QLineEdit(self.layoutWidget)
|
||||
self.lineEdit_xlabel.setObjectName(u"lineEdit_xlabel")
|
||||
|
||||
self.horizontalLayout_4.addWidget(self.lineEdit_xlabel)
|
||||
|
||||
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_4)
|
||||
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u751f\u6210\u76f4\u65b9\u56fe\u4ee3\u7801", None))
|
||||
self.pushButton_generatexlist.setText(QCoreApplication.translate("Form", u"\u751f\u6210\u6a2a\u5750\u6807\u5e8f\u5217", None))
|
||||
self.textBrowser.setHtml(QCoreApplication.translate("Form", u"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><meta charset=\"utf-8\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"hr { height: 1px; border-width: 0; }\n"
|
||||
"li.unchecked::marker { content: \"\\2610\"; }\n"
|
||||
"li.checked::marker { content: \"\\2612\"; }\n"
|
||||
"</style></head><body style=\" font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">\u4e0d\u6539\u53d8\u6a2a\u5750\u6807\u7684\u503c, \u5728\u9017\u53f7\u540e\u8f93\u5165\u7eb5\u5750\u6807\u7684\u503c</p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">\u5982\u679c\u6807\u7b7e\u548c\u7eb5\u5750\u6807\u7684\u503c\u4e0d\u540c, \u5728\u540e\u9762\u7684\u65b9\u62ec\u53f7\u5185\u8f93\u5165\u6807\u7b7e</"
|
||||
"p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">\u5982:</p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">(10,0.02)[]</p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">(20,0.04)[a]</p>\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">(30,0.04][]</p>\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>", None))
|
||||
self.label_6.setText(QCoreApplication.translate("Form", u"\u8f93\u5165\u7eb5\u5750\u6807\u4fe1\u606f", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u751f\u6210\u4ee3\u7801", None))
|
||||
self.label_7.setText(QCoreApplication.translate("Form", u"\u76f4\u65b9\u56fe\u4ee3\u7801", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"x\u6700\u5c0f\u503c", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"x\u6700\u5927\u503c", None))
|
||||
self.label_5.setText(QCoreApplication.translate("Form", u"x\u5bbd\u5ea6", None))
|
||||
self.label_4.setText(QCoreApplication.translate("Form", u"x\u8f74label", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '答题纸对应.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QComboBox, QHBoxLayout, QLabel,
|
||||
QLineEdit, QPlainTextEdit, QPushButton, QSizePolicy,
|
||||
QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.label_2 = QLabel(Form)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setGeometry(QRect(180, 90, 81, 16))
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setEnabled(False)
|
||||
self.pushButton_exec.setGeometry(QRect(440, 140, 111, 191))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
self.layoutWidget = QWidget(Form)
|
||||
self.layoutWidget.setObjectName(u"layoutWidget")
|
||||
self.layoutWidget.setGeometry(QRect(180, 60, 371, 22))
|
||||
self.horizontalLayout = QHBoxLayout(self.layoutWidget)
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.label = QLabel(self.layoutWidget)
|
||||
self.label.setObjectName(u"label")
|
||||
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
|
||||
self.lineEdit_xiaoxianid = QLineEdit(self.layoutWidget)
|
||||
self.lineEdit_xiaoxianid.setObjectName(u"lineEdit_xiaoxianid")
|
||||
|
||||
self.horizontalLayout.addWidget(self.lineEdit_xiaoxianid)
|
||||
|
||||
self.layoutWidget1 = QWidget(Form)
|
||||
self.layoutWidget1.setObjectName(u"layoutWidget1")
|
||||
self.layoutWidget1.setGeometry(QRect(180, 110, 371, 23))
|
||||
self.horizontalLayout_2 = QHBoxLayout(self.layoutWidget1)
|
||||
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
|
||||
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_3 = QLabel(self.layoutWidget1)
|
||||
self.label_3.setObjectName(u"label_3")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.label_3)
|
||||
|
||||
self.lineEdit_structure = QLineEdit(self.layoutWidget1)
|
||||
self.lineEdit_structure.setObjectName(u"lineEdit_structure")
|
||||
self.lineEdit_structure.setMaximumSize(QSize(20, 16777215))
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.lineEdit_structure)
|
||||
|
||||
self.label_4 = QLabel(self.layoutWidget1)
|
||||
self.label_4.setObjectName(u"label_4")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.label_4)
|
||||
|
||||
self.comboBox_grade = QComboBox(self.layoutWidget1)
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.setObjectName(u"comboBox_grade")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.comboBox_grade)
|
||||
|
||||
self.label_5 = QLabel(self.layoutWidget1)
|
||||
self.label_5.setObjectName(u"label_5")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.label_5)
|
||||
|
||||
self.comboBox_semester = QComboBox(self.layoutWidget1)
|
||||
self.comboBox_semester.addItem("")
|
||||
self.comboBox_semester.addItem("")
|
||||
self.comboBox_semester.addItem("")
|
||||
self.comboBox_semester.addItem("")
|
||||
self.comboBox_semester.addItem("")
|
||||
self.comboBox_semester.addItem("")
|
||||
self.comboBox_semester.addItem("")
|
||||
self.comboBox_semester.setObjectName(u"comboBox_semester")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.comboBox_semester)
|
||||
|
||||
self.label_6 = QLabel(self.layoutWidget1)
|
||||
self.label_6.setObjectName(u"label_6")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.label_6)
|
||||
|
||||
self.comboBox_index = QComboBox(self.layoutWidget1)
|
||||
self.comboBox_index.setObjectName(u"comboBox_index")
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.comboBox_index)
|
||||
|
||||
self.plainTextEdit_marks = QPlainTextEdit(Form)
|
||||
self.plainTextEdit_marks.setObjectName(u"plainTextEdit_marks")
|
||||
self.plainTextEdit_marks.setGeometry(QRect(180, 160, 251, 171))
|
||||
self.label_7 = QLabel(Form)
|
||||
self.label_7.setObjectName(u"label_7")
|
||||
self.label_7.setGeometry(QRect(180, 140, 111, 16))
|
||||
self.label_next = QLabel(Form)
|
||||
self.label_next.setObjectName(u"label_next")
|
||||
self.label_next.setGeometry(QRect(180, 340, 161, 16))
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u7b54\u9898\u7eb8\u5bf9\u5e94", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u5bf9\u5e94\u8bb2\u4e49\u4ee3\u7801", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u6dfb\u52a0\u7b54\u9898\u7eb8\u5bf9\u5e94", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u5c0f\u95f2\u8bd5\u5377ID", None))
|
||||
self.label_3.setText(QCoreApplication.translate("Form", u"\u7c7b\u578b", None))
|
||||
self.label_4.setText(QCoreApplication.translate("Form", u"\u5c4a\u522b", None))
|
||||
self.comboBox_grade.setItemText(0, QCoreApplication.translate("Form", u"2022", None))
|
||||
self.comboBox_grade.setItemText(1, QCoreApplication.translate("Form", u"2023", None))
|
||||
self.comboBox_grade.setItemText(2, QCoreApplication.translate("Form", u"2024", None))
|
||||
self.comboBox_grade.setItemText(3, QCoreApplication.translate("Form", u"2025", None))
|
||||
self.comboBox_grade.setItemText(4, QCoreApplication.translate("Form", u"2026", None))
|
||||
self.comboBox_grade.setItemText(5, QCoreApplication.translate("Form", u"2027", None))
|
||||
self.comboBox_grade.setItemText(6, QCoreApplication.translate("Form", u"2028", None))
|
||||
self.comboBox_grade.setItemText(7, QCoreApplication.translate("Form", u"2029", None))
|
||||
|
||||
self.label_5.setText(QCoreApplication.translate("Form", u"\u5b66\u671f", None))
|
||||
self.comboBox_semester.setItemText(0, QCoreApplication.translate("Form", u"00", None))
|
||||
self.comboBox_semester.setItemText(1, QCoreApplication.translate("Form", u"01", None))
|
||||
self.comboBox_semester.setItemText(2, QCoreApplication.translate("Form", u"02", None))
|
||||
self.comboBox_semester.setItemText(3, QCoreApplication.translate("Form", u"03", None))
|
||||
self.comboBox_semester.setItemText(4, QCoreApplication.translate("Form", u"04", None))
|
||||
self.comboBox_semester.setItemText(5, QCoreApplication.translate("Form", u"05", None))
|
||||
self.comboBox_semester.setItemText(6, QCoreApplication.translate("Form", u"06", None))
|
||||
|
||||
self.label_6.setText(QCoreApplication.translate("Form", u"\u5e8f\u53f7", None))
|
||||
self.plainTextEdit_marks.setPlaceholderText(QCoreApplication.translate("Form", u"\u5c06\u5c0f\u95f2\u5e73\u53f0\u7b54\u9898\u7eb8 \u4fee\u6539 \u754c\u9762\u4e2d\u95f4\u9760\u53f3\u7684\u6240\u6709\u5206\u6570\u590d\u5236\u5230\u8be5\u6587\u672c\u6846, \u7559\u7a7a\u8868\u793a\u5747\u4e3a1\u5206", None))
|
||||
self.label_7.setText(QCoreApplication.translate("Form", u"\u5c0f\u95f2\u5e73\u53f0\u5404\u9898\u6ee1\u5206", None))
|
||||
self.label_next.setText(QCoreApplication.translate("Form", u"\u8bf7\u5230\u7ec8\u7aef\u5b8c\u6210\u4e4b\u540e\u7684\u64cd\u4f5c", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,229 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '系列讲义生成.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QCheckBox, QHBoxLayout, QLabel,
|
||||
QLineEdit, QPushButton, QRadioButton, QSizePolicy,
|
||||
QVBoxLayout, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.lineEdit_regex = QLineEdit(Form)
|
||||
self.lineEdit_regex.setObjectName(u"lineEdit_regex")
|
||||
self.lineEdit_regex.setGeometry(QRect(120, 60, 431, 20))
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(30, 60, 91, 16))
|
||||
self.label_2 = QLabel(Form)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setGeometry(QRect(570, 60, 171, 16))
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(510, 310, 221, 131))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
self.label_3 = QLabel(Form)
|
||||
self.label_3.setObjectName(u"label_3")
|
||||
self.label_3.setGeometry(QRect(30, 90, 61, 16))
|
||||
self.lineEdit_path = QLineEdit(Form)
|
||||
self.lineEdit_path.setObjectName(u"lineEdit_path")
|
||||
self.lineEdit_path.setGeometry(QRect(30, 110, 701, 20))
|
||||
self.pushButton_SelectPath = QPushButton(Form)
|
||||
self.pushButton_SelectPath.setObjectName(u"pushButton_SelectPath")
|
||||
self.pushButton_SelectPath.setGeometry(QRect(660, 80, 75, 24))
|
||||
self.verticalLayoutWidget = QWidget(Form)
|
||||
self.verticalLayoutWidget.setObjectName(u"verticalLayoutWidget")
|
||||
self.verticalLayoutWidget.setGeometry(QRect(30, 170, 81, 111))
|
||||
self.verticalLayout = QVBoxLayout(self.verticalLayoutWidget)
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_4 = QLabel(self.verticalLayoutWidget)
|
||||
self.label_4.setObjectName(u"label_4")
|
||||
self.label_4.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignVCenter)
|
||||
|
||||
self.verticalLayout.addWidget(self.label_4)
|
||||
|
||||
self.radioButton_student = QRadioButton(self.verticalLayoutWidget)
|
||||
self.radioButton_student.setObjectName(u"radioButton_student")
|
||||
self.radioButton_student.setChecked(True)
|
||||
|
||||
self.verticalLayout.addWidget(self.radioButton_student)
|
||||
|
||||
self.radioButton_teacher = QRadioButton(self.verticalLayoutWidget)
|
||||
self.radioButton_teacher.setObjectName(u"radioButton_teacher")
|
||||
|
||||
self.verticalLayout.addWidget(self.radioButton_teacher)
|
||||
|
||||
self.verticalLayoutWidget_2 = QWidget(Form)
|
||||
self.verticalLayoutWidget_2.setObjectName(u"verticalLayoutWidget_2")
|
||||
self.verticalLayoutWidget_2.setGeometry(QRect(250, 170, 151, 271))
|
||||
self.verticalLayout_2 = QVBoxLayout(self.verticalLayoutWidget_2)
|
||||
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
|
||||
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_5 = QLabel(self.verticalLayoutWidget_2)
|
||||
self.label_5.setObjectName(u"label_5")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.label_5)
|
||||
|
||||
self.checkBox_space = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_space.setObjectName(u"checkBox_space")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_space)
|
||||
|
||||
self.checkBox_ans = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_ans.setObjectName(u"checkBox_ans")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_ans)
|
||||
|
||||
self.checkBox_objs = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_objs.setObjectName(u"checkBox_objs")
|
||||
self.checkBox_objs.setCheckable(True)
|
||||
self.checkBox_objs.setTristate(False)
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_objs)
|
||||
|
||||
self.checkBox_tags = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_tags.setObjectName(u"checkBox_tags")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_tags)
|
||||
|
||||
self.checkBox_solution = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_solution.setObjectName(u"checkBox_solution")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_solution)
|
||||
|
||||
self.checkBox_usages = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_usages.setObjectName(u"checkBox_usages")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_usages)
|
||||
|
||||
self.checkBox_origin = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_origin.setObjectName(u"checkBox_origin")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_origin)
|
||||
|
||||
self.checkBox_remark = QCheckBox(self.verticalLayoutWidget_2)
|
||||
self.checkBox_remark.setObjectName(u"checkBox_remark")
|
||||
|
||||
self.verticalLayout_2.addWidget(self.checkBox_remark)
|
||||
|
||||
self.verticalLayoutWidget_3 = QWidget(Form)
|
||||
self.verticalLayoutWidget_3.setObjectName(u"verticalLayoutWidget_3")
|
||||
self.verticalLayoutWidget_3.setGeometry(QRect(510, 170, 222, 121))
|
||||
self.verticalLayout_usagepanel = QVBoxLayout(self.verticalLayoutWidget_3)
|
||||
self.verticalLayout_usagepanel.setObjectName(u"verticalLayout_usagepanel")
|
||||
self.verticalLayout_usagepanel.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_6 = QLabel(self.verticalLayoutWidget_3)
|
||||
self.label_6.setObjectName(u"label_6")
|
||||
|
||||
self.verticalLayout_usagepanel.addWidget(self.label_6)
|
||||
|
||||
self.horizontalLayout = QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.label_9 = QLabel(self.verticalLayoutWidget_3)
|
||||
self.label_9.setObjectName(u"label_9")
|
||||
|
||||
self.horizontalLayout.addWidget(self.label_9)
|
||||
|
||||
self.lineEdit_high = QLineEdit(self.verticalLayoutWidget_3)
|
||||
self.lineEdit_high.setObjectName(u"lineEdit_high")
|
||||
self.lineEdit_high.setEnabled(True)
|
||||
|
||||
self.horizontalLayout.addWidget(self.lineEdit_high)
|
||||
|
||||
self.label_10 = QLabel(self.verticalLayoutWidget_3)
|
||||
self.label_10.setObjectName(u"label_10")
|
||||
|
||||
self.horizontalLayout.addWidget(self.label_10)
|
||||
|
||||
self.lineEdit_low = QLineEdit(self.verticalLayoutWidget_3)
|
||||
self.lineEdit_low.setObjectName(u"lineEdit_low")
|
||||
|
||||
self.horizontalLayout.addWidget(self.lineEdit_low)
|
||||
|
||||
|
||||
self.verticalLayout_usagepanel.addLayout(self.horizontalLayout)
|
||||
|
||||
self.label_7 = QLabel(self.verticalLayoutWidget_3)
|
||||
self.label_7.setObjectName(u"label_7")
|
||||
|
||||
self.verticalLayout_usagepanel.addWidget(self.label_7)
|
||||
|
||||
self.lineEdit_grades = QLineEdit(self.verticalLayoutWidget_3)
|
||||
self.lineEdit_grades.setObjectName(u"lineEdit_grades")
|
||||
|
||||
self.verticalLayout_usagepanel.addWidget(self.lineEdit_grades)
|
||||
|
||||
self.verticalLayoutWidget_4 = QWidget(Form)
|
||||
self.verticalLayoutWidget_4.setObjectName(u"verticalLayoutWidget_4")
|
||||
self.verticalLayoutWidget_4.setGeometry(QRect(30, 300, 81, 141))
|
||||
self.verticalLayout_3 = QVBoxLayout(self.verticalLayoutWidget_4)
|
||||
self.verticalLayout_3.setObjectName(u"verticalLayout_3")
|
||||
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_8 = QLabel(self.verticalLayoutWidget_4)
|
||||
self.label_8.setObjectName(u"label_8")
|
||||
|
||||
self.verticalLayout_3.addWidget(self.label_8)
|
||||
|
||||
self.checkBox_singlenote = QCheckBox(self.verticalLayoutWidget_4)
|
||||
self.checkBox_singlenote.setObjectName(u"checkBox_singlenote")
|
||||
|
||||
self.verticalLayout_3.addWidget(self.checkBox_singlenote)
|
||||
|
||||
self.checkBox_seriesnote = QCheckBox(self.verticalLayoutWidget_4)
|
||||
self.checkBox_seriesnote.setObjectName(u"checkBox_seriesnote")
|
||||
self.checkBox_seriesnote.setChecked(True)
|
||||
|
||||
self.verticalLayout_3.addWidget(self.checkBox_seriesnote)
|
||||
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u7cfb\u5217\u8bb2\u4e49\u751f\u6210", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u8bb2\u4e49\u7f16\u53f7\u8868\u8fbe\u5f0f", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u7528 \",\" \u5206\u9694\u7684\u4e00\u7cfb\u5217\u6b63\u5219\u8868\u8fbe\u5f0f", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u5f00\u59cb\u751f\u6210\u4e0e\u7f16\u8bd1", None))
|
||||
self.label_3.setText(QCoreApplication.translate("Form", u"\u6587\u4ef6\u8def\u5f84", None))
|
||||
self.pushButton_SelectPath.setText(QCoreApplication.translate("Form", u"\u9009\u62e9\u8def\u5f84", None))
|
||||
self.label_4.setText(QCoreApplication.translate("Form", u"\u7248\u5f0f\u9009\u62e9", None))
|
||||
self.radioButton_student.setText(QCoreApplication.translate("Form", u"\u5b66\u751f\u7248", None))
|
||||
self.radioButton_teacher.setText(QCoreApplication.translate("Form", u"\u6559\u5e08\u7248", None))
|
||||
self.label_5.setText(QCoreApplication.translate("Form", u"\u5185\u5bb9\u9009\u9879", None))
|
||||
self.checkBox_space.setText(QCoreApplication.translate("Form", u"\u9898\u540e\u7a7a\u95f4", None))
|
||||
self.checkBox_ans.setText(QCoreApplication.translate("Form", u"\u7b54\u6848", None))
|
||||
self.checkBox_objs.setText(QCoreApplication.translate("Form", u"\u8bfe\u65f6\u76ee\u6807", None))
|
||||
self.checkBox_tags.setText(QCoreApplication.translate("Form", u"\u9898\u76ee\u6807\u7b7e", None))
|
||||
self.checkBox_solution.setText(QCoreApplication.translate("Form", u"\u89e3\u7b54\u4e0e\u63d0\u793a", None))
|
||||
self.checkBox_usages.setText(QCoreApplication.translate("Form", u"\u4f7f\u7528\u8bb0\u5f55", None))
|
||||
self.checkBox_origin.setText(QCoreApplication.translate("Form", u"\u6765\u6e90", None))
|
||||
self.checkBox_remark.setText(QCoreApplication.translate("Form", u"\u5907\u6ce8", None))
|
||||
self.label_6.setText(QCoreApplication.translate("Form", u"\u4f7f\u7528\u8bb0\u5f55\u9009\u62e9(\u90fd\u7559\u7a7a\u4e3a\u5168\u663e\u793a)", None))
|
||||
self.label_9.setText(QCoreApplication.translate("Form", u"\u9ad8", None))
|
||||
self.label_10.setText(QCoreApplication.translate("Form", u"\u4f4e", None))
|
||||
self.label_7.setText(QCoreApplication.translate("Form", u"\u5c4a\u522b\u9009\u62e9(\u7528 \",\" \u5206\u9694, \u7559\u7a7a\u4e3a\u5168\u663e\u793a)", None))
|
||||
self.label_8.setText(QCoreApplication.translate("Form", u"\u7f16\u8bd1\u9009\u9879", None))
|
||||
self.checkBox_singlenote.setText(QCoreApplication.translate("Form", u"\u5355\u5f20\u7f16\u8bd1", None))
|
||||
self.checkBox_seriesnote.setText(QCoreApplication.translate("Form", u"\u5408\u96c6\u7f16\u8bd1", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,176 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '统考数据导入.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QHBoxLayout, QLabel, QLineEdit,
|
||||
QPlainTextEdit, QPushButton, QSizePolicy, QVBoxLayout,
|
||||
QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.layoutWidget = QWidget(Form)
|
||||
self.layoutWidget.setObjectName(u"layoutWidget")
|
||||
self.layoutWidget.setGeometry(QRect(120, 170, 381, 54))
|
||||
self.verticalLayout_2 = QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
|
||||
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_2 = QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
|
||||
self.label_2 = QLabel(self.layoutWidget)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setMinimumSize(QSize(180, 0))
|
||||
self.label_2.setMaximumSize(QSize(180, 16777215))
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.label_2)
|
||||
|
||||
self.pushButton_excel = QPushButton(self.layoutWidget)
|
||||
self.pushButton_excel.setObjectName(u"pushButton_excel")
|
||||
self.pushButton_excel.setMinimumSize(QSize(60, 0))
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.pushButton_excel)
|
||||
|
||||
|
||||
self.verticalLayout_2.addLayout(self.horizontalLayout_2)
|
||||
|
||||
self.lineEdit_excelfile = QLineEdit(self.layoutWidget)
|
||||
self.lineEdit_excelfile.setObjectName(u"lineEdit_excelfile")
|
||||
self.lineEdit_excelfile.setReadOnly(True)
|
||||
|
||||
self.verticalLayout_2.addWidget(self.lineEdit_excelfile)
|
||||
|
||||
self.layoutWidget_2 = QWidget(Form)
|
||||
self.layoutWidget_2.setObjectName(u"layoutWidget_2")
|
||||
self.layoutWidget_2.setGeometry(QRect(120, 260, 194, 22))
|
||||
self.horizontalLayout_4 = QHBoxLayout(self.layoutWidget_2)
|
||||
self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
|
||||
self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_4 = QLabel(self.layoutWidget_2)
|
||||
self.label_4.setObjectName(u"label_4")
|
||||
self.label_4.setMinimumSize(QSize(100, 0))
|
||||
|
||||
self.horizontalLayout_4.addWidget(self.label_4)
|
||||
|
||||
self.lineEdit_grade = QLineEdit(self.layoutWidget_2)
|
||||
self.lineEdit_grade.setObjectName(u"lineEdit_grade")
|
||||
|
||||
self.horizontalLayout_4.addWidget(self.lineEdit_grade)
|
||||
|
||||
self.layoutWidget_3 = QWidget(Form)
|
||||
self.layoutWidget_3.setObjectName(u"layoutWidget_3")
|
||||
self.layoutWidget_3.setGeometry(QRect(120, 290, 194, 22))
|
||||
self.horizontalLayout_5 = QHBoxLayout(self.layoutWidget_3)
|
||||
self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
|
||||
self.horizontalLayout_5.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_5 = QLabel(self.layoutWidget_3)
|
||||
self.label_5.setObjectName(u"label_5")
|
||||
self.label_5.setMinimumSize(QSize(100, 0))
|
||||
|
||||
self.horizontalLayout_5.addWidget(self.label_5)
|
||||
|
||||
self.lineEdit_classnum = QLineEdit(self.layoutWidget_3)
|
||||
self.lineEdit_classnum.setObjectName(u"lineEdit_classnum")
|
||||
|
||||
self.horizontalLayout_5.addWidget(self.lineEdit_classnum)
|
||||
|
||||
self.plainTextEdit = QPlainTextEdit(Form)
|
||||
self.plainTextEdit.setObjectName(u"plainTextEdit")
|
||||
self.plainTextEdit.setGeometry(QRect(510, 110, 141, 201))
|
||||
self.plainTextEdit.setReadOnly(True)
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(320, 230, 181, 81))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
self.layoutWidget1 = QWidget(Form)
|
||||
self.layoutWidget1.setObjectName(u"layoutWidget1")
|
||||
self.layoutWidget1.setGeometry(QRect(120, 110, 381, 54))
|
||||
self.verticalLayout = QVBoxLayout(self.layoutWidget1)
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout = QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.label = QLabel(self.layoutWidget1)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setMinimumSize(QSize(180, 0))
|
||||
self.label.setMaximumSize(QSize(180, 16777215))
|
||||
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
|
||||
self.pushButton_paper = QPushButton(self.layoutWidget1)
|
||||
self.pushButton_paper.setObjectName(u"pushButton_paper")
|
||||
self.pushButton_paper.setMinimumSize(QSize(60, 0))
|
||||
|
||||
self.horizontalLayout.addWidget(self.pushButton_paper)
|
||||
|
||||
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
|
||||
self.lineEdit_paperfile = QLineEdit(self.layoutWidget1)
|
||||
self.lineEdit_paperfile.setObjectName(u"lineEdit_paperfile")
|
||||
self.lineEdit_paperfile.setReadOnly(True)
|
||||
|
||||
self.verticalLayout.addWidget(self.lineEdit_paperfile)
|
||||
|
||||
self.layoutWidget2 = QWidget(Form)
|
||||
self.layoutWidget2.setObjectName(u"layoutWidget2")
|
||||
self.layoutWidget2.setGeometry(QRect(120, 230, 194, 22))
|
||||
self.horizontalLayout_3 = QHBoxLayout(self.layoutWidget2)
|
||||
self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
|
||||
self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||
self.label_3 = QLabel(self.layoutWidget2)
|
||||
self.label_3.setObjectName(u"label_3")
|
||||
self.label_3.setMinimumSize(QSize(100, 0))
|
||||
|
||||
self.horizontalLayout_3.addWidget(self.label_3)
|
||||
|
||||
self.lineEdit_date = QLineEdit(self.layoutWidget2)
|
||||
self.lineEdit_date.setObjectName(u"lineEdit_date")
|
||||
self.lineEdit_date.setMaximumSize(QSize(100, 16777215))
|
||||
|
||||
self.horizontalLayout_3.addWidget(self.lineEdit_date)
|
||||
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u7edf\u8003\u6570\u636e\u5bfc\u5165", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u7edf\u8ba1\u6587\u4ef6(.xlsx)", None))
|
||||
self.pushButton_excel.setText(QCoreApplication.translate("Form", u"\u6587\u4ef6\u9009\u62e9", None))
|
||||
self.label_4.setText(QCoreApplication.translate("Form", u"\u5e74\u7ea7", None))
|
||||
self.lineEdit_grade.setPlaceholderText(QCoreApplication.translate("Form", u"\u5982 2026\u5c4a\u9ad8\u4e00", None))
|
||||
self.label_5.setText(QCoreApplication.translate("Form", u"\u73ed\u7ea7\u6570", None))
|
||||
self.lineEdit_classnum.setPlaceholderText(QCoreApplication.translate("Form", u"\u5982 12", None))
|
||||
self.plainTextEdit.setDocumentTitle("")
|
||||
self.plainTextEdit.setPlainText(QCoreApplication.translate("Form", u"\u8bf4\u660e:\n"
|
||||
".xlsx\u6587\u4ef6\u9700\u8981\u6709\u4e00\u4e2a\u540d\u4e3a\"\u96be\u5ea6\u7edf\u8ba1\"\u7684\u6570\u636e\u8868.\n"
|
||||
"\u7b2c\u4e00\u5217\u4ece\u7b2c\u4e8c\u884c\u8d77\u4e3a\u73ed\u7ea7\u53f7, \u7b2c\u4e00\u884c\u4ece\u7b2c\u4e8c\u5217\u8d77\u4e3a\u9898\u53f7.\n"
|
||||
"\u4f8b\u5982: 1,2,3,4,5,61,62,71,72,73,8,9,101,102,...\n"
|
||||
"", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u7edf\u8003\u6570\u636e\u5bfc\u5165\n"
|
||||
"metadata.txt", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u8bd5\u5377\u6587\u4ef6(.tex\u6216.pdf)", None))
|
||||
self.pushButton_paper.setText(QCoreApplication.translate("Form", u"\u6587\u4ef6\u9009\u62e9", None))
|
||||
self.label_3.setText(QCoreApplication.translate("Form", u"\u65e5\u671f(yyyymmdd)", None))
|
||||
self.lineEdit_date.setPlaceholderText(QCoreApplication.translate("Form", u"\u5982 20240101", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '获取小闲平台使用数据.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QCheckBox, QHeaderView, QLabel,
|
||||
QLineEdit, QPushButton, QSizePolicy, QTableWidget,
|
||||
QTableWidgetItem, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.pushButton_file = QPushButton(Form)
|
||||
self.pushButton_file.setObjectName(u"pushButton_file")
|
||||
self.pushButton_file.setGeometry(QRect(620, 70, 91, 24))
|
||||
self.lineEdit_threshold = QLineEdit(Form)
|
||||
self.lineEdit_threshold.setObjectName(u"lineEdit_threshold")
|
||||
self.lineEdit_threshold.setGeometry(QRect(620, 30, 91, 20))
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(623, 10, 61, 20))
|
||||
self.pushButton_folder = QPushButton(Form)
|
||||
self.pushButton_folder.setObjectName(u"pushButton_folder")
|
||||
self.pushButton_folder.setGeometry(QRect(620, 110, 91, 24))
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(620, 270, 91, 75))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
self.tableWidget = QTableWidget(Form)
|
||||
if (self.tableWidget.columnCount() < 3):
|
||||
self.tableWidget.setColumnCount(3)
|
||||
__qtablewidgetitem = QTableWidgetItem()
|
||||
self.tableWidget.setHorizontalHeaderItem(0, __qtablewidgetitem)
|
||||
__qtablewidgetitem1 = QTableWidgetItem()
|
||||
self.tableWidget.setHorizontalHeaderItem(1, __qtablewidgetitem1)
|
||||
__qtablewidgetitem2 = QTableWidgetItem()
|
||||
self.tableWidget.setHorizontalHeaderItem(2, __qtablewidgetitem2)
|
||||
if (self.tableWidget.rowCount() < 1):
|
||||
self.tableWidget.setRowCount(1)
|
||||
self.tableWidget.setObjectName(u"tableWidget")
|
||||
self.tableWidget.setGeometry(QRect(10, 20, 600, 451))
|
||||
self.tableWidget.setRowCount(1)
|
||||
self.tableWidget.setColumnCount(3)
|
||||
self.tableWidget.horizontalHeader().setDefaultSectionSize(130)
|
||||
self.checkBox = QCheckBox(Form)
|
||||
self.checkBox.setObjectName(u"checkBox")
|
||||
self.checkBox.setGeometry(QRect(620, 230, 91, 20))
|
||||
self.pushButton_validcheck = QPushButton(Form)
|
||||
self.pushButton_validcheck.setObjectName(u"pushButton_validcheck")
|
||||
self.pushButton_validcheck.setGeometry(QRect(620, 160, 91, 51))
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None))
|
||||
self.pushButton_file.setText(QCoreApplication.translate("Form", u"\u9009\u62e9\u6587\u4ef6", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u8bbe\u5b9a\u9608\u503c", None))
|
||||
self.pushButton_folder.setText(QCoreApplication.translate("Form", u"\u9009\u62e9\u6587\u4ef6\u5939", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u5f00\u59cb\u5206\u6790", None))
|
||||
___qtablewidgetitem = self.tableWidget.horizontalHeaderItem(0)
|
||||
___qtablewidgetitem.setText(QCoreApplication.translate("Form", u"\u6587\u4ef6\u540d", None));
|
||||
___qtablewidgetitem1 = self.tableWidget.horizontalHeaderItem(1)
|
||||
___qtablewidgetitem1.setText(QCoreApplication.translate("Form", u"\u7b54\u9898\u7eb8\u540d\u79f0", None));
|
||||
___qtablewidgetitem2 = self.tableWidget.horizontalHeaderItem(2)
|
||||
___qtablewidgetitem2.setText(QCoreApplication.translate("Form", u"\u4e2d\u4f4d\u626b\u63cf\u65e5\u671f", None));
|
||||
self.checkBox.setText(QCoreApplication.translate("Form", u"Append\u6a21\u5f0f", None))
|
||||
self.pushButton_validcheck.setText(QCoreApplication.translate("Form", u"\u68c0\u67e5\u6709\u6548\u6027", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '获取题号.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QLabel, QLineEdit, QPlainTextEdit,
|
||||
QPushButton, QSizePolicy, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(10, 10, 54, 16))
|
||||
self.pushButton_selectfilepath = QPushButton(Form)
|
||||
self.pushButton_selectfilepath.setObjectName(u"pushButton_selectfilepath")
|
||||
self.pushButton_selectfilepath.setGeometry(QRect(670, 10, 75, 24))
|
||||
self.plainTextEdit = QPlainTextEdit(Form)
|
||||
self.plainTextEdit.setObjectName(u"plainTextEdit")
|
||||
self.plainTextEdit.setGeometry(QRect(10, 100, 741, 361))
|
||||
self.plainTextEdit.setReadOnly(True)
|
||||
self.lineEdit = QLineEdit(Form)
|
||||
self.lineEdit.setObjectName(u"lineEdit")
|
||||
self.lineEdit.setGeometry(QRect(10, 40, 741, 20))
|
||||
self.lineEdit.setReadOnly(True)
|
||||
self.label_2 = QLabel(Form)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setGeometry(QRect(10, 80, 54, 16))
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(670, 70, 75, 24))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u83b7\u53d6\u9898\u53f7", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u6587\u4ef6\u8def\u5f84", None))
|
||||
self.pushButton_selectfilepath.setText(QCoreApplication.translate("Form", u"\u9009\u62e9\u6587\u4ef6", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u9898\u53f7", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u83b7\u53d6\u9898\u53f7", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '讲义结构与内容录入.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QComboBox, QHBoxLayout, QLabel,
|
||||
QLineEdit, QPushButton, QSizePolicy, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(460, 200, 75, 24))
|
||||
self.layoutWidget = QWidget(Form)
|
||||
self.layoutWidget.setObjectName(u"layoutWidget")
|
||||
self.layoutWidget.setGeometry(QRect(220, 200, 221, 23))
|
||||
self.horizontalLayout = QHBoxLayout(self.layoutWidget)
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.label = QLabel(self.layoutWidget)
|
||||
self.label.setObjectName(u"label")
|
||||
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
|
||||
self.lineEdit_structure = QLineEdit(self.layoutWidget)
|
||||
self.lineEdit_structure.setObjectName(u"lineEdit_structure")
|
||||
self.lineEdit_structure.setMaximumSize(QSize(20, 16777215))
|
||||
|
||||
self.horizontalLayout.addWidget(self.lineEdit_structure)
|
||||
|
||||
self.label_2 = QLabel(self.layoutWidget)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
|
||||
self.horizontalLayout.addWidget(self.label_2)
|
||||
|
||||
self.comboBox_grade = QComboBox(self.layoutWidget)
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.addItem("")
|
||||
self.comboBox_grade.setObjectName(u"comboBox_grade")
|
||||
|
||||
self.horizontalLayout.addWidget(self.comboBox_grade)
|
||||
|
||||
self.label_3 = QLabel(self.layoutWidget)
|
||||
self.label_3.setObjectName(u"label_3")
|
||||
|
||||
self.horizontalLayout.addWidget(self.label_3)
|
||||
|
||||
self.comboBox_semester = QComboBox(self.layoutWidget)
|
||||
self.comboBox_semester.addItem("")
|
||||
self.comboBox_semester.addItem("")
|
||||
self.comboBox_semester.addItem("")
|
||||
self.comboBox_semester.addItem("")
|
||||
self.comboBox_semester.addItem("")
|
||||
self.comboBox_semester.addItem("")
|
||||
self.comboBox_semester.addItem("")
|
||||
self.comboBox_semester.setObjectName(u"comboBox_semester")
|
||||
|
||||
self.horizontalLayout.addWidget(self.comboBox_semester)
|
||||
|
||||
self.label_next = QLabel(Form)
|
||||
self.label_next.setObjectName(u"label_next")
|
||||
self.label_next.setGeometry(QRect(400, 240, 141, 16))
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u6267\u884c", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u79cd\u7c7b", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u5c4a\u522b", None))
|
||||
self.comboBox_grade.setItemText(0, QCoreApplication.translate("Form", u"2022", None))
|
||||
self.comboBox_grade.setItemText(1, QCoreApplication.translate("Form", u"2023", None))
|
||||
self.comboBox_grade.setItemText(2, QCoreApplication.translate("Form", u"2024", None))
|
||||
self.comboBox_grade.setItemText(3, QCoreApplication.translate("Form", u"2025", None))
|
||||
self.comboBox_grade.setItemText(4, QCoreApplication.translate("Form", u"2026", None))
|
||||
self.comboBox_grade.setItemText(5, QCoreApplication.translate("Form", u"2027", None))
|
||||
self.comboBox_grade.setItemText(6, QCoreApplication.translate("Form", u"2028", None))
|
||||
self.comboBox_grade.setItemText(7, QCoreApplication.translate("Form", u"2029", None))
|
||||
|
||||
self.label_3.setText(QCoreApplication.translate("Form", u"\u5b66\u671f", None))
|
||||
self.comboBox_semester.setItemText(0, QCoreApplication.translate("Form", u"00", None))
|
||||
self.comboBox_semester.setItemText(1, QCoreApplication.translate("Form", u"01", None))
|
||||
self.comboBox_semester.setItemText(2, QCoreApplication.translate("Form", u"02", None))
|
||||
self.comboBox_semester.setItemText(3, QCoreApplication.translate("Form", u"03", None))
|
||||
self.comboBox_semester.setItemText(4, QCoreApplication.translate("Form", u"04", None))
|
||||
self.comboBox_semester.setItemText(5, QCoreApplication.translate("Form", u"05", None))
|
||||
self.comboBox_semester.setItemText(6, QCoreApplication.translate("Form", u"06", None))
|
||||
|
||||
self.label_next.setText(QCoreApplication.translate("Form", u"\u8bf7\u5230\u7ec8\u7aef\u6267\u884c\u4e0b\u4e00\u6b65\u64cd\u4f5c", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '题号筛选器.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QCheckBox, QFrame, QLCDNumber,
|
||||
QLabel, QLineEdit, QPushButton, QSizePolicy,
|
||||
QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
Form.setWindowOpacity(1.000000000000000)
|
||||
self.pushButton_content = QPushButton(Form)
|
||||
self.pushButton_content.setObjectName(u"pushButton_content")
|
||||
self.pushButton_content.setGeometry(QRect(120, 30, 75, 24))
|
||||
self.pushButton_obj = QPushButton(Form)
|
||||
self.pushButton_obj.setObjectName(u"pushButton_obj")
|
||||
self.pushButton_obj.setGeometry(QRect(120, 60, 75, 24))
|
||||
self.pushButton_tag = QPushButton(Form)
|
||||
self.pushButton_tag.setObjectName(u"pushButton_tag")
|
||||
self.pushButton_tag.setGeometry(QRect(120, 90, 75, 24))
|
||||
self.pushButton_usage = QPushButton(Form)
|
||||
self.pushButton_usage.setObjectName(u"pushButton_usage")
|
||||
self.pushButton_usage.setGeometry(QRect(120, 120, 75, 24))
|
||||
self.pushButton_origin = QPushButton(Form)
|
||||
self.pushButton_origin.setObjectName(u"pushButton_origin")
|
||||
self.pushButton_origin.setGeometry(QRect(120, 150, 75, 24))
|
||||
self.pushButton_genre = QPushButton(Form)
|
||||
self.pushButton_genre.setObjectName(u"pushButton_genre")
|
||||
self.pushButton_genre.setGeometry(QRect(120, 180, 75, 24))
|
||||
self.pushButton_ans = QPushButton(Form)
|
||||
self.pushButton_ans.setObjectName(u"pushButton_ans")
|
||||
self.pushButton_ans.setGeometry(QRect(120, 210, 75, 24))
|
||||
self.pushButton_solution = QPushButton(Form)
|
||||
self.pushButton_solution.setObjectName(u"pushButton_solution")
|
||||
self.pushButton_solution.setGeometry(QRect(120, 240, 75, 24))
|
||||
self.pushButton_same = QPushButton(Form)
|
||||
self.pushButton_same.setObjectName(u"pushButton_same")
|
||||
self.pushButton_same.setGeometry(QRect(120, 270, 75, 24))
|
||||
self.pushButton_related = QPushButton(Form)
|
||||
self.pushButton_related.setObjectName(u"pushButton_related")
|
||||
self.pushButton_related.setGeometry(QRect(120, 300, 75, 24))
|
||||
self.pushButton_remark = QPushButton(Form)
|
||||
self.pushButton_remark.setObjectName(u"pushButton_remark")
|
||||
self.pushButton_remark.setGeometry(QRect(120, 330, 75, 24))
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(490, 110, 161, 91))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_exec.setFont(font)
|
||||
self.pushButton_undo = QPushButton(Form)
|
||||
self.pushButton_undo.setObjectName(u"pushButton_undo")
|
||||
self.pushButton_undo.setGeometry(QRect(120, 380, 75, 24))
|
||||
self.pushButton_clearAll = QPushButton(Form)
|
||||
self.pushButton_clearAll.setObjectName(u"pushButton_clearAll")
|
||||
self.pushButton_clearAll.setGeometry(QRect(120, 410, 75, 24))
|
||||
self.label_conditions = QLabel(Form)
|
||||
self.label_conditions.setObjectName(u"label_conditions")
|
||||
self.label_conditions.setGeometry(QRect(220, 110, 261, 331))
|
||||
self.label_conditions.setFrameShape(QFrame.StyledPanel)
|
||||
self.label_conditions.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
|
||||
self.label_conditions.setWordWrap(False)
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(220, 90, 71, 16))
|
||||
self.checkBox_not = QCheckBox(Form)
|
||||
self.checkBox_not.setObjectName(u"checkBox_not")
|
||||
self.checkBox_not.setGeometry(QRect(380, 30, 111, 20))
|
||||
self.lineEdit_SingleCondition = QLineEdit(Form)
|
||||
self.lineEdit_SingleCondition.setObjectName(u"lineEdit_SingleCondition")
|
||||
self.lineEdit_SingleCondition.setGeometry(QRect(220, 60, 261, 20))
|
||||
self.label_2 = QLabel(Form)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setGeometry(QRect(220, 30, 151, 16))
|
||||
self.label_3 = QLabel(Form)
|
||||
self.label_3.setObjectName(u"label_3")
|
||||
self.label_3.setGeometry(QRect(490, 30, 91, 16))
|
||||
self.lcdNumber_resCount = QLCDNumber(Form)
|
||||
self.lcdNumber_resCount.setObjectName(u"lcdNumber_resCount")
|
||||
self.lcdNumber_resCount.setGeometry(QRect(490, 50, 161, 51))
|
||||
self.lcdNumber_resCount.setDigitCount(6)
|
||||
self.lcdNumber_resCount.setProperty("value", 0.000000000000000)
|
||||
self.pushButton_savebuild = QPushButton(Form)
|
||||
self.pushButton_savebuild.setObjectName(u"pushButton_savebuild")
|
||||
self.pushButton_savebuild.setGeometry(QRect(490, 240, 161, 201))
|
||||
self.pushButton_savebuild.setFont(font)
|
||||
self.checkBox_Detailed = QCheckBox(Form)
|
||||
self.checkBox_Detailed.setObjectName(u"checkBox_Detailed")
|
||||
self.checkBox_Detailed.setGeometry(QRect(490, 210, 79, 20))
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u9898\u53f7\u7b5b\u9009\u5668", None))
|
||||
self.pushButton_content.setText(QCoreApplication.translate("Form", u"\u5185\u5bb9", None))
|
||||
self.pushButton_obj.setText(QCoreApplication.translate("Form", u"\u76ee\u6807\u7f16\u53f7", None))
|
||||
self.pushButton_tag.setText(QCoreApplication.translate("Form", u"\u6807\u7b7e", None))
|
||||
self.pushButton_usage.setText(QCoreApplication.translate("Form", u"\u4f7f\u7528\u8bb0\u5f55", None))
|
||||
self.pushButton_origin.setText(QCoreApplication.translate("Form", u"\u51fa\u5904", None))
|
||||
self.pushButton_genre.setText(QCoreApplication.translate("Form", u"\u9898\u76ee\u7c7b\u578b", None))
|
||||
self.pushButton_ans.setText(QCoreApplication.translate("Form", u"\u7b54\u6848", None))
|
||||
self.pushButton_solution.setText(QCoreApplication.translate("Form", u"\u89e3\u7b54\u4e0e\u63d0\u793a", None))
|
||||
self.pushButton_same.setText(QCoreApplication.translate("Form", u"\u76f8\u540c\u9898\u53f7", None))
|
||||
self.pushButton_related.setText(QCoreApplication.translate("Form", u"\u76f8\u5173\u9898\u53f7", None))
|
||||
self.pushButton_remark.setText(QCoreApplication.translate("Form", u"\u5907\u6ce8", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u8fd0\u884c", None))
|
||||
self.pushButton_undo.setText(QCoreApplication.translate("Form", u"\u64a4\u9500\u4e0a\u4e00\u4e2a", None))
|
||||
self.pushButton_clearAll.setText(QCoreApplication.translate("Form", u"\u6e05\u9664", None))
|
||||
self.label_conditions.setText("")
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u5f53\u524d\u6761\u4ef6:", None))
|
||||
self.checkBox_not.setText(QCoreApplication.translate("Form", u"\u9009\u4e2d\u8868\u793a\u4e0d\u5305\u542b", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u8f93\u5165\u6761\u4ef6, \u7528\",\"\u5206\u9694\u8868\u793a\"\u6216\"", None))
|
||||
self.label_3.setText(QCoreApplication.translate("Form", u"\u7b5b\u9009\u7ed3\u679c\u6570\u76ee:", None))
|
||||
self.pushButton_savebuild.setText(QCoreApplication.translate("Form", u"\u4fdd\u5b58\u548c\u7f16\u8bd1", None))
|
||||
self.checkBox_Detailed.setText(QCoreApplication.translate("Form", u"\u8be6\u7ec6\u4fe1\u606f", None))
|
||||
# retranslateUi
|
||||
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file '题目内容直接编辑.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.6.2
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QLabel, QLineEdit, QPlainTextEdit,
|
||||
QPushButton, QSizePolicy, QWidget)
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
if not Form.objectName():
|
||||
Form.setObjectName(u"Form")
|
||||
Form.resize(760, 490)
|
||||
self.label = QLabel(Form)
|
||||
self.label.setObjectName(u"label")
|
||||
self.label.setGeometry(QRect(60, 110, 54, 16))
|
||||
self.lineEdit_ID = QLineEdit(Form)
|
||||
self.lineEdit_ID.setObjectName(u"lineEdit_ID")
|
||||
self.lineEdit_ID.setGeometry(QRect(60, 130, 71, 20))
|
||||
self.pushButton_content = QPushButton(Form)
|
||||
self.pushButton_content.setObjectName(u"pushButton_content")
|
||||
self.pushButton_content.setGeometry(QRect(60, 160, 75, 24))
|
||||
self.pushButton_genre = QPushButton(Form)
|
||||
self.pushButton_genre.setObjectName(u"pushButton_genre")
|
||||
self.pushButton_genre.setGeometry(QRect(60, 190, 75, 24))
|
||||
self.pushButton_ans = QPushButton(Form)
|
||||
self.pushButton_ans.setObjectName(u"pushButton_ans")
|
||||
self.pushButton_ans.setGeometry(QRect(60, 220, 75, 24))
|
||||
self.pushButton_solution = QPushButton(Form)
|
||||
self.pushButton_solution.setObjectName(u"pushButton_solution")
|
||||
self.pushButton_solution.setGeometry(QRect(60, 250, 75, 24))
|
||||
self.pushButton_origin = QPushButton(Form)
|
||||
self.pushButton_origin.setObjectName(u"pushButton_origin")
|
||||
self.pushButton_origin.setGeometry(QRect(60, 280, 75, 24))
|
||||
self.pushButton_remarks = QPushButton(Form)
|
||||
self.pushButton_remarks.setObjectName(u"pushButton_remarks")
|
||||
self.pushButton_remarks.setGeometry(QRect(60, 310, 75, 24))
|
||||
self.label_2 = QLabel(Form)
|
||||
self.label_2.setObjectName(u"label_2")
|
||||
self.label_2.setGeometry(QRect(140, 110, 191, 16))
|
||||
self.plainTextEdit_toedit = QPlainTextEdit(Form)
|
||||
self.plainTextEdit_toedit.setObjectName(u"plainTextEdit_toedit")
|
||||
self.plainTextEdit_toedit.setGeometry(QRect(140, 130, 471, 201))
|
||||
self.pushButton_exec = QPushButton(Form)
|
||||
self.pushButton_exec.setObjectName(u"pushButton_exec")
|
||||
self.pushButton_exec.setGeometry(QRect(620, 130, 61, 91))
|
||||
self.pushButton_tocommit = QPushButton(Form)
|
||||
self.pushButton_tocommit.setObjectName(u"pushButton_tocommit")
|
||||
self.pushButton_tocommit.setGeometry(QRect(620, 230, 61, 101))
|
||||
font = QFont()
|
||||
font.setBold(True)
|
||||
self.pushButton_tocommit.setFont(font)
|
||||
|
||||
self.retranslateUi(Form)
|
||||
|
||||
QMetaObject.connectSlotsByName(Form)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
Form.setWindowTitle(QCoreApplication.translate("Form", u"\u9898\u5e93\u5185\u5bb9\u76f4\u63a5\u7f16\u8f91", None))
|
||||
self.label.setText(QCoreApplication.translate("Form", u"\u9898\u53f7", None))
|
||||
self.pushButton_content.setText(QCoreApplication.translate("Form", u"\u9898\u76ee\u5185\u5bb9", None))
|
||||
self.pushButton_genre.setText(QCoreApplication.translate("Form", u"\u7c7b\u578b", None))
|
||||
self.pushButton_ans.setText(QCoreApplication.translate("Form", u"\u7b54\u6848", None))
|
||||
self.pushButton_solution.setText(QCoreApplication.translate("Form", u"\u89e3\u7b54", None))
|
||||
self.pushButton_origin.setText(QCoreApplication.translate("Form", u"\u6765\u6e90", None))
|
||||
self.pushButton_remarks.setText(QCoreApplication.translate("Form", u"\u5907\u6ce8\u5217\u8868", None))
|
||||
self.label_2.setText(QCoreApplication.translate("Form", u"\u9898\u53f7\u4e3a \u7684 \u5b57\u6bb5", None))
|
||||
self.pushButton_exec.setText(QCoreApplication.translate("Form", u"\u4fee\u6539", None))
|
||||
self.pushButton_tocommit.setText(QCoreApplication.translate("Form", u"\u63d0\u4ea4", None))
|
||||
# retranslateUi
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,180 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog, QMainWindow, QVBoxLayout
|
||||
from Ui_tool_panel import Ui_MainWindow
|
||||
from PySide6.QtCore import Signal
|
||||
from 寻找空闲题号 import MyWindow_kxth
|
||||
from 生成直方图代码 import MyWindow_hist
|
||||
from 文本转换处理 import MyWindow_wbzh
|
||||
from 系列讲义生成 import MyWindow_jysc
|
||||
from 讲义结构与内容录入 import MyWindow_jglr
|
||||
from 答题纸对应 import MyWindow_dtlr
|
||||
from 获取题号 import MyWindow_hqth
|
||||
from 单一题号转为图片 import MyWindow_sctp
|
||||
from 指定题号编译pdf import MyWindow_xtby
|
||||
from 根据正确率选择题号 import MyWindow_ndsx
|
||||
from 关键字筛选题号 import MyWindow_sxth
|
||||
from 添加关联题目 import MyWindow_tjgl
|
||||
from 批量收录新题 import MyWindow_bdsl
|
||||
from 下载小闲答题数据 import MyWindow_xxxz
|
||||
from 新增基础知识梳理 import MyWindow_tjjc
|
||||
from 共享使用记录 import MyWindow_gxsy
|
||||
from 文件或文本框提取答案 import MyWindow_tqda
|
||||
from 单元挂钩 import MyWindow_dygg
|
||||
from 统考数据导入 import MyWindow_tkdr
|
||||
from 手动统计结果导入 import MyWindow_sddr
|
||||
from 获取小闲平台使用数据 import MyWindow_xxdr
|
||||
from 题目内容直接编辑 import MyWindow_bjtm
|
||||
from 修改metadata import MyWindow_tjzd
|
||||
from database_tools_2 import *
|
||||
|
||||
class MyWindow(QMainWindow,Ui_MainWindow):
|
||||
sendDBname = Signal(str) #定义一个字符串型信号
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
|
||||
def bind(self):
|
||||
self.SelectTIKUTEST()
|
||||
self.database = "tikutest"
|
||||
self.pushButton_tiku.clicked.connect(self.SelectTIKU)
|
||||
self.pushButton_tikutest.clicked.connect(self.SelectTIKUTEST) #以上为设置当前数据库的两个按钮
|
||||
|
||||
self.layout_kxth = QVBoxLayout(self.tab_kxth)
|
||||
self.kxth = MyWindow_kxth(self.database)
|
||||
self.layout_kxth.addWidget(self.kxth) #以上三行为初始化“空闲题号”tab
|
||||
|
||||
self.layout_bdsl = QVBoxLayout(self.tab_bdsl)
|
||||
self.bdsl = MyWindow_bdsl(self.database)
|
||||
self.layout_bdsl.addWidget(self.bdsl) #以上三行为初始化“新题录入”tab
|
||||
|
||||
self.layout_tjgl = QVBoxLayout(self.tab_tjgl)
|
||||
self.tjgl = MyWindow_tjgl(self.database)
|
||||
self.layout_tjgl.addWidget(self.tjgl) #以上三行为初始化“添加关联”tab
|
||||
|
||||
self.layout_tjzd = QVBoxLayout(self.tab_tjzd)
|
||||
self.tjzd = MyWindow_tjzd(self.database)
|
||||
self.layout_tjzd.addWidget(self.tjzd) #以上三行为初始化“编辑题目”tab
|
||||
|
||||
self.layout_bjtm = QVBoxLayout(self.tab_bjtm)
|
||||
self.bjtm = MyWindow_bjtm(self.database)
|
||||
self.layout_bjtm.addWidget(self.bjtm) #以上三行为初始化“编辑题目”tab
|
||||
|
||||
self.layout_xxdr = QVBoxLayout(self.tab_xxdr)
|
||||
self.xxdr = MyWindow_xxdr()
|
||||
self.layout_xxdr.addWidget(self.xxdr) #以上三行为初始化“小闲统计数据导入”tab
|
||||
|
||||
|
||||
self.layout_sddr = QVBoxLayout(self.tab_sddr)
|
||||
self.sddr = MyWindow_sddr()
|
||||
self.layout_sddr.addWidget(self.sddr) #以上三行为初始化“手动统计数据导入”tab
|
||||
|
||||
self.layout_tkdr = QVBoxLayout(self.tab_tkdr)
|
||||
self.tkdr = MyWindow_tkdr()
|
||||
self.layout_tkdr.addWidget(self.tkdr) #以上三行为初始化“统考数据导入”tab
|
||||
|
||||
self.layout_dygg = QVBoxLayout(self.tab_dygg)
|
||||
self.dygg = MyWindow_dygg(self.database)
|
||||
self.layout_dygg.addWidget(self.dygg) #以上三行为初始化“单元挂钩”tab
|
||||
|
||||
self.layout_tqda = QVBoxLayout(self.tab_tqda)
|
||||
self.tqda = MyWindow_tqda()
|
||||
self.layout_tqda.addWidget(self.tqda) #以上三行为初始化“提取答案”tab
|
||||
|
||||
self.layout_gxsy = QVBoxLayout(self.tab_gxsy)
|
||||
self.gxsy = MyWindow_gxsy(self.database)
|
||||
self.layout_gxsy.addWidget(self.gxsy) #以上三行为初始化“共享使用数据”tab
|
||||
|
||||
self.layout_tjjc = QVBoxLayout(self.tab_tjjc)
|
||||
self.tjjc = MyWindow_tjjc(self.database)
|
||||
self.layout_tjjc.addWidget(self.tjjc) #以上三行为初始化“新增基础知识梳理”tab
|
||||
|
||||
self.layout_xxxz = QVBoxLayout(self.tab_xxxz)
|
||||
self.xxxz = MyWindow_xxxz()
|
||||
self.layout_xxxz.addWidget(self.xxxz) #以上三行为初始化“小闲下载”tab
|
||||
|
||||
self.layout_sxth = QVBoxLayout(self.tab_sxth)
|
||||
self.sxth = MyWindow_sxth(self.database)
|
||||
self.layout_sxth.addWidget(self.sxth) #以上三行为初始化“关键字筛选”tab
|
||||
|
||||
self.layout_ndsx = QVBoxLayout(self.tab_ndsx)
|
||||
self.ndsx = MyWindow_ndsx(self.database)
|
||||
self.layout_ndsx.addWidget(self.ndsx) #以上三行为初始化“按难度筛选”tab
|
||||
|
||||
self.layout_xtby = QVBoxLayout(self.tab_xtby)
|
||||
self.xtby = MyWindow_xtby(self.database)
|
||||
self.layout_xtby.addWidget(self.xtby) #以上三行为初始化“选题编译”tab
|
||||
|
||||
self.layout_sctp = QVBoxLayout(self.tab_sctp)
|
||||
self.sctp = MyWindow_sctp(self.database)
|
||||
self.layout_sctp.addWidget(self.sctp) #以上三行为初始化“生成图片”tab
|
||||
|
||||
self.layout_hqth = QVBoxLayout(self.tab_hqth)
|
||||
self.hqth = MyWindow_hqth()
|
||||
self.layout_hqth.addWidget(self.hqth) #以上三行为初始化“获取题号”tab
|
||||
|
||||
self.layout_jglr = QVBoxLayout(self.tab_jglr)
|
||||
self.jglr = MyWindow_jglr()
|
||||
self.layout_jglr.addWidget(self.jglr) #以上三行为初始化“讲义结构编号录入”tab
|
||||
|
||||
self.layout_dtlr = QVBoxLayout(self.tab_dtlr)
|
||||
self.dtlr = MyWindow_dtlr()
|
||||
self.layout_dtlr.addWidget(self.dtlr) #以上三行为初始化“答题纸对应信息录入”tab
|
||||
|
||||
self.layout_jysc = QVBoxLayout(self.tab_jysc)
|
||||
self.jysc = MyWindow_jysc(self.database)
|
||||
self.layout_jysc.addWidget(self.jysc) #以上三行为初始化“LaTeX代码转换”tab
|
||||
|
||||
self.layout_wbzh = QVBoxLayout(self.tab_wbzh)
|
||||
self.wbzh = MyWindow_wbzh()
|
||||
self.layout_wbzh.addWidget(self.wbzh) #以上三行为初始化“LaTeX代码转换”tab
|
||||
|
||||
self.layout_hist = QVBoxLayout(self.tab_hist)
|
||||
self.hist = MyWindow_hist()
|
||||
self.layout_hist.addWidget(self.hist) #以上三行为初始化“生成直方图代码”tab
|
||||
|
||||
|
||||
|
||||
for func in [
|
||||
self.kxth.setdbname,
|
||||
self.jysc.setdbname,
|
||||
self.sctp.setdbname,
|
||||
self.xtby.setdbname,
|
||||
self.ndsx.setdbname,
|
||||
self.sxth.setdbname,
|
||||
self.tjgl.setdbname,
|
||||
self.bdsl.setdbname,
|
||||
self.tjjc.setdbname,
|
||||
self.gxsy.setdbname,
|
||||
self.dygg.setdbname,
|
||||
self.bjtm.setdbname,
|
||||
self.tjzd.setdbname
|
||||
]: #在列表中的tab里传送数据库名的连接
|
||||
self.sendDBname.connect(func)
|
||||
def sendValue(self):
|
||||
self.sendDBname.emit(self.database) #释放信号
|
||||
|
||||
def SelectTIKU(self):
|
||||
self.pushButton_tiku.setStyleSheet("background-color: green; font-weight: bold;") #绿色背景粗体
|
||||
self.pushButton_tikutest.setStyleSheet("") #恢复原有背景, 取消粗体
|
||||
# SaveTextFile("tiku","临时文件/databasename.txt")
|
||||
self.database = "tiku"
|
||||
self.sendValue()
|
||||
def SelectTIKUTEST(self):
|
||||
self.pushButton_tikutest.setStyleSheet("background-color: green; font-weight: bold;") #绿色背景粗体
|
||||
self.pushButton_tiku.setStyleSheet("") #恢复原有背景, 取消粗体
|
||||
# SaveTextFile("tikutest","临时文件/databasename.txt")
|
||||
self.database = "tikutest"
|
||||
self.sendValue()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,315 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>题库工具面板v4</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<widget class="QTabWidget" name="tabWidget_main">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>40</y>
|
||||
<width>800</width>
|
||||
<height>520</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="tabShape">
|
||||
<enum>QTabWidget::Triangular</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_luru">
|
||||
<attribute name="title">
|
||||
<string>录入</string>
|
||||
</attribute>
|
||||
<widget class="QTabWidget" name="tabWidget_luru">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::West</enum>
|
||||
</property>
|
||||
<property name="tabShape">
|
||||
<enum>QTabWidget::Triangular</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_kxth">
|
||||
<attribute name="title">
|
||||
<string>空闲题号</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_bdsl">
|
||||
<attribute name="title">
|
||||
<string>比对并收录</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_tjgl">
|
||||
<attribute name="title">
|
||||
<string>添加关联</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_weihu">
|
||||
<attribute name="title">
|
||||
<string>维护</string>
|
||||
</attribute>
|
||||
<widget class="QTabWidget" name="tabWidget_weihu">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::West</enum>
|
||||
</property>
|
||||
<property name="tabShape">
|
||||
<enum>QTabWidget::Triangular</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_tjzd">
|
||||
<attribute name="title">
|
||||
<string>添加字段数据</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_bjtm">
|
||||
<attribute name="title">
|
||||
<string>编辑题目</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_xxdr">
|
||||
<attribute name="title">
|
||||
<string>小闲导入</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_sddr">
|
||||
<attribute name="title">
|
||||
<string>手动导入</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_tkdr">
|
||||
<attribute name="title">
|
||||
<string>统考导入</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_dygg">
|
||||
<attribute name="title">
|
||||
<string>单元挂钩</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_tqda">
|
||||
<attribute name="title">
|
||||
<string>提取答案</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_gxsy">
|
||||
<attribute name="title">
|
||||
<string>共享使用记录</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_tjjc">
|
||||
<attribute name="title">
|
||||
<string>添加基础知识</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_xxxz">
|
||||
<attribute name="title">
|
||||
<string>小闲下载</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_shiyong">
|
||||
<attribute name="title">
|
||||
<string>使用</string>
|
||||
</attribute>
|
||||
<widget class="QTabWidget" name="tabWidget_shiyong">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::West</enum>
|
||||
</property>
|
||||
<property name="tabShape">
|
||||
<enum>QTabWidget::Triangular</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_sxth">
|
||||
<attribute name="title">
|
||||
<string>关键字筛选题号</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_ndsx">
|
||||
<attribute name="title">
|
||||
<string>正确率筛选题号</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_xtby">
|
||||
<attribute name="title">
|
||||
<string>选题编译</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_sctp">
|
||||
<attribute name="title">
|
||||
<string>题号生成图片</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_hqth">
|
||||
<attribute name="title">
|
||||
<string>获取题号</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_beikezu">
|
||||
<attribute name="title">
|
||||
<string>备课组</string>
|
||||
</attribute>
|
||||
<widget class="QTabWidget" name="tabWidget_beikezu">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::West</enum>
|
||||
</property>
|
||||
<property name="tabShape">
|
||||
<enum>QTabWidget::Triangular</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_jglr">
|
||||
<attribute name="title">
|
||||
<string>讲义结构编号录入</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_dtlr">
|
||||
<attribute name="title">
|
||||
<string>答题纸对应信息录入</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_jysc">
|
||||
<attribute name="title">
|
||||
<string>系列讲义生成</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_latex">
|
||||
<attribute name="title">
|
||||
<string>LaTeX代码相关</string>
|
||||
</attribute>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::West</enum>
|
||||
</property>
|
||||
<property name="tabShape">
|
||||
<enum>QTabWidget::Triangular</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_wbzh">
|
||||
<attribute name="title">
|
||||
<string>文本转换处理</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_hist">
|
||||
<attribute name="title">
|
||||
<string>直方图代码生成</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>0</y>
|
||||
<width>741</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_tiku">
|
||||
<property name="text">
|
||||
<string>正式数据库</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_tikutest">
|
||||
<property name="text">
|
||||
<string>测试数据库</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,335 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog, QTableWidgetItem
|
||||
from PySide6.QtGui import QColor
|
||||
from Ui_下载小闲答题数据 import Ui_Form
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.chrome.service import Service
|
||||
from selenium.webdriver.common.keys import Keys
|
||||
import re,os,sys
|
||||
from datetime import datetime
|
||||
import numpy as np
|
||||
from time import sleep
|
||||
|
||||
|
||||
def GetPageInfo(driver): #学情报告页面, 显示页码和总页数
|
||||
pageinfo = driver.find_element(By.CSS_SELECTOR,"[class*=styles__page___]").text
|
||||
return pageinfo
|
||||
|
||||
|
||||
def SelectNext(driver): # 在打开后的报告页面选择下一个班级
|
||||
try:
|
||||
openlist = driver.find_element(By.XPATH,"/html/body/div[2]/div/div/div[2]/div[1]/div[2]/div/div/div")
|
||||
sleep(0.1)
|
||||
openlist.click()
|
||||
sleep(0.1)
|
||||
openlist.send_keys(Keys.ARROW_DOWN)
|
||||
sleep(0.1)
|
||||
openlist.send_keys(Keys.ENTER)
|
||||
sleep(0.3)
|
||||
return driver.find_element(By.XPATH,"/html/body/div[2]/div/div/div[2]/div[1]/div[2]/div/div/div").text
|
||||
except:
|
||||
return 1
|
||||
|
||||
def GetDate(driver): #显示当前班级的提交时间
|
||||
commit_date = driver.find_element(By.XPATH,"/html/body/div[2]/div/div/div[2]/div[1]/div[2]/span[2]").text
|
||||
year,month,date = re.findall(r"(\d{4})-(\d{2})-(\d{2})",commit_date)[0]
|
||||
return year+month+date
|
||||
|
||||
def GetCommitInfo(driver): #获取报告页面的班级及提交日期信息
|
||||
commit_dict = {}
|
||||
classname = SelectNext(driver)
|
||||
sleep(0.5)
|
||||
while not classname in commit_dict.keys():
|
||||
commit_date = GetDate(driver)
|
||||
if not classname == 1:
|
||||
commit_dict[classname] = commit_date
|
||||
classname = SelectNext(driver)
|
||||
else:
|
||||
classname = SelectNext(driver)
|
||||
return commit_dict
|
||||
|
||||
def ToIntTime(string):
|
||||
date_obj = datetime.strptime(string, "%Y%m%d")
|
||||
int_time = int(date_obj.timestamp())
|
||||
return int_time
|
||||
|
||||
def MedianCommitDate(adict):
|
||||
return datetime.fromtimestamp(np.median([ToIntTime(adict[t]) for t in adict.keys()])).strftime("%Y%m%d")
|
||||
|
||||
def gotopagenum(driver,num):
|
||||
pagecontrol = driver.find_element(By.CSS_SELECTOR,"[class*=styles__pagination___]")
|
||||
pageinput = pagecontrol.find_element(By.CSS_SELECTOR,"input[type=text]")
|
||||
pageinput.clear()
|
||||
submitbutton = pagecontrol.find_element(By.CSS_SELECTOR,"[class*=tyles__button___]")
|
||||
pageinput.send_keys(str(1))
|
||||
submitbutton.click()
|
||||
sleep(0.5)
|
||||
pageinput.clear()
|
||||
sleep(0.1)
|
||||
pageinput.send_keys(str(num))
|
||||
submitbutton.click()
|
||||
sleep(0.5)
|
||||
|
||||
def ClickBack(driver): # 点击返回按钮
|
||||
backbutton = driver.find_element(By.CSS_SELECTOR,'[class*=styles__back]') # 点击返回
|
||||
backbutton.click()
|
||||
sleep(1)
|
||||
|
||||
def GetHomeworkNames(driver,starting_date = "20000101"):
|
||||
hwk_list = []
|
||||
homework_roots = driver.find_elements(By.CSS_SELECTOR,'[class*=styles__reportList]')
|
||||
for homework_root in homework_roots:
|
||||
name = homework_root.find_element(By.CSS_SELECTOR,'[class*=styles__name]').text
|
||||
date_raw = homework_root.find_element(By.CSS_SELECTOR,'[class*=styles__time]').text
|
||||
date = re.findall(r"\d{4}-\d{2}-\d{2}",date_raw)[0].replace("-","")
|
||||
time = re.findall(r"\d{2}:\d{2}:\d{2}",date_raw)[0].replace(":","")
|
||||
grade = homework_root.find_element(By.CSS_SELECTOR,'[class*=styles__grades]').text[3:]
|
||||
if date >= starting_date:
|
||||
hwk_list.append({"name": name, "date": date, "time": time, "grade": grade})
|
||||
return hwk_list
|
||||
|
||||
def GetHomeworkRoots(driver): #找到页面上所有作业考试的root
|
||||
homework_roots = driver.find_elements(By.CSS_SELECTOR,'[class*=styles__reportList]')
|
||||
return homework_roots
|
||||
|
||||
def ClickDetail(root): #点击查看详情
|
||||
root.find_element(By.XPATH,"div[2]/div[2]").click()
|
||||
|
||||
def ClickDownload(root): #点击报表
|
||||
root.find_element(By.XPATH,"div[2]/div[3]").click()
|
||||
|
||||
def StartandEndDownload(driver):
|
||||
driver.find_element(By.XPATH,"/html/body/div[4]/div/div[2]/div/div[2]/div[3]/div/button[2]").click()
|
||||
QuitDownload(driver)
|
||||
|
||||
def QuitDownload(driver): #退出下载对话框
|
||||
while driver.find_element(By.XPATH,"/html/body/div[4]/div/div[2]/div/div[2]/div[3]/div/button[1]").text == '取 消':
|
||||
try:
|
||||
sleep(0.5)
|
||||
driver.find_element(By.XPATH,"/html/body/div[4]/div/div[2]/div/div[2]/div[3]/div/button[1]").click()
|
||||
except:
|
||||
pass
|
||||
|
||||
def GenerateCommitMessages(driver,index): #在班级报告页面逐一读取页面上的指定作业的名称和计算中位提交日期
|
||||
page_info = GetPageInfo(driver)
|
||||
page = page_info[:page_info.index("/")]
|
||||
roots = GetHomeworkRoots(driver)
|
||||
root = roots[index-1]
|
||||
# root_text = root.text
|
||||
# homework_name = root_text.split("\n")[1]
|
||||
ClickDetail(root)
|
||||
adict = GetCommitInfo(driver)
|
||||
# print(homework_name)
|
||||
message = MedianCommitDate(adict)
|
||||
sleep(0.1)
|
||||
ClickBack(driver)
|
||||
sleep(0.5)
|
||||
gotopagenum(driver,page)
|
||||
sleep(0.5)
|
||||
return message
|
||||
|
||||
def DownloadZipwithDetail(driver,index): #下载页面上的指定zip文件, 并返回中位上传时间
|
||||
page_info = GetPageInfo(driver)
|
||||
page = page_info[:page_info.index("/")]
|
||||
roots = GetHomeworkRoots(driver)
|
||||
root = roots[index-1]
|
||||
root_text = root.text
|
||||
homework_name = root_text.split("\n")[1]
|
||||
ClickDownload(root)
|
||||
sleep(0.5)
|
||||
StartandEndDownload(driver)
|
||||
print(f"已下载: {homework_name}")
|
||||
sleep(0.5)
|
||||
QuitDownload(driver)
|
||||
ClickDetail(root)
|
||||
adict = GetCommitInfo(driver)
|
||||
message = MedianCommitDate(adict)
|
||||
sleep(0.1)
|
||||
ClickBack(driver)
|
||||
sleep(0.5)
|
||||
gotopagenum(driver,page)
|
||||
sleep(0.5)
|
||||
return message
|
||||
|
||||
def RenameRecentzip(folder,message): #将folder中最新的zip文件名加上(message)
|
||||
filelist = os.listdir(folder)
|
||||
filelist.sort(key = lambda x:os.path.getmtime(os.path.join(folder,x)),reverse = True)
|
||||
filepath = os.path.join(folder,filelist[0])
|
||||
renamedfilepath = filepath[:-4]+f"({message}).zip"
|
||||
try:
|
||||
os.rename(filepath,renamedfilepath)
|
||||
print(f"已重命名为: {os.path.split(renamedfilepath)[-1]}")
|
||||
except:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def DownloadZips(driver,alist=[]): #下载页面上的指定zip文件
|
||||
page_info = GetPageInfo(driver)
|
||||
page = page_info[:page_info.index("/")]
|
||||
roots_len = len(GetHomeworkRoots(driver))
|
||||
if alist == []:
|
||||
rangelist = range(roots_len)
|
||||
else:
|
||||
rangelist = alist.copy()
|
||||
for i in rangelist:
|
||||
roots = GetHomeworkRoots(driver)
|
||||
root = roots[i]
|
||||
root_text = root.text
|
||||
homework_name = root_text.split("\n")[1]
|
||||
ClickDownload(root)
|
||||
sleep(0.5)
|
||||
StartandEndDownload(driver)
|
||||
print(f"已下载: {homework_name}")
|
||||
sleep(0.5)
|
||||
gotopagenum(driver,page)
|
||||
sleep(0.5)
|
||||
|
||||
def DownloadandRenameZips(driver,message,folder,index): #下载页面上的指定zip文件
|
||||
page_info = GetPageInfo(driver)
|
||||
page = page_info[:page_info.index("/")]
|
||||
roots = GetHomeworkRoots(driver)
|
||||
root = roots[index-1]
|
||||
print(root.text)
|
||||
ClickDownload(root)
|
||||
sleep(0.5)
|
||||
StartandEndDownload(driver)
|
||||
sleep(5)
|
||||
filelist = os.listdir(folder)
|
||||
filelist.sort(key = lambda x:os.path.getmtime(os.path.join(folder,x)),reverse = True)
|
||||
filepath = os.path.join(folder,filelist[0])
|
||||
renamedfilepath = filepath[:-4]+f"({message}).zip"
|
||||
os.rename(filepath,renamedfilepath)
|
||||
print(f"已重命名为: {os.path.split(renamedfilepath)[-1]}")
|
||||
sleep(0.5)
|
||||
gotopagenum(driver,page)
|
||||
sleep(0.5)
|
||||
|
||||
def getIndices(string):
|
||||
if string.strip() == "":
|
||||
return []
|
||||
else:
|
||||
string_list = [int(i)-1 for i in string.strip().split(",")]
|
||||
return string_list
|
||||
|
||||
def GetValidHomeworks(driver,startdate,enddate,graderegex): #在所有作业中找到在startdate,enddate中符合graderegex年级的作业, 返回(作业信息,页码)的列表
|
||||
validhomeworks = []
|
||||
gotopagenum(driver,1)
|
||||
sleep(2)
|
||||
endflag = False
|
||||
while not endflag:
|
||||
currentpage = int(re.findall("^([\d]+)/",GetPageInfo(driver))[0])
|
||||
homeworkinfo = GetHomeworkNames(driver)
|
||||
for item in homeworkinfo:
|
||||
if re.findall(graderegex,item["grade"])!= [] and startdate <= item["date"] <= enddate:
|
||||
validhomeworks.append((item,currentpage))
|
||||
print(item)
|
||||
if startdate > item["date"]:
|
||||
endflag = True
|
||||
break
|
||||
gotopagenum(driver,currentpage+1)
|
||||
sleep(2)
|
||||
return validhomeworks[-1::-1]
|
||||
|
||||
|
||||
def gethmwkIndexonPage(driver,hmwkinfo): #在当前页面寻找作业位置, 返回位置(1-10), 若未找到则返回-1
|
||||
homeworks = GetHomeworkNames(driver)
|
||||
count = 1
|
||||
for h in homeworks:
|
||||
if h == hmwkinfo:
|
||||
return count
|
||||
count += 1
|
||||
return -1
|
||||
|
||||
class MyWindow_xxxz(QWidget,Ui_Form):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
|
||||
def bind(self):
|
||||
self.pushButton_chrome.clicked.connect(self.getchromePath)
|
||||
self.pushButton_driver.clicked.connect(self.getdriverPath)
|
||||
self.pushButton_outputfolder.clicked.connect(self.getoutputfolder)
|
||||
self.pushButton_openbrowser.clicked.connect(self.openbrowser)
|
||||
self.pushButton_login.clicked.connect(self.login)
|
||||
self.pushButton_getlist.clicked.connect(self.getlist)
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
self.tableWidget.setColumnWidth(0,350)
|
||||
self.tableWidget.setColumnWidth(1,80)
|
||||
def getchromePath(self):
|
||||
pathlist = QFileDialog.getOpenFileName(self,"选择文件",".","chrome.exe文件(chrome.exe);;所有文件(*)")
|
||||
self.label_chrome.setText(pathlist[0])
|
||||
self.chromepath = pathlist[0]
|
||||
def getdriverPath(self):
|
||||
pathlist = QFileDialog.getOpenFileName(self,"选择文件",".","chromedriver.exe文件(chromedriver.exe);;所有文件(*)")
|
||||
self.label_driver.setText(pathlist[0])
|
||||
self.driverpath = pathlist[0]
|
||||
def getoutputfolder(self):
|
||||
self.outputfolder = QFileDialog.getExistingDirectory(None, "选择文件夹")
|
||||
if sys.platform == "win32":
|
||||
self.outputfolder = self.outputfolder.replace("/","\\")
|
||||
self.label_outputfolder.setText(self.outputfolder)
|
||||
def openbrowser(self):
|
||||
service = Service(executable_path=self.driverpath)
|
||||
options = webdriver.ChromeOptions()
|
||||
options.binary_location = self.chromepath
|
||||
prefs = {"download.default_directory": self.outputfolder}
|
||||
options.add_experimental_option("prefs", prefs)
|
||||
self.driver = webdriver.Chrome(service= service,options = options)
|
||||
self.driver.get("http://ls.xiaoxianai.cn")
|
||||
def login(self):
|
||||
loginform = self.driver.find_element(By.XPATH,'//*[@id="container"]/div/div/form')
|
||||
loginlist = loginform.find_elements(By.TAG_NAME,"div")
|
||||
loginlist[1].find_element(By.TAG_NAME,"input").send_keys("16621337584")
|
||||
loginlist[2].find_element(By.TAG_NAME,"input").send_keys("password")
|
||||
loginform.find_element(By.TAG_NAME,"button").click()
|
||||
def getlist(self):
|
||||
self.homeworklist = GetValidHomeworks(self.driver,self.lineEdit_startdate.text(),self.lineEdit_enddate.text(),self.lineEdit_graderegex.text())
|
||||
for i in range(len(self.homeworklist)):
|
||||
self.tableWidget.insertRow(i)
|
||||
self.tableWidget.setItem(i,0,QTableWidgetItem(f"{self.homeworklist[i][0]['name']} / {self.homeworklist[i][0]['grade']}"))
|
||||
self.tableWidget.setItem(i,1,QTableWidgetItem(""))
|
||||
def exec(self):
|
||||
i = 0
|
||||
for hmwk,page in self.homeworklist:
|
||||
foundhmwk = False
|
||||
downloaded = False
|
||||
for p in range(page+1,0,-1):
|
||||
gotopagenum(self.driver,p)
|
||||
sleep(2)
|
||||
hmwkindex = gethmwkIndexonPage(self.driver,hmwk)
|
||||
if hmwkindex > 0:
|
||||
foundhmwk = True
|
||||
print(f"已找到 {hmwk['name']} 于页码 {p}, 第 {hmwkindex} 项")
|
||||
break
|
||||
if not foundhmwk:
|
||||
print(f"!!!!!!未找到 {hmwk['name']}")
|
||||
else:
|
||||
print(f"正在下载 {hmwk['name']} 的 zip 文件")
|
||||
try:
|
||||
message = DownloadZipwithDetail(self.driver,hmwkindex)
|
||||
renamed = RenameRecentzip(self.outputfolder,message)
|
||||
if renamed == 0:
|
||||
downloaded = True
|
||||
self.tableWidget.item(i,1).setBackground(QColor("green"))
|
||||
QApplication.processEvents()
|
||||
except:
|
||||
print(Exception)
|
||||
if not downloaded:
|
||||
print(f"@@@@@@未能下载并改名 {hmwk['name']}")
|
||||
self.tableWidget.item(i,1).setBackground(QColor("red"))
|
||||
i += 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow_xxxz()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,252 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>下载小闲答题纸</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_chrome">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>10</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>chrome路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_driver">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>50</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>driver路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_outputfolder">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>90</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>输出路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_chrome">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>210</x>
|
||||
<y>10</y>
|
||||
<width>221</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>此处显示chrome.exe的路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_driver">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>210</x>
|
||||
<y>50</y>
|
||||
<width>221</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>此处显示chrome webdriver的路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_outputfolder">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>210</x>
|
||||
<y>90</y>
|
||||
<width>221</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>此处显示输出的zip文件的路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_openbrowser">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>130</y>
|
||||
<width>71</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>开启浏览器</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_login">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>210</x>
|
||||
<y>130</y>
|
||||
<width>71</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>登录</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>400</x>
|
||||
<y>130</y>
|
||||
<width>201</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>下载答题情况</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>450</x>
|
||||
<y>10</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>起始日期</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>450</x>
|
||||
<y>50</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>终止日期</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>450</x>
|
||||
<y>90</y>
|
||||
<width>71</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>年级(regex)</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_startdate">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>510</x>
|
||||
<y>10</y>
|
||||
<width>91</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>yyyymmdd</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_enddate">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>510</x>
|
||||
<y>50</y>
|
||||
<width>91</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>yyyymmdd</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_graderegex">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>530</x>
|
||||
<y>90</y>
|
||||
<width>71</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>高[一二]</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_getlist">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>290</x>
|
||||
<y>130</y>
|
||||
<width>101</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>获取答题卡列表</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTableWidget" name="tableWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>190</y>
|
||||
<width>471</width>
|
||||
<height>271</height>
|
||||
</rect>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>答题纸名称</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>已下载</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_修改metadata import Ui_Form
|
||||
import os
|
||||
from database_tools_2 import *
|
||||
|
||||
|
||||
class MyWindow_tjzd(QWidget,Ui_Form):
|
||||
def __init__(self,database_name):
|
||||
super().__init__()
|
||||
self.database_name = database_name
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
|
||||
def setdbname(self,string):
|
||||
self.database_name = string
|
||||
# print(self.database_name)
|
||||
|
||||
|
||||
def bind(self):
|
||||
self.metadatafilepath = "文本文件/metadata.txt"
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
|
||||
def exec(self):
|
||||
mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
|
||||
|
||||
|
||||
changedids = ImportMetadata(mydb,self.metadatafilepath)
|
||||
print(changedids)
|
||||
|
||||
if len(changedids) > 0:
|
||||
mycursor = mydb.cursor()
|
||||
configjson = BuildFullScheme
|
||||
latexbody = "\\begin{enumerate}\n\n"
|
||||
for id in sorted(list(set(changedids))):
|
||||
latexbody += generateLaTeXBodyContentfromMariaDB(mycursor,id,configjson) + "\n\n"
|
||||
latexbody += "\\end{enumerate}"
|
||||
latex_raw = ReadTextFile("模板文件/讲义模板.txt")
|
||||
if configjson["教师版"] == True:
|
||||
latex_raw = latex_raw.replace(r"学号\blank{50} \ 姓名\blank{80}","上海市控江中学")
|
||||
|
||||
if sys.platform != "win32": #非win系统用默认字体
|
||||
latex_raw = re.sub(r"fontset[\s]*=[\s]*none","fontset = fandol",latex_raw)
|
||||
latex_raw = re.sub(r"\\setCJKmainfont",r"% \\setCJKmainfont",latex_raw)
|
||||
latex_data = StringSubstitute(r"<<[\s\S]*?待替换[\s\S]*?>>",latex_raw,("试编译",latexbody)) #替换标题和bodystring
|
||||
outputdir = os.path.join(os.getcwd(),"临时文件")
|
||||
outputfilepath = os.path.join(outputdir,"试编译.tex")
|
||||
SaveTextFile(latex_data,outputfilepath)
|
||||
if XeLaTeXCompile(outputdir,"试编译.tex",times=1):
|
||||
print("修改后检验成功, 已导入数据库.")
|
||||
mydb.commit()
|
||||
else:
|
||||
print("修改后检验失败, 已回滚.")
|
||||
mydb.rollback()
|
||||
else:
|
||||
print("未作修改.")
|
||||
|
||||
|
||||
|
||||
|
||||
mydb.commit()
|
||||
mydb.close()
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>修改metadata</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>220</x>
|
||||
<y>190</y>
|
||||
<width>321</width>
|
||||
<height>101</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>修改metadata</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_共享使用记录 import Ui_Form
|
||||
from database_tools_2 import *
|
||||
|
||||
class MyWindow_gxsy(QWidget,Ui_Form):
|
||||
def __init__(self,database_name):
|
||||
super().__init__()
|
||||
self.database_name = database_name
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
|
||||
def setdbname(self,string):
|
||||
self.database_name = string
|
||||
# print(self.database_name)
|
||||
|
||||
def bind(self):
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
|
||||
def exec(self):
|
||||
same_list = generate_same_list(self.database_name)
|
||||
mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
|
||||
for id,same_id in tqdm.tqdm(same_list):
|
||||
ShareSameUsagesinDB(id,same_id,mydb)
|
||||
mydb.commit()
|
||||
mydb.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow_gxsy("tikutest")
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>共享使用记录</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>270</x>
|
||||
<y>170</y>
|
||||
<width>251</width>
|
||||
<height>131</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>相同题目共享使用记录</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QLineEdit
|
||||
from Ui_题号筛选器 import Ui_Form
|
||||
from database_tools_2 import *
|
||||
import time,os
|
||||
|
||||
class MyWindow_sxth(QWidget,Ui_Form):
|
||||
def __init__(self,database_name):
|
||||
super().__init__()
|
||||
self.database_name = database_name
|
||||
self.setupUi(self)
|
||||
self.conditions = []
|
||||
self.bind()
|
||||
def setdbname(self,string):
|
||||
self.database_name = string
|
||||
# print(self.database_name)
|
||||
def bind(self):
|
||||
self.pushButton_content.clicked.connect(lambda: self.add_content("content"))
|
||||
self.pushButton_obj.clicked.connect(lambda: self.add_content("objs"))
|
||||
self.pushButton_tag.clicked.connect(lambda: self.add_content("tags"))
|
||||
self.pushButton_usage.clicked.connect(lambda: self.add_content("usages"))
|
||||
self.pushButton_origin.clicked.connect(lambda: self.add_content("origin"))
|
||||
self.pushButton_genre.clicked.connect(lambda: self.add_content("genre"))
|
||||
self.pushButton_ans.clicked.connect(lambda: self.add_content("ans"))
|
||||
self.pushButton_solution.clicked.connect(lambda: self.add_content("solution"))
|
||||
self.pushButton_same.clicked.connect(lambda: self.add_content("same"))
|
||||
self.pushButton_related.clicked.connect(lambda: self.add_content("related"))
|
||||
self.pushButton_remark.clicked.connect(lambda: self.add_content("remark"))
|
||||
self.pushButton_undo.clicked.connect(self.undolast)
|
||||
self.pushButton_clearAll.clicked.connect(self.clearConditions)
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
self.pushButton_savebuild.clicked.connect(self.build)
|
||||
|
||||
|
||||
|
||||
def add_content(self,field):
|
||||
self.conditions.append((field,self.checkBox_not.isChecked(),self.lineEdit_SingleCondition.text()))
|
||||
self.showConditions()
|
||||
def undolast(self):
|
||||
self.conditions = self.conditions[:-1].copy()
|
||||
self.showConditions()
|
||||
def clearConditions(self):
|
||||
self.conditions = []
|
||||
self.showConditions()
|
||||
def showConditions(self):
|
||||
text = ""
|
||||
for cond in self.conditions:
|
||||
field, flag_not, matchexp = cond
|
||||
text += f"字段 {field} 中{'没有' if flag_not else '有 '}{' 或 '.join([t.strip() for t in matchexp.split(',')])}\n"
|
||||
self.label_conditions.setText(text)
|
||||
def exec(self):
|
||||
mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
|
||||
mycursor = mydb.cursor()
|
||||
mycursor.execute("SELECT count(*) FROM problems WHERE NOT content REGEXP 'OBS';")
|
||||
self.lcdNumber_resCount.display(mycursor.fetchall()[0][0])
|
||||
self.matchlist = MatchConditioninMariaDB(self.conditions,self.database_name)
|
||||
self.lcdNumber_resCount.display(len(self.matchlist))
|
||||
|
||||
def build(self):
|
||||
idlist = sorted(list(self.matchlist))
|
||||
exp = generate_exp(idlist)
|
||||
try:
|
||||
AppendTextFile(f"\n{time.ctime()}\n{exp}\n","临时文件/题号筛选.txt")
|
||||
except:
|
||||
SaveTextFile(f"{time.ctime()}\n{exp}\n","临时文件/题号筛选.txt")
|
||||
configjson_detailed = {
|
||||
"pdf标题": "筛选题目编译",
|
||||
"教师版": True,
|
||||
"字段显示设置": {
|
||||
"题后空间": True,
|
||||
"课时目标": True,
|
||||
"题目标签": True,
|
||||
"答案": True,
|
||||
"解答与提示": True,
|
||||
"使用记录": [3,-1],
|
||||
"使用记录说明": "[a,b]表示显示最好的a个和最差b个, 有-2表示不显示, 无-2但有-1表示全部显示",
|
||||
"来源": True,
|
||||
"备注": True,
|
||||
"届别": []
|
||||
}
|
||||
}
|
||||
configjson_simple = {
|
||||
"pdf标题": "筛选题目编译",
|
||||
"教师版": False,
|
||||
"字段显示设置": {
|
||||
"题后空间": True,
|
||||
"课时目标": True,
|
||||
"题目标签": True,
|
||||
"答案": True,
|
||||
"解答与提示": True,
|
||||
"使用记录": [3,-1],
|
||||
"使用记录说明": "[a,b]表示显示最好的a个和最差b个, 有-2表示不显示, 无-2但有-1表示全部显示",
|
||||
"来源": True,
|
||||
"备注": True,
|
||||
"届别": []
|
||||
}
|
||||
}
|
||||
|
||||
if self.checkBox_Detailed.isChecked():
|
||||
configjson = configjson_detailed
|
||||
else:
|
||||
configjson = configjson_simple
|
||||
|
||||
|
||||
notetitle = configjson["pdf标题"]
|
||||
outputdir = "临时文件" #输出文件的目录
|
||||
outputfilepath = os.path.join(outputdir,notetitle+".tex")
|
||||
print("输出文件目录: %s\n输出文件名: %s"%(os.path.join(os.getcwd(),outputdir),notetitle+".tex"))
|
||||
|
||||
latex_raw = ReadTextFile("模板文件/讲义模板.txt")
|
||||
if configjson["教师版"] == True:
|
||||
latex_raw = latex_raw.replace(r"学号\blank{50} \ 姓名\blank{80}","上海市控江中学")
|
||||
|
||||
if sys.platform != "win32": #非win系统用默认字体
|
||||
latex_raw = re.sub(r"fontset[\s]*=[\s]*none","fontset = fandol",latex_raw)
|
||||
latex_raw = re.sub(r"\\setCJKmainfont",r"% \\setCJKmainfont",latex_raw)
|
||||
starttime = time.time()
|
||||
mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
|
||||
mycursor = mydb.cursor()
|
||||
bodystring = "\\begin{enumerate}\n\n"
|
||||
for id in generate_number_set(exp):
|
||||
bodystring += generateLaTeXBodyContentfromMariaDB(mycursor,id,configjson)
|
||||
bodystring += "\\end{enumerate}\n\n"
|
||||
|
||||
midtime = time.time()
|
||||
print(f"生成LaTeX文件所花时间: {midtime-starttime:.3f}秒")
|
||||
|
||||
latex_data = StringSubstitute(r"<<[\s\S]*?待替换[\s\S]*?>>",latex_raw,(notetitle,bodystring)) #替换标题和bodystring
|
||||
SaveTextFile(latex_data,outputfilepath) #保存.tex文件
|
||||
|
||||
if XeLaTeXCompile(outputdir,notetitle+".tex"):
|
||||
print("编译成功")
|
||||
else:
|
||||
print("编译失败")
|
||||
|
||||
endtime = time.time()
|
||||
print(f"生成pdf文件所花时间: {endtime-midtime:.3f}秒")
|
||||
os.system("code 临时文件/题号筛选.txt")
|
||||
startfile("临时文件")
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_单一题号转为图片 import Ui_Form
|
||||
from database_tools_2 import *
|
||||
import os
|
||||
from datetime import datetime
|
||||
|
||||
class MyWindow_sctp(QWidget,Ui_Form):
|
||||
def __init__(self,database_name):
|
||||
super().__init__()
|
||||
self.database_name = database_name
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
def setdbname(self,string):
|
||||
self.database_name = string
|
||||
# print(self.database_name)
|
||||
|
||||
def bind(self):
|
||||
self.pushButton_open.setDisabled(True)
|
||||
self.pushButton_convert.clicked.connect(self.convert)
|
||||
self.pushButton_open.clicked.connect(self.open)
|
||||
self.lineEdit_ID.textChanged.connect(self.toggleopen)
|
||||
self.lineEdit_dpi.textChanged.connect(self.toggleopen)
|
||||
def convert(self):
|
||||
self.time = datetime.now().strftime("%Y%m%d%H%M%S")
|
||||
self.id = self.lineEdit_ID.text()
|
||||
self.dpi = self.lineEdit_dpi.text()
|
||||
mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
|
||||
mycursor = mydb.cursor()
|
||||
sql = "SELECT content FROM problems WHERE ID = %s;"
|
||||
val = (self.id.strip().zfill(6),)
|
||||
mycursor.execute(sql,val)
|
||||
content = mycursor.fetchall()[0][0]
|
||||
mydb.close()
|
||||
prefix = self.lineEdit_message.text().strip()
|
||||
latexcontent = f"{prefix} {content}"
|
||||
latex_raw = ReadTextFile("模板文件/独立文件模板.txt")
|
||||
#识别操作系统
|
||||
if sys.platform != "win32":
|
||||
latex_raw = re.sub(r"fontset[\s]*=[\s]*none","fontset = fandol",latex_raw)
|
||||
latex_raw = re.sub(r"\\setCJKmainfont",r"% \\setCJKmainfont",latex_raw)
|
||||
latexdata = StringSubstitute(r"<<待替换\d*>>",latex_raw,[latexcontent])
|
||||
makedir("临时文件/pics")
|
||||
SaveTextFile(latexdata,f"临时文件/pics/ID{self.id}-{self.dpi}-{self.time}.tex")
|
||||
os.system(f"xelatex -interaction=batchmode -output-directory=临时文件/pics ID{self.id}-{self.dpi}-{self.time}.tex")
|
||||
os.chdir("临时文件/pics")
|
||||
os.system(f"pdftocairo -png -r {self.dpi} ID{self.id}-{self.dpi}-{self.time}.pdf")
|
||||
os.chdir("../..")
|
||||
self.pushButton_open.setEnabled(True)
|
||||
def open(self):
|
||||
startfile(os.path.join("临时文件/pics", f"ID{self.id}-{self.dpi}-{self.time}-1.png"))
|
||||
def toggleopen(self):
|
||||
self.pushButton_open.setDisabled(True)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>单一题号转为图片</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>240</x>
|
||||
<y>160</y>
|
||||
<width>31</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_ID">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>270</x>
|
||||
<y>160</y>
|
||||
<width>71</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>240</x>
|
||||
<y>190</y>
|
||||
<width>31</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>DPI</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_dpi">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>270</x>
|
||||
<y>190</y>
|
||||
<width>71</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_convert">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>350</x>
|
||||
<y>160</y>
|
||||
<width>75</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>转换</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_open">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>430</x>
|
||||
<y>160</y>
|
||||
<width>75</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>打开</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>240</x>
|
||||
<y>220</y>
|
||||
<width>51</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>附加文字</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_message">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>300</x>
|
||||
<y>220</y>
|
||||
<width>201</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>输入附加文字, 留空表示无附加文字</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_单元挂钩 import Ui_Form
|
||||
from database_tools_2 import *
|
||||
|
||||
class MyWindow_dygg(QWidget,Ui_Form):
|
||||
def __init__(self,database_name):
|
||||
super().__init__()
|
||||
self.database_name = database_name
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
def setdbname(self,string):
|
||||
self.database_name = string
|
||||
# print(self.database_name)
|
||||
def bind(self):
|
||||
self.radioButton_phase1.setChecked(True)
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
|
||||
def exec(self):
|
||||
# pro_dict = load_dict("../题库0.3/Problems.json")
|
||||
allids = getAllIDsExp(self.database_name)
|
||||
all_same_list = generate_same_list(self.database_name)
|
||||
all_related_list = generate_related_list(self.database_name)
|
||||
if self.radioButton_phase1.isChecked():
|
||||
idexp = self.lineEdit_ids.text()
|
||||
if idexp.strip() == "":
|
||||
idlist = unUnitted(allids,self.database_name)
|
||||
else:
|
||||
idlist = generate_number_set(idexp)
|
||||
latex_body,tagrec = AutoAssignTagNotoLaTeX(idlist,all_same_list,all_related_list,self.database_name)
|
||||
latex_raw = ReadTextFile("模板文件/讲义模板.txt")
|
||||
latex_data = StringSubstitute(r"<<[\s\S]*?待替换[\s\S]*?>>",latex_raw,("待检查单元",latex_body))
|
||||
SaveTextFile(tagrec,"临时文件/单元对应.txt")
|
||||
SaveTextFile(latex_data,"临时文件/待检查单元.tex")
|
||||
if XeLaTeXCompile("临时文件","待检查单元.tex") == True:
|
||||
print("处理成功.")
|
||||
os.system("code 临时文件/单元对应.txt 临时文件/待检查单元.pdf")
|
||||
else:
|
||||
print("处理失败.")
|
||||
elif self.radioButton_phase2.isChecked():
|
||||
output = UnitRectoMetadataText(ReadTextFile("临时文件/单元对应.txt"))
|
||||
SaveTextFile(output,"文本文件/metadata.txt")
|
||||
os.system("code 文本文件/metadata.txt")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow_dygg()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>单元挂钩</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>190</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_phase2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>240</y>
|
||||
<width>191</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>收录单元信息至metadata阶段</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_ids">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>210</y>
|
||||
<width>271</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>输入题号, 留空表示针对所有没有对应单元的题目</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>490</x>
|
||||
<y>160</y>
|
||||
<width>71</width>
|
||||
<height>111</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>运行</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_phase1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>170</y>
|
||||
<width>141</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>自适应赋予单元信息</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_寻找空闲题号 import Ui_Form
|
||||
from database_tools_2 import *
|
||||
|
||||
|
||||
class MyWindow_kxth(QWidget,Ui_Form):
|
||||
def __init__(self,database_name):
|
||||
super().__init__()
|
||||
self.database_name = database_name
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
def bind(self):
|
||||
self.label_used.setText("")
|
||||
self.label_available.setText("")
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
|
||||
|
||||
def exec(self):
|
||||
# self.databaes_name = ReadTextFile("临时文件/databasename.txt").strip()
|
||||
self.label_used.setText(usedIDs(self.database_name))
|
||||
self.label_available.setText(spareIDs(self.database_name))
|
||||
|
||||
|
||||
def setdbname(self,string):
|
||||
self.database_name = string
|
||||
# print(self.database_name)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>寻找空闲题号</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_used">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>50</y>
|
||||
<width>260</width>
|
||||
<height>401</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_available">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>290</x>
|
||||
<y>50</y>
|
||||
<width>260</width>
|
||||
<height>401</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>20</y>
|
||||
<width>71</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>已使用题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>290</x>
|
||||
<y>20</y>
|
||||
<width>71</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>空闲题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>570</x>
|
||||
<y>50</y>
|
||||
<width>141</width>
|
||||
<height>401</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>生成已使用题号列表
|
||||
及空闲题号列表</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_手动统计结果导入 import Ui_Form
|
||||
from database_tools_2 import *
|
||||
|
||||
class MyWindow_sddr(QWidget,Ui_Form):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
def bind(self):
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
def exec(self):
|
||||
handmadeusagedatafilepath = r"临时文件/手动统计结果.txt" #手动统计文件的位置
|
||||
metadatafilepath = r"文本文件/metadata.txt" #输出的metadata文件的位置
|
||||
raw_data = ReadTextFile(handmadeusagedatafilepath)
|
||||
data_list = [d.strip() for d in re.findall(r"\[BEGIN\]([\s\S]*?)\[END\]",raw_data)]
|
||||
output = "usages\n\n"
|
||||
for item in data_list:
|
||||
lines = item.split("\n")
|
||||
for line in lines:
|
||||
if line.startswith("##"):
|
||||
date = line.replace("##","").strip()
|
||||
elif line.startswith("**"):
|
||||
classname = line.replace("**","").strip()
|
||||
else:
|
||||
linedata = re.sub(r"\s+","\t",line)
|
||||
usage = linedata.split("\t")
|
||||
id = usage.pop(0)
|
||||
usagestr = "\t".join([f"{float(u):.3f}" for u in usage])
|
||||
output += "%s\n%s\t%s\t%s\n\n"%(id.zfill(6),date,classname,usagestr)
|
||||
SaveTextFile(output,metadatafilepath)
|
||||
os.system(f"code {metadatafilepath}")
|
||||
self.close()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow_sddr()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>手动统计结果导入</string>
|
||||
</property>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>150</y>
|
||||
<width>181</width>
|
||||
<height>141</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="plainText">
|
||||
<string>[BEGIN]
|
||||
##20240101
|
||||
**2026届高一01班
|
||||
1 0.875
|
||||
10001 0.825 0.630
|
||||
[END]</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>130</y>
|
||||
<width>101</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>手动统计结果模板</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>440</x>
|
||||
<y>130</y>
|
||||
<width>75</width>
|
||||
<height>161</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>导入为
|
||||
metadata</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_批量收录新题 import Ui_Form
|
||||
from database_tools_2 import *
|
||||
|
||||
class MyWindow_bdsl(QWidget,Ui_Form):
|
||||
def __init__(self,database_name):
|
||||
super().__init__()
|
||||
self.database_name = database_name
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
|
||||
def setdbname(self,string):
|
||||
self.database_name = string
|
||||
# print(self.database_name)
|
||||
|
||||
def bind(self):
|
||||
self.suffix_checked = True
|
||||
self.checkBox_suffix.toggled.connect(self.togglesuffix)
|
||||
self.pushButton_step1.clicked.connect(self.execstep1)
|
||||
self.pushButton_step2.clicked.connect(self.execstep2)
|
||||
def togglesuffix(self):
|
||||
self.suffix_checked = self.checkBox_suffix.isChecked()
|
||||
if self.suffix_checked:
|
||||
self.lineEdit_suffix.setEnabled(True)
|
||||
else:
|
||||
self.lineEdit_suffix.setDisabled(True)
|
||||
|
||||
def execstep1(self):
|
||||
colors = ["green","orange","blue"]
|
||||
templatepath = "./模板文件/讲义模板.txt"
|
||||
|
||||
mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
|
||||
mycursor = mydb.cursor()
|
||||
|
||||
mycursor.execute("SELECT ID,content FROM problems;")
|
||||
ret_list = mycursor.fetchall()
|
||||
pro_dict = {i:j for i,j in ret_list}
|
||||
treated_dict = {i:pre_treating(pro_dict[i]) for i in pro_dict.keys()}
|
||||
mydb.close()
|
||||
|
||||
data_raw = self.plainTextEdit_raw.toPlainText()
|
||||
if data_raw.strip().startswith("\\item"):
|
||||
data_raw = "\\begin{enumerate}\n"+data_raw
|
||||
if data_raw.count("\\begin{enumerate}") == data_raw.count("\\end{enumerate}") + 1:
|
||||
data_raw = data_raw + "\n\\end{enumerate}"
|
||||
problems_raw = re.findall(r"\\begin\{enumerate\}([\s\S]*?)\\end\{enumerate\}",data_raw)
|
||||
data = "\n".join([item.strip() for item in problems_raw])
|
||||
problems = [(d.strip()) for d in data.split("\\item") if not d.strip() == ""]
|
||||
output = "使用说明:\\\\\n rep??????表示使用已有题号??????,\\\\\n s??????表示和??????相同,\\\\\n r??????表示和??????相关\n\n\\begin{enumerate}\n\n"
|
||||
|
||||
|
||||
for p in problems:
|
||||
p_treated = pre_treating(p)
|
||||
t = stringmaxsim(p_treated,treated_dict,5)
|
||||
psrstring = ""
|
||||
for id,simrate in t:
|
||||
if simrate == 1:
|
||||
psrstring = "rep"+id+","
|
||||
else:
|
||||
psrstring += id + ","
|
||||
if psrstring[-1] == ",":
|
||||
psrstring = psrstring[:-1]
|
||||
output += f"\\item [{psrstring}] {p}\n\n"
|
||||
count = 0
|
||||
for id,simrate in t:
|
||||
if simrate > 0.5:
|
||||
colors = get_color(simrate*2-1)
|
||||
output += "\n\\definecolor{mycolor}{rgb}"+colors
|
||||
output += "\n\\begin{tcolorbox}"+f"[colback = mycolor, opacityback = 0.25, colframe = orange!10!white, breakable]\n"
|
||||
output += f"{simrate:.3f} \\ {id}\n\n"
|
||||
content = pro_dict[id]
|
||||
output += f"{content}\n"
|
||||
output += "\\end{tcolorbox}\n"
|
||||
count += 1
|
||||
output += "\n\n"
|
||||
output += "\n\\end{enumerate}\n\n"
|
||||
|
||||
texraw = ReadTextFile(templatepath)
|
||||
texdata = StringSubstitute(r"<<[\s\S]*?待替换[\s\S]*?>>",texraw,("新题比对"+f"{GetDate()}",output))
|
||||
self.plainTextEdit_compared.setPlainText(texdata)
|
||||
|
||||
def execstep2(self):
|
||||
starting_id = self.lineEdit_startingid.text().strip().zfill(6)
|
||||
raworigin = self.lineEdit_origin.text().strip()
|
||||
data = self.plainTextEdit_compared.toPlainText()
|
||||
editor = self.lineEdit_editor.text().strip()
|
||||
if self.checkBox_suffix.isChecked():
|
||||
Indexed = True
|
||||
else:
|
||||
Indexed = False
|
||||
idlistpath = "文本文件/新题收录列表.txt"
|
||||
problems = GenerateProblemListFromString2024(data)
|
||||
# pro_dict = load_dict("../题库0.3/Problems.json")
|
||||
nextspareid = NextSpareID(starting_id,self.database_name)
|
||||
idlist = AddProblemstoDict2024(nextspareid,raworigin,problems,editor,Indexed,self.database_name)
|
||||
# save_dict(SortDict(pro_dict),r"../题库0.3/Problems.json")
|
||||
AppendTextFile(f"{GetDate()}-{GetTime()}\n{generate_exp(idlist)}",idlistpath)
|
||||
os.system(f"code {idlistpath}")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow_bdsl("tikutest")
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>批量收录新题</string>
|
||||
</property>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_raw">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>281</width>
|
||||
<height>441</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>10</y>
|
||||
<width>251</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>要处理的题目(按 item 切分, 可以包含文件头)</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_step1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>300</x>
|
||||
<y>50</y>
|
||||
<width>70</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>新题比对</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>360</x>
|
||||
<y>10</y>
|
||||
<width>321</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>含有相似题目的LaTeX源代码, 复制到LaTeX编辑器人工标注</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_compared">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>380</x>
|
||||
<y>30</y>
|
||||
<width>281</width>
|
||||
<height>301</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_step2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>670</x>
|
||||
<y>50</y>
|
||||
<width>70</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>收录题目</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>380</x>
|
||||
<y>340</y>
|
||||
<width>281</width>
|
||||
<height>131</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>起始ID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_startingid">
|
||||
<property name="inputMask">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="dragEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>数字题号(通常是10000n+1)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget_2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>编辑者</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_editor">
|
||||
<property name="placeholderText">
|
||||
<string>编辑者姓名</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget_3">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>来源</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_origin">
|
||||
<property name="text">
|
||||
<string>自拟题目</string>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>题目来源, 通常为 自拟题目</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget_4">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>后缀</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_suffix">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>试题</string>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>通常为 试题</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_suffix">
|
||||
<property name="text">
|
||||
<string>使用后缀</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_指定题号编译pdf import Ui_Form
|
||||
import os
|
||||
from database_tools_2 import *
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class MyWindow_xtby(QWidget,Ui_Form):
|
||||
def __init__(self,database_name):
|
||||
super().__init__()
|
||||
self.database_name = database_name
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
|
||||
def setdbname(self,string):
|
||||
self.database_name = string
|
||||
# print(self.database_name)
|
||||
def bind(self):
|
||||
outputpath = os.path.join(os.getcwd(),"临时文件")
|
||||
self.lineEdit_path.setText(outputpath)
|
||||
self.TitleID_list = []
|
||||
self.TeachersCheckBoxList = [self.checkBox_ans,self.checkBox_objs,self.checkBox_tags,self.checkBox_solution,self.checkBox_usages,self.checkBox_origin,self.checkBox_remark]
|
||||
self.StudentsCheckBoxList = [self.checkBox_space,self.checkBox_ans]
|
||||
self.ContnetCheckBoxList = [self.checkBox_ans,self.checkBox_objs,self.checkBox_tags,self.checkBox_solution,self.checkBox_usages,self.checkBox_origin,self.checkBox_remark,self.checkBox_space]
|
||||
for widget in self.ContnetCheckBoxList:
|
||||
widget.setDisabled(True)
|
||||
self.studentlayout()
|
||||
self.disableusagessetting()
|
||||
self.pushButton_exec.clicked.connect(self.saveandbuild)
|
||||
self.pushButton_add.clicked.connect(self.additems)
|
||||
self.pushButton_delete.clicked.connect(self.deleteitem)
|
||||
self.pushButton_SelectPath.clicked.connect(self.selectpath)
|
||||
self.radioButton_teacher.clicked.connect(self.teacherlayout)
|
||||
self.radioButton_student.clicked.connect(self.studentlayout)
|
||||
self.checkBox_usages.clicked.connect(self.toggleusagessetting)
|
||||
self.radioButton_student.clicked.connect(self.toggleusagessetting)
|
||||
self.radioButton_teacher.clicked.connect(self.toggleusagessetting)
|
||||
def selectpath(self):
|
||||
outputpath = QFileDialog.getExistingDirectory(self,"选择文件夹")
|
||||
self.lineEdit_path.setText(outputpath)
|
||||
def additems(self):
|
||||
toAddString = self.plainTextEdit_newitems.toPlainText()
|
||||
try:
|
||||
toAddList = TitleIDStringtoTupleList(toAddString)
|
||||
self.TitleID_list += toAddList.copy()
|
||||
except:
|
||||
print("待添加字符串格式有误, 请检查")
|
||||
self.plainTextEdit_allitems.setPlainText(TitleIDTupleListtoString(self.TitleID_list))
|
||||
def deleteitem(self):
|
||||
enum = int(self.lineEdit_index.text())-1
|
||||
self.TitleID_list.pop(enum)
|
||||
self.plainTextEdit_allitems.setPlainText(TitleIDTupleListtoString(self.TitleID_list))
|
||||
|
||||
def disableusagessetting(self):
|
||||
self.lineEdit_high.setDisabled(True)
|
||||
self.lineEdit_low.setDisabled(True)
|
||||
self.lineEdit_grades.setDisabled(True)
|
||||
def enableusagessetting(self):
|
||||
self.lineEdit_high.setEnabled(True)
|
||||
self.lineEdit_low.setEnabled(True)
|
||||
self.lineEdit_grades.setEnabled(True)
|
||||
def toggleusagessetting(self):
|
||||
if self.checkBox_usages.isChecked() and self.radioButton_teacher.isChecked():
|
||||
self.enableusagessetting()
|
||||
else:
|
||||
self.disableusagessetting()
|
||||
def studentlayout(self):
|
||||
for widget in self.TeachersCheckBoxList:
|
||||
widget.setDisabled(True)
|
||||
for widget in self.StudentsCheckBoxList:
|
||||
widget.setEnabled(True)
|
||||
|
||||
def teacherlayout(self):
|
||||
for widget in self.StudentsCheckBoxList:
|
||||
widget.setDisabled(True)
|
||||
for widget in self.TeachersCheckBoxList:
|
||||
widget.setEnabled(True)
|
||||
def generate_usages(self):
|
||||
high = self.lineEdit_high.text().strip()
|
||||
low = self.lineEdit_low.text().strip()
|
||||
if self.checkBox_usages.isChecked() == False:
|
||||
return [-2,-2]
|
||||
elif self.checkBox_usages.isChecked() and high == "" and low == "":
|
||||
return [-1,-1]
|
||||
else:
|
||||
if high == "":
|
||||
high = "0"
|
||||
if low == "":
|
||||
low = "0"
|
||||
return [int(high),int(low)]
|
||||
def saveandbuild(self):
|
||||
if self.radioButton_teacher.isChecked() and self.checkBox_usages.isChecked() and not self.lineEdit_grades.text().strip() == "":
|
||||
grades = self.lineEdit_grades.text().strip().split(",")
|
||||
else:
|
||||
grades = []
|
||||
# prodictpath = "../题库0.3/Problems.json"
|
||||
# objdictpath = "../题库0.3/LessonObj.json"
|
||||
# raw_pro_dict = load_dict(prodictpath)
|
||||
# pro_dict = select_grade_from_pro_dict(raw_pro_dict,grades)
|
||||
# obj_dict = load_dict(objdictpath)
|
||||
configjson = {
|
||||
"教师版": self.radioButton_teacher.isChecked(),
|
||||
"字段显示设置": {
|
||||
"题后空间": self.checkBox_space.isChecked(),
|
||||
"课时目标": self.checkBox_objs.isChecked(),
|
||||
"题目标签": self.checkBox_tags.isChecked(),
|
||||
"答案": self.checkBox_ans.isChecked(),
|
||||
"解答与提示": self.checkBox_solution.isChecked(),
|
||||
"使用记录": self.generate_usages(),
|
||||
"来源": self.checkBox_origin.isChecked(),
|
||||
"备注": self.checkBox_remark.isChecked(),
|
||||
"届别": grades
|
||||
}
|
||||
}
|
||||
|
||||
notetitle = "选题编译"
|
||||
outputdir = self.lineEdit_path.text() #输出文件的目录
|
||||
outputfilepath = os.path.join(outputdir,notetitle+".tex")
|
||||
print("输出文件目录: %s\n输出文件名: %s"%(outputdir,notetitle+".tex"))
|
||||
|
||||
latex_raw = ReadTextFile("模板文件/讲义模板.txt")
|
||||
if configjson["教师版"] == True:
|
||||
latex_raw = latex_raw.replace(r"学号\blank{50} \ 姓名\blank{80}","上海市控江中学")
|
||||
|
||||
if sys.platform != "win32": #非win系统用默认字体
|
||||
latex_raw = re.sub(r"fontset[\s]*=[\s]*none","fontset = fandol",latex_raw)
|
||||
latex_raw = re.sub(r"\\setCJKmainfont",r"% \\setCJKmainfont",latex_raw)
|
||||
|
||||
bodystring = "\\tableofcontents\n\n\\newpage\n\n"
|
||||
bodylist = []
|
||||
# problems_dict = configjson["标题与题号"]
|
||||
starttime = time.time()
|
||||
mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
|
||||
mycursor = mydb.cursor()
|
||||
for p,IDs in self.TitleID_list:
|
||||
currentbodystring = f"\\section{{{p}}}\n\\begin{{enumerate}}\n\n"
|
||||
print(f"正在从数据库获取数据, 生成源代码...")
|
||||
for id in tqdm.tqdm(generate_number_set(IDs)):
|
||||
currentbodystring += generateLaTeXBodyContentfromMariaDB(mycursor,id,configjson)
|
||||
currentbodystring += "\\end{enumerate}"
|
||||
bodylist.append(currentbodystring)
|
||||
bodystring += "\n\n\\newpage\n\n".join(bodylist)
|
||||
|
||||
midtime = time.time()
|
||||
print(f"生成LaTeX文件所花时间: {midtime-starttime:.3f}秒")
|
||||
|
||||
latex_data = StringSubstitute(r"<<[\s\S]*?待替换[\s\S]*?>>",latex_raw,(notetitle,bodystring)) #替换标题和bodystring
|
||||
SaveTextFile(latex_data,outputfilepath) #保存.tex文件
|
||||
|
||||
if XeLaTeXCompile(outputdir,notetitle+".tex"):
|
||||
print("编译成功")
|
||||
else:
|
||||
print("编译失败")
|
||||
|
||||
endtime = time.time()
|
||||
print(f"生成pdf文件所花时间: {endtime-midtime:.3f}秒")
|
||||
startfile(self.lineEdit_path.text())
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,369 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>指定题号编译</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>500</x>
|
||||
<y>279</y>
|
||||
<width>221</width>
|
||||
<height>131</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>开始生成与编译</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>300</x>
|
||||
<y>79</y>
|
||||
<width>61</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>文件路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_path">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>300</x>
|
||||
<y>99</y>
|
||||
<width>421</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_SelectPath">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>640</x>
|
||||
<y>69</y>
|
||||
<width>81</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>300</x>
|
||||
<y>139</y>
|
||||
<width>81</width>
|
||||
<height>271</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>版式选择</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_student">
|
||||
<property name="text">
|
||||
<string>学生版</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_teacher">
|
||||
<property name="text">
|
||||
<string>教师版</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>400</x>
|
||||
<y>139</y>
|
||||
<width>91</width>
|
||||
<height>271</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>内容选项</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_space">
|
||||
<property name="text">
|
||||
<string>题后空间</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_ans">
|
||||
<property name="text">
|
||||
<string>答案</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_objs">
|
||||
<property name="text">
|
||||
<string>课时目标</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_tags">
|
||||
<property name="text">
|
||||
<string>题目标签</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_solution">
|
||||
<property name="text">
|
||||
<string>解答与提示</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_usages">
|
||||
<property name="text">
|
||||
<string>使用记录</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_origin">
|
||||
<property name="text">
|
||||
<string>来源</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_remark">
|
||||
<property name="text">
|
||||
<string>备注</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>500</x>
|
||||
<y>139</y>
|
||||
<width>222</width>
|
||||
<height>121</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_usagepanel">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>使用记录选择(都留空为全显示)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>高</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_high">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>低</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_low"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>届别选择(用 "," 分隔, 留空为全显示)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_grades"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_allitems">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>219</y>
|
||||
<width>261</width>
|
||||
<height>191</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>199</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>题号列表</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>31</x>
|
||||
<y>50</y>
|
||||
<width>60</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>标题与题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_newitems">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>69</y>
|
||||
<width>261</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>如: 集合: 2:30,32 或 "集合": "2:30", "函数": "5,60,71:75"(可有回车)</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>149</y>
|
||||
<width>241</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_add">
|
||||
<property name="text">
|
||||
<string>添加一项或多项</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_delete">
|
||||
<property name="text">
|
||||
<string>删去一项</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>第</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_index">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>项</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_文件或文本框提取答案 import Ui_Form
|
||||
import os
|
||||
from database_tools_2 import *
|
||||
|
||||
|
||||
class MyWindow_tqda(QWidget,Ui_Form):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
|
||||
def bind(self):
|
||||
self.radioButton_text.setChecked(True)
|
||||
self.textlayout()
|
||||
self.radioButton_text.clicked.connect(self.textlayout)
|
||||
self.radioButton_file.clicked.connect(self.filelayout)
|
||||
self.pushButton_selectfilepath.clicked.connect(self.selectfilepath)
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
def textlayout(self):
|
||||
self.pushButton_selectfilepath.setDisabled(True)
|
||||
self.lineEdit_filepath.setDisabled(True)
|
||||
self.plainTextEdit_rawString.setEnabled(True)
|
||||
def filelayout(self):
|
||||
self.pushButton_selectfilepath.setEnabled(True)
|
||||
self.lineEdit_filepath.setEnabled(True)
|
||||
self.plainTextEdit_rawString.setDisabled(True)
|
||||
def selectfilepath(self):
|
||||
self.filepath = QFileDialog.getOpenFileName(self,"选择.tex文件",os.getcwd(),"tex文件(*.tex);;所有文件(*)")[0]
|
||||
self.lineEdit_filepath.setText(self.filepath)
|
||||
def exec(self):
|
||||
if self.radioButton_text.isChecked():
|
||||
data = self.plainTextEdit_rawString.toPlainText()
|
||||
else:
|
||||
data = ReadTextFile(self.filepath)
|
||||
print(self.lineEdit_2.text())
|
||||
anslist = generateAnswerList(data,self.lineEdit_2.text())
|
||||
|
||||
output = "ans\n\n"
|
||||
for id,ans in anslist:
|
||||
if not ans == "暂无答案":
|
||||
output += f"{id}\n{ans}\n\n"
|
||||
|
||||
self.plainTextEdit_ans.setPlainText(output)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow_tqda()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>文件或文本框提取答案</string>
|
||||
</property>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_rawString">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>100</y>
|
||||
<width>311</width>
|
||||
<height>331</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_filepath">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>50</y>
|
||||
<width>331</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>30</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>文件路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>80</y>
|
||||
<width>101</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>含答案的源代码</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>492</x>
|
||||
<y>50</y>
|
||||
<width>211</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>答案: \textcolor{blue}{</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>490</x>
|
||||
<y>30</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>答案前缀</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_text">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>610</x>
|
||||
<y>90</y>
|
||||
<width>95</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>文本框生成</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_file">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>610</x>
|
||||
<y>120</y>
|
||||
<width>95</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>文件生成</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_selectfilepath">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>380</x>
|
||||
<y>50</y>
|
||||
<width>101</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择文件路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>360</x>
|
||||
<y>80</y>
|
||||
<width>91</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>答案metadata</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_ans">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>360</x>
|
||||
<y>100</y>
|
||||
<width>241</width>
|
||||
<height>331</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>610</x>
|
||||
<y>150</y>
|
||||
<width>101</width>
|
||||
<height>281</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>提取答案</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
20240425-215540
|
||||
024789,000589,024790:024794
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_文本转换处理 import Ui_Form
|
||||
from database_tools_2 import *
|
||||
|
||||
class MyWindow_wbzh(QWidget,Ui_Form):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
def bind(self):
|
||||
self.radioButton_mathpix.setChecked(True)
|
||||
self.pushButton_convert.clicked.connect(self.exec)
|
||||
def exec(self):
|
||||
raw_string = self.plainTextEdit_origin.toPlainText()
|
||||
if self.radioButton_mathpix.isChecked():
|
||||
dest_string = RefineMathpix(raw_string)
|
||||
elif self.radioButton_textcircled.isChecked():
|
||||
dest_string = re.sub(r"\((\d)\)",lambda x: "\\textcircled{"+x.group(1)+"}",raw_string) #替换所有的小括号包围的单个数字为圆圈包围的
|
||||
dest_string = re.sub(r"\$\\textcircled\{\\scriptsize\{(\d)\}\}",lambda x: "\\textcircled{"+x.group(1)+"}$",dest_string)
|
||||
dest_string = re.sub(r"\\textcircled\{\\scriptsize\{(\d)\}\}",lambda x: "\\textcircled{"+x.group(1)+"}",dest_string)
|
||||
elif self.radioButton_multiple.isChecked():
|
||||
try:
|
||||
dest_string = MultiplechoicetoBlankFilling(raw_string)
|
||||
except:
|
||||
dest_string = "转换失败"
|
||||
elif self.radioButton_puctuations.isChecked():
|
||||
dest_string = RefinePunctuations(raw_string)
|
||||
elif self.radioButton_answers.isChecked():
|
||||
self.pro_dict = load_dict("../题库0.3/Problems.json")
|
||||
dest_string = PaintRedAnswers(raw_string,self.pro_dict)
|
||||
self.plainTextEdit_dest.setPlainText(dest_string)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,142 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>文本转换处理</string>
|
||||
</property>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_origin">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>310</width>
|
||||
<height>430</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>将源文本 粘贴 在这个文本框内</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>源文本</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>430</x>
|
||||
<y>10</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>目标文本</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_dest">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>430</x>
|
||||
<y>30</y>
|
||||
<width>310</width>
|
||||
<height>430</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>按 转换 以获得目标文本</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_convert">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>330</x>
|
||||
<y>280</y>
|
||||
<width>91</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>转换</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>330</x>
|
||||
<y>100</y>
|
||||
<width>97</width>
|
||||
<height>126</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_mathpix">
|
||||
<property name="text">
|
||||
<string>Mathpix</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_textcircled">
|
||||
<property name="text">
|
||||
<string>圆圈数字</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_multiple">
|
||||
<property name="text">
|
||||
<string>多选转填空</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_puctuations">
|
||||
<property name="text">
|
||||
<string>标点转半角</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_answers">
|
||||
<property name="text">
|
||||
<string>已有答案标红</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_新增基础知识梳理 import Ui_Form
|
||||
import os
|
||||
from database_tools_2 import *
|
||||
|
||||
class MyWindow_tjjc(QWidget,Ui_Form):
|
||||
def __init__(self,database_name):
|
||||
super().__init__()
|
||||
self.database_name = database_name
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
|
||||
def setdbname(self,string):
|
||||
self.database_name = string
|
||||
# print(self.database_name)
|
||||
def bind(self):
|
||||
self.pushButton_exec.setDisabled(True)
|
||||
self.pushButton_selectfilepath.clicked.connect(self.selectfilepath)
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
def selectfilepath(self):
|
||||
self.filepath = QFileDialog.getOpenFileName(self,"选择.tex文件",os.getcwd(),"tex文件(*.tex);;所有文件(*)")[0]
|
||||
self.lineEdit_filepath.setText(self.filepath)
|
||||
self.pushButton_exec.setEnabled(True)
|
||||
def exec(self):
|
||||
mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
|
||||
mycursor = mydb.cursor()
|
||||
mycursor.execute("SELECT bn_id FROM basic_knowledges;")
|
||||
bnids = [ret[0] for ret in mycursor.fetchall()]
|
||||
bkdata_raw = ReadTextFile(self.filepath)
|
||||
bkdatabody = re.findall(r"\\begin\{enumerate\}([\s\S]*?)\\end\{enumerate\}",bkdata_raw)[0].strip().split("\\item")
|
||||
bkdata = [line.strip() for line in bkdatabody if "[" in line and "]" in line]
|
||||
currentid = int(max(bnids)[1:])+1
|
||||
|
||||
|
||||
|
||||
for line in bkdata:
|
||||
if not line.strip() == "":
|
||||
bnid = f"B{str(currentid).zfill(5)}"
|
||||
pos = line.index("]")
|
||||
head = line[1:pos]
|
||||
content = line[pos+1:].strip()
|
||||
lesson,objs = head.split("/")
|
||||
obj_list = objs.split(",")
|
||||
print(f"{bnid} {obj_list} {content}")
|
||||
sql = "INSERT INTO basic_knowledges (bn_id,bn_content) VALUE (%s,%s);"
|
||||
val = (bnid,content)
|
||||
mycursor.execute(sql,val)
|
||||
for objid in obj_list:
|
||||
sql = "INSERT INTO bn_obj_corresp (bn_id,obj_id) VALUE (%s,%s);"
|
||||
val = (bnid,objid)
|
||||
mycursor.execute(sql,val)
|
||||
sql = "INSERT INTO logs (DATE,TIME,username,action,db_content) VALUE (%s,%s,%s,%s,%s);"
|
||||
val = (GetDate(),GetTime(),get_git_username(),"新增基础",f"{bnid} {obj_list} {content}")
|
||||
mycursor.execute(sql,val)
|
||||
currentid += 1
|
||||
mydb.commit()
|
||||
mydb.close()
|
||||
print("已录入完成")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>新增基础知识梳理</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>160</y>
|
||||
<width>91</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>LaTeX文件位置</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_filepath">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>180</y>
|
||||
<width>381</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_selectfilepath">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>494</x>
|
||||
<y>150</y>
|
||||
<width>91</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择文件</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>210</y>
|
||||
<width>291</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>LaTeX文件中有一个enumerate环境.
|
||||
每一个item后面有一个中括号包围的信息, 之后是内容.
|
||||
例如: \item [K0101/K0101001B,K0101002B] 内容</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>500</x>
|
||||
<y>210</y>
|
||||
<width>81</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>添加基础知识</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
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()
|
||||
|
||||
|
|
@ -0,0 +1,236 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>widget</class>
|
||||
<widget class="QWidget" name="widget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>根据正确率选择题号</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>10</y>
|
||||
<width>91</width>
|
||||
<height>92</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>起始日期</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_startdate">
|
||||
<property name="placeholderText">
|
||||
<string>yyyymmdd</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>终止日期</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_enddate">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>yyyymmdd</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>280</x>
|
||||
<y>10</y>
|
||||
<width>91</width>
|
||||
<height>92</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>正确率下界</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_lowerbound">
|
||||
<property name="placeholderText">
|
||||
<string>如: 0.5</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>正确率上界</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_upperbound">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>如: 0.73</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>380</x>
|
||||
<y>10</y>
|
||||
<width>91</width>
|
||||
<height>92</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>班级正则表达式</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_classregex">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>如: 2026</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>480</x>
|
||||
<y>10</y>
|
||||
<width>91</width>
|
||||
<height>91</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>生成列表</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>110</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_ids">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>130</y>
|
||||
<width>391</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>220</y>
|
||||
<width>141</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>使用记录长度不一致题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_cautionids">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>240</y>
|
||||
<width>391</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>330</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>关注小题</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_subproblems">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>350</y>
|
||||
<width>391</width>
|
||||
<height>111</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
\documentclass[10pt,a4paper,twoside]{report}
|
||||
\usepackage[UTF8, fontset = none, heading = true]{ctex}
|
||||
\setCJKmainfont[BoldFont=黑体,ItalicFont=楷体]{华文中宋}
|
||||
\usepackage{amssymb,amsmath,amsfonts,amsthm,mathrsfs,graphicx}
|
||||
\usepackage{ifthen,indentfirst,enumerate,color,lastpage}
|
||||
\usepackage{tikz}
|
||||
\usepackage{multicol}
|
||||
\usepackage{multirow}
|
||||
\usepackage{makecell}
|
||||
\usepackage{longtable}
|
||||
\usepackage{diagbox}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{tcolorbox}
|
||||
\usepackage[top=1in, bottom=1in,left=0.8in,right=0.8in]{geometry}
|
||||
\usepackage{fancyhdr}
|
||||
\fancyhf{}
|
||||
\fancyhead[LO]{学号\blank{50} \ 姓名\blank{80}}
|
||||
\chead{\leftmark}
|
||||
\rhead{--\ \thepage\ of \pageref{LastPage} \ --}
|
||||
\pagestyle{fancy}
|
||||
\ctexset{section={
|
||||
name={},
|
||||
number=\chinese{section},
|
||||
}}
|
||||
\ctexset{chapter = {name = {}, number = {}, format = \center\large\bfseries}}
|
||||
\CTEXsetup[format={\bfseries\raggedright}]{section}
|
||||
\usetikzlibrary{arrows,calc,intersections,patterns,decorations.pathreplacing,3d,angles,quotes,positioning,shapes.geometric}
|
||||
|
||||
\renewcommand{\baselinestretch}{1.5}
|
||||
\newtheorem{defi}{定义~}
|
||||
\newtheorem{eg}{例~}
|
||||
\newtheorem{ex}{~}
|
||||
\newtheorem{rem}{注~}
|
||||
\newtheorem{thm}{定理~}
|
||||
\newtheorem{coro}{推论~}
|
||||
\newtheorem{axiom}{公理~}
|
||||
\newtheorem{prop}{性质~}
|
||||
\newcommand{\blank}[1]{\underline{\hbox to #1pt{}}}
|
||||
\newcommand{\bracket}[1]{(\hbox to #1pt{})}
|
||||
\newcommand{\onech}[4]{\par\begin{tabular}{p{.9\linewidth}}
|
||||
A.~#1\\
|
||||
B.~#2\\
|
||||
C.~#3\\
|
||||
D.~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\twoch}[4]{\par\begin{tabular}{p{.46\linewidth}p{0\linewidth}p{.46\linewidth}p{0\linewidth}}
|
||||
A.~#1& &B.~#2&\\
|
||||
C.~#3& &D.~#4&
|
||||
\end{tabular}}
|
||||
\newcommand{\vartwoch}[4]{\par\begin{tabular}{p{.46\linewidth}p{.46\linewidth}}
|
||||
(1)~#1& (2)~#2\\
|
||||
(3)~#3& (4)~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\fourch}[4]{\par\begin{tabular}{p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}}
|
||||
A.~#1 &B.~#2& C.~#3& D.~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\varfourch}[4]{\par\begin{tabular}{p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}}
|
||||
(1)~#1 &(2)~#2& (3)~#3& (4)~#4
|
||||
\end{tabular}}
|
||||
|
||||
\tcbuselibrary{breakable}
|
||||
|
||||
|
||||
\begin{document}
|
||||
|
||||
<<待替换1>>
|
||||
|
||||
|
||||
|
||||
\end{document}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
[BEGIN]
|
||||
##20240101
|
||||
**2026届高一01班
|
||||
1 0.875
|
||||
10001 0.825 0.630
|
||||
[END]
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
\documentclass[border = {2pt 2pt 2pt 2pt},varwidth=50em,12pt]{standalone}
|
||||
\usepackage[UTF8,fontset = none]{ctex}
|
||||
\setCJKmainfont[BoldFont=黑体,ItalicFont=楷体]{华文中宋}
|
||||
\usepackage{amssymb,amsmath,amsfonts,amsthm,mathrsfs,graphicx}
|
||||
\usepackage{ifthen,indentfirst,enumerate,color,titletoc}
|
||||
\usepackage{tikz}
|
||||
\usepackage{multicol}
|
||||
\usepackage{multirow}
|
||||
\usepackage{makecell}
|
||||
\usepackage{longtable}
|
||||
\usepackage{diagbox}
|
||||
\usetikzlibrary{arrows,calc,intersections,patterns,decorations.pathreplacing,3d,angles,quotes,positioning,shapes.geometric}
|
||||
\usepackage[bf,small,indentafter,pagestyles]{titlesec}
|
||||
% \usepackage[top=1in, bottom=1in,left=0.8in,right=0.8in]{geometry}
|
||||
\renewcommand{\baselinestretch}{1.65}
|
||||
\newtheorem{defi}{定义~}
|
||||
\newtheorem{eg}{例~}
|
||||
\newtheorem{ex}{~}
|
||||
\newtheorem{rem}{注~}
|
||||
\newtheorem{thm}{定理~}
|
||||
\newtheorem{coro}{推论~}
|
||||
\newtheorem{axiom}{公理~}
|
||||
\newtheorem{prop}{性质~}
|
||||
\newcommand{\blank}[1]{\underline{\hbox to #1pt{}}}
|
||||
\newcommand{\bracket}[1]{(\hbox to #1pt{})}
|
||||
\newcommand{\onech}[4]{\par\begin{tabular}{p{.9\linewidth}}
|
||||
A.~#1\\
|
||||
B.~#2\\
|
||||
C.~#3\\
|
||||
D.~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\twoch}[4]{\par\begin{tabular}{p{.46\linewidth}p{.0\linewidth}p{.46\linewidth}p{.0\textwidth}}
|
||||
A.~#1& &B.~#2&\\
|
||||
C.~#3& &D.~#4&
|
||||
\end{tabular}}
|
||||
\newcommand{\vartwoch}[4]{\par\begin{tabular}{p{.46\linewidth}p{.46\linewidth}}
|
||||
(1)~#1& (2)~#2\\
|
||||
(3)~#3& (4)~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\fourch}[4]{\par\begin{tabular}{p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}}
|
||||
A.~#1 &B.~#2& C.~#3& D.~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\varfourch}[4]{\par\begin{tabular}{p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}}
|
||||
(1)~#1 &(2)~#2& (3)~#3& (4)~#4
|
||||
\end{tabular}}
|
||||
\begin{document}
|
||||
|
||||
<<待替换1>>
|
||||
|
||||
\end{document}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
\documentclass[10pt,a4paper,twoside]{article}
|
||||
\usepackage[UTF8, fontset = none, heading = true]{ctex}
|
||||
\setCJKmainfont[BoldFont=黑体,ItalicFont=楷体]{华文中宋}
|
||||
\usepackage{amssymb,amsmath,amsfonts,amsthm,mathrsfs,graphicx}
|
||||
\usepackage{ifthen,indentfirst,enumerate,color,lastpage}
|
||||
\usepackage{tikz}
|
||||
\usepackage{multicol}
|
||||
\usepackage{multirow}
|
||||
\usepackage{makecell}
|
||||
\usepackage{longtable}
|
||||
\usepackage{diagbox}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{tcolorbox}
|
||||
\usepackage[top=1in, bottom=1in,left=0.8in,right=0.8in]{geometry}
|
||||
\usepackage{fancyhdr}
|
||||
\fancyhf{}
|
||||
\fancyhead[LO]{学号\blank{50} \ 姓名\blank{80}}
|
||||
\chead{\papername}
|
||||
\rhead{--\ \thepage\ of \pageref{LastPage} \ --}
|
||||
\pagestyle{fancy}
|
||||
\ctexset{section={
|
||||
name={},
|
||||
number=\chinese{section},
|
||||
}}
|
||||
\CTEXsetup[format={\bfseries\raggedright}]{section}
|
||||
\usetikzlibrary{arrows,calc,intersections,patterns,decorations.pathreplacing,3d,angles,quotes,positioning,shapes.geometric}
|
||||
|
||||
\renewcommand{\baselinestretch}{1.5}
|
||||
\newtheorem{defi}{定义~}
|
||||
\newtheorem{eg}{例~}
|
||||
\newtheorem{ex}{~}
|
||||
\newtheorem{rem}{注~}
|
||||
\newtheorem{thm}{定理~}
|
||||
\newtheorem{coro}{推论~}
|
||||
\newtheorem{axiom}{公理~}
|
||||
\newtheorem{prop}{性质~}
|
||||
\newcommand{\blank}[1]{\underline{\hbox to #1pt{}}}
|
||||
\newcommand{\bracket}[1]{(\hbox to #1pt{})}
|
||||
\newcommand{\onech}[4]{\par\begin{tabular}{p{.9\linewidth}}
|
||||
A.~#1\\
|
||||
B.~#2\\
|
||||
C.~#3\\
|
||||
D.~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\twoch}[4]{\par\begin{tabular}{p{.46\linewidth}p{0\linewidth}p{.46\linewidth}p{0\linewidth}}
|
||||
A.~#1& &B.~#2&\\
|
||||
C.~#3& &D.~#4&
|
||||
\end{tabular}}
|
||||
\newcommand{\vartwoch}[4]{\par\begin{tabular}{p{.46\linewidth}p{.46\linewidth}}
|
||||
(1)~#1& (2)~#2\\
|
||||
(3)~#3& (4)~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\fourch}[4]{\par\begin{tabular}{p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}}
|
||||
A.~#1 &B.~#2& C.~#3& D.~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\varfourch}[4]{\par\begin{tabular}{p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}}
|
||||
(1)~#1 &(2)~#2& (3)~#3& (4)~#4
|
||||
\end{tabular}}
|
||||
|
||||
\tcbuselibrary{breakable}
|
||||
\newcommand{\papername}{<<待替换1>>}
|
||||
|
||||
\begin{document}
|
||||
\begin{center}
|
||||
{\bf\large \papername}
|
||||
\end{center}
|
||||
|
||||
<<待替换2>>
|
||||
|
||||
|
||||
|
||||
\end{document}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
\documentclass[10pt,a4paper]{article}
|
||||
\usepackage[UTF8,fontset = none]{ctex}
|
||||
\setCJKmainfont[BoldFont=黑体,ItalicFont=楷体]{华文中宋}
|
||||
\usepackage{amssymb,amsmath,amsfonts,amsthm,mathrsfs,dsfont,graphicx}
|
||||
\usepackage{ifthen,indentfirst,enumerate,color,titletoc}
|
||||
\usepackage{tikz}
|
||||
\usepackage{multicol}
|
||||
\usepackage{multirow}
|
||||
\usepackage{makecell}
|
||||
\usepackage{longtable}
|
||||
\usepackage{diagbox}
|
||||
\usetikzlibrary{arrows,calc,intersections,patterns,decorations.pathreplacing,3d,angles,quotes,positioning,shapes.geometric}
|
||||
\usepackage[bf,small,indentafter,pagestyles]{titlesec}
|
||||
\usepackage[top=1in, bottom=1in,left=0.8in,right=0.8in]{geometry}
|
||||
\renewcommand{\baselinestretch}{1.65}
|
||||
\newtheorem{defi}{定义~}
|
||||
\newtheorem{eg}{例~}
|
||||
\newtheorem{ex}{~}
|
||||
\newtheorem{rem}{注~}
|
||||
\newtheorem{thm}{定理~}
|
||||
\newtheorem{coro}{推论~}
|
||||
\newtheorem{axiom}{公理~}
|
||||
\newtheorem{prop}{性质~}
|
||||
\newcommand{\blank}[1]{\underline{\hbox to #1pt{}}}
|
||||
\newcommand{\bracket}[1]{(\hbox to #1pt{})}
|
||||
\newcommand{\onech}[4]{\par\begin{tabular}{p{.9\linewidth}}
|
||||
A.~#1\\
|
||||
B.~#2\\
|
||||
C.~#3\\
|
||||
D.~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\twoch}[4]{\par\begin{tabular}{p{.46\linewidth}p{0\linewidth}p{.46\linewidth}p{0\linewidth}}
|
||||
A.~#1& &B.~#2&\\
|
||||
C.~#3& &D.~#4&
|
||||
\end{tabular}}
|
||||
\newcommand{\vartwoch}[4]{\par\begin{tabular}{p{.46\linewidth}p{.46\linewidth}}
|
||||
(1)~#1& (2)~#2\\
|
||||
(3)~#3& (4)~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\fourch}[4]{\par\begin{tabular}{p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}}
|
||||
A.~#1 &B.~#2& C.~#3& D.~#4
|
||||
\end{tabular}}
|
||||
\newcommand{\varfourch}[4]{\par\begin{tabular}{p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}p{.23\linewidth}}
|
||||
(1)~#1 &(2)~#2& (3)~#3& (4)~#4
|
||||
\end{tabular}}
|
||||
\begin{document}
|
||||
|
||||
<<待替换>>
|
||||
|
||||
\end{document}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_添加关联题目 import Ui_Form
|
||||
from database_tools_2 import *
|
||||
|
||||
class MyWindow_tjgl(QWidget,Ui_Form):
|
||||
def __init__(self,database_name):
|
||||
super().__init__()
|
||||
self.database_name = database_name
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
def setdbname(self,string):
|
||||
self.database_name = string
|
||||
# print(self.database_name)
|
||||
def bind(self):
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
|
||||
def exec(self):
|
||||
old_ids = RefinePunctuations(self.lineEdit_oldids.text()).strip() # 需要添加关联题目的id字符串
|
||||
starting_id = self.lineEdit_newid.text().strip() # 目的地的id字符串从这个位置后的首个空闲开始, 其中空闲位置需不少于old_ids中的题目数量 20240124修改
|
||||
editor = self.lineEdit_editor.text().strip() # 修改人姓名
|
||||
new_ids = NextSpareIDBlock(starting_id,self.database_name)
|
||||
links = CreateIDLinks(generate_number_set(old_ids),generate_number_set(new_ids))
|
||||
bodydata = CreateRelatedProblems(links,self.database_name)
|
||||
tempfilepath = "临时文件/problem_edit.tex"
|
||||
latextemplate = "模板文件/题目编辑.txt"
|
||||
latexdata = ReadTextFile(latextemplate)
|
||||
latexdata = StringSubstitute("<<待替换>>",latexdata,(bodydata,))
|
||||
SaveTextFile(latexdata,tempfilepath)
|
||||
print("编辑完毕后, 保存关闭文件继续.")
|
||||
os.system(f"code -w -g {tempfilepath}") #-w表示关闭窗口后继续下一步
|
||||
if XeLaTeXCompile("临时文件",tempfilepath,times=1):
|
||||
problems = GenerateProblemListFromString2024(ReadTextFile(tempfilepath))
|
||||
for problem in problems:
|
||||
id_and_content = problem[0]
|
||||
oid = re.findall(r"^\((\d{6})->",id_and_content)[0]
|
||||
id = re.findall(r"^\(\d{6}->(\d{6})\)",id_and_content)[0]
|
||||
content = re.findall(r"->\d{6}\)([\S\s]*)$",id_and_content)[0].strip()
|
||||
print(id,content)
|
||||
AddRelatedProblemToDB(id,content,oid,editor,self.database_name)
|
||||
print("编译成功, 已汇入题库")
|
||||
else:
|
||||
print("编译失败, 未汇入题库")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>添加关联题目</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>460</x>
|
||||
<y>120</y>
|
||||
<width>81</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>添加关联题目</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>120</y>
|
||||
<width>196</width>
|
||||
<height>80</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>旧题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_oldids"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>新起始题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_newid"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>编辑者</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_editor"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_生成直方图代码 import Ui_Form
|
||||
import re
|
||||
|
||||
|
||||
class MyWindow_hist(QWidget,Ui_Form):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
def bind(self):
|
||||
self.pushButton_generatexlist.clicked.connect(self.generateXList)
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
def generateXList(self):
|
||||
self.xmin = int(self.lineEdit_xmin.text())
|
||||
self.xmax = int(self.lineEdit_xmax.text())
|
||||
self.xwidth = int(self.lineEdit_xwidth.text())
|
||||
self.xlist = list(range(self.xmin,self.xmax,self.xwidth))
|
||||
output = ""
|
||||
for x in self.xlist:
|
||||
output += f"({x},)[]\n"
|
||||
self.plainTextEdit_yinfo.setPlainText(output)
|
||||
def folding(self):
|
||||
if self.xmin <= self.xwidth:
|
||||
foldingstr = ""
|
||||
else:
|
||||
midpoint = 1/2 * (self.xstart + self.xmin)
|
||||
dist = (midpoint - self.xstart) / 6
|
||||
foldingstr = ""
|
||||
height = 0.2/self.yscale
|
||||
foldingstr += f" -- ({(self.xstart+dist*4):.2f},0)"
|
||||
foldingstr += f" -- ({(self.xstart+dist*5):.2f},{height:.4f})"
|
||||
foldingstr += f" -- ({(self.xstart+dist*7):.2f},{-height:.4f})"
|
||||
foldingstr += f" -- ({(self.xstart+dist*8):.2f},0)"
|
||||
return foldingstr
|
||||
def exec(self):
|
||||
xlabel = self.lineEdit_xlabel.text()
|
||||
coordinateinfo = self.plainTextEdit_yinfo.toPlainText()
|
||||
if self.xmin < self.xwidth: #计算x轴的起点坐标
|
||||
self.xstart = 0
|
||||
else:
|
||||
self.xstart = self.xmin - self.xwidth
|
||||
self.xmax = self.xlist[-1] + self.xwidth
|
||||
self.xend = self.xmax + self.xwidth #计算x轴的终点坐标
|
||||
self.xscale = 5/(self.xend-self.xstart) #计算x放缩比例
|
||||
# print(self.xscale)
|
||||
self.coordinatelist = re.findall(r"\(([\d\.]+),([\d\.]+)\)\[([\S]*)\]",coordinateinfo) #计算坐标信息
|
||||
for cindex in range(len(self.coordinatelist)):
|
||||
x,y,label = self.coordinatelist[cindex]
|
||||
if label.strip() == "":
|
||||
self.coordinatelist[cindex] = (x,y,y)
|
||||
self.coordinatestr_raw = []
|
||||
for coord in self.coordinatelist:
|
||||
x,y,label = coord
|
||||
self.coordinatestr_raw.append(f"{x}/{y}")
|
||||
self.coordinatestr = ",".join(self.coordinatestr_raw)
|
||||
# print(self.coordinatelist)
|
||||
self.dasheddict = {} #计算以纵坐标为key的虚线信息, 内容为(x,label)
|
||||
for coord in self.coordinatelist:
|
||||
x,y,label = coord
|
||||
if not y in self.dasheddict:
|
||||
self.dasheddict[y] = (x,label)
|
||||
else:
|
||||
if x > self.dasheddict[y][0] and label == y:
|
||||
self.dasheddict[y] = (x,self.dasheddict[y][1])
|
||||
elif x > self.dasheddict[y][0] and label != y:
|
||||
self.dasheddict[y] = (x,label)
|
||||
self.dashedstr_raw = []
|
||||
for y in self.dasheddict:
|
||||
x,label = self.dasheddict[y]
|
||||
self.dashedstr_raw.append(f"{x}/{y}/{label}")
|
||||
self.dashedstr = ",".join(self.dashedstr_raw)
|
||||
# print(self.dasheddict)
|
||||
ymax = max([float(i) for i in self.dasheddict.keys()])
|
||||
self.yscale = 3/ymax #3是y的长度, 计算y放缩比例
|
||||
self.yend = ymax + 1/float(self.yscale)
|
||||
latexcode = f"""\\begin{{center}}
|
||||
\\begin{{tikzpicture}}[>=latex, xscale = {self.xscale:.4f}, yscale = {self.yscale:.4f}]
|
||||
\\draw [->] ({self.xstart},0) {self.folding()}-- ({self.xend},0) node [below right] {{{xlabel}}};
|
||||
\\draw [->] ({self.xstart},0) -- ({self.xstart},{self.yend:.2f}) node [left] {{$\\dfrac{{\\text{{频率}}}}{{\\text{{组距}}}}$}};
|
||||
\\draw ({self.xstart},0) node [below] {{$0$}};
|
||||
\\foreach \\i/\\j in {{{self.coordinatestr}}}
|
||||
{{\\draw (\\i,0) node [below] {{$\\i$}} --++ (0,\\j) --++ ({self.xwidth},0) --++ (0,-\\j);}};
|
||||
\\draw ({self.xmax},0) node [below] {{${self.xmax}$}};
|
||||
\\foreach \i/\j/\k in {{{self.dashedstr}}}
|
||||
{{\\draw [dashed] (\\i,\\j) -- ({self.xstart},\\j) node [left] {{$\\k$}};}};
|
||||
\\end{{tikzpicture}}
|
||||
\\end{{center}}"""
|
||||
latexcode = re.sub(r"\n\s+","\n",latexcode)
|
||||
self.plainTextEdit_latexcode.setPlainText(latexcode)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,193 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>生成直方图代码</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_generatexlist">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>130</y>
|
||||
<width>121</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>生成横坐标序列</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextBrowser" name="textBrowser">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>160</y>
|
||||
<width>121</width>
|
||||
<height>211</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
hr { height: 1px; border-width: 0; }
|
||||
li.unchecked::marker { content: "\2610"; }
|
||||
li.checked::marker { content: "\2612"; }
|
||||
</style></head><body style=" font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">不改变横坐标的值, 在逗号后输入纵坐标的值</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">如果标签和纵坐标的值不同, 在后面的方括号内输入标签</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">如:</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(10,0.02)[]</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(20,0.04)[a]</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(30,0.04][]</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>140</x>
|
||||
<y>10</y>
|
||||
<width>121</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>输入纵坐标信息</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_yinfo">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>140</x>
|
||||
<y>30</y>
|
||||
<width>521</width>
|
||||
<height>181</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>670</x>
|
||||
<y>30</y>
|
||||
<width>71</width>
|
||||
<height>181</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>生成代码</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>140</x>
|
||||
<y>220</y>
|
||||
<width>71</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>直方图代码</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_latexcode">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>140</x>
|
||||
<y>240</y>
|
||||
<width>601</width>
|
||||
<height>221</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>121</width>
|
||||
<height>108</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>x最小值</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_xmin"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>x最大值</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_xmax"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>x宽度</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_xwidth"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>x轴label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_xlabel"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_答题纸对应 import Ui_Form
|
||||
from database_tools_2 import *
|
||||
|
||||
def getindices(string):
|
||||
indices_list = []
|
||||
notesjsonpath = f"../备课组/{string[3:5]}届/校本材料.json"
|
||||
try:
|
||||
notesjson = load_dict(notesjsonpath)
|
||||
for id in notesjson["notes"]:
|
||||
if id.startswith(string):
|
||||
indices_list.append(id[-2:])
|
||||
return indices_list
|
||||
except:
|
||||
return []
|
||||
|
||||
|
||||
|
||||
|
||||
class MyWindow_dtlr(QWidget,Ui_Form):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
def bind(self):
|
||||
self.label_next.setVisible(False)
|
||||
self.comboBox_grade.activated.connect(self.setindex)
|
||||
self.comboBox_semester.activated.connect(self.setindex)
|
||||
self.lineEdit_structure.textChanged.connect(self.setindex)
|
||||
self.comboBox_index.activated.connect(self.activateexec)
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
|
||||
def setindex(self):
|
||||
self.comboBox_index.clear()
|
||||
self.structure = self.lineEdit_structure.text().upper()
|
||||
self.grade = self.comboBox_grade.currentText()
|
||||
self.semester = self.comboBox_semester.currentText()
|
||||
self.initialstring = f"{self.structure}{self.grade}{self.semester}"
|
||||
self.indices = getindices(self.initialstring)
|
||||
self.comboBox_index.addItems(self.indices)
|
||||
if self.indices == []:
|
||||
self.pushButton_exec.setDisabled(True)
|
||||
else:
|
||||
self.pushButton_exec.setEnabled(True)
|
||||
def activateexec(self):
|
||||
self.pushButton_exec.setEnabled(True)
|
||||
def unvisible(self):
|
||||
self.label_next.setVisible(False)
|
||||
def exec(self):
|
||||
pid = f"{self.structure}{self.grade}{self.semester}{self.comboBox_index.currentText()}"
|
||||
answersheetjson = f"../备课组/{self.grade[-2:]}届/答题纸对应.json"
|
||||
notesjson = f"../备课组/{self.grade[-2:]}届/校本材料.json"
|
||||
marks_list = re.findall(r"(?:(?:^)|(?:\n))(\d+)分",self.plainTextEdit_marks.toPlainText())
|
||||
marks_list = [int(mark) for mark in marks_list]
|
||||
|
||||
answersheet_dict = load_dict(answersheetjson)
|
||||
notes_dict = load_dict(notesjson)
|
||||
|
||||
new_dict = {}
|
||||
|
||||
if not pid in notes_dict["notes"]:
|
||||
print("讲义编号有误.")
|
||||
else:
|
||||
self.label_next.setVisible(True)
|
||||
self.repaint()
|
||||
new_dict["id"] = pid
|
||||
corresponding_method = input("用何种方式对应? 题号(I)/章节标题(P):")
|
||||
if corresponding_method[0].upper() == "I":
|
||||
new_dict["idlist"] = []
|
||||
count = 1
|
||||
id = input(f"输入第 {count} 题的题号(S表示跳过, E表示结束):")
|
||||
while len(re.findall(r"[Ss\d,:]",id)) == len(id):
|
||||
if "S" in id.upper():
|
||||
new_dict["idlist"].append("999999")
|
||||
count += 1
|
||||
else:
|
||||
new_id_list = generate_number_set(id)
|
||||
new_dict["idlist"] += [i.zfill(6) for i in new_id_list]
|
||||
count += len(new_id_list)
|
||||
id = input(f"输入第 {count} 题的题号(S表示跳过, E表示结束):")
|
||||
|
||||
|
||||
elif corresponding_method[0].upper() == "P":
|
||||
structure = notes_dict["structures"][pid[0]]["structure"]
|
||||
count = 1
|
||||
partslist = []
|
||||
for key in structure:
|
||||
print(f"{count}. {key}: {structure[key]['name']}")
|
||||
count += 1
|
||||
partslist.append(key)
|
||||
parts_selected_string = input("使用哪些部分(输入数字编号, 用';'分隔):")
|
||||
parts_selected_index = parts_selected_string.strip().split(";")
|
||||
parts_selected = []
|
||||
for i in parts_selected_index:
|
||||
parts_selected.append(partslist[int(i)-1])
|
||||
new_dict["parts"] = parts_selected.copy()
|
||||
if marks_list == []:
|
||||
marksflag = input("是否为每个结果赋分(Y/N):")
|
||||
if marksflag[0].upper() == "Y":
|
||||
new_dict["marks"] = []
|
||||
count = 1
|
||||
mark = input(f"依次输入分数, 非自然数作为结束(第 {count} 个位置):")
|
||||
while len(re.findall(r"\d",mark)) == len(mark):
|
||||
new_dict["marks"].append(int(mark))
|
||||
count += 1
|
||||
mark = input(f"依次输入分数, 非自然数作为结束(第 {count} 个位置):")
|
||||
else:
|
||||
new_dict["marks"] = marks_list.copy()
|
||||
|
||||
|
||||
answersheet_dict[self.lineEdit_xiaoxianid.text()] = new_dict.copy()
|
||||
save_dict(answersheet_dict,answersheetjson)
|
||||
self.label_next.setVisible(False)
|
||||
print("设置完成")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,250 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>答题纸对应</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>90</y>
|
||||
<width>81</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>对应讲义代码</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>440</x>
|
||||
<y>140</y>
|
||||
<width>111</width>
|
||||
<height>191</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>添加答题纸对应</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>60</y>
|
||||
<width>371</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>小闲试卷ID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_xiaoxianid"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>110</y>
|
||||
<width>371</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>类型</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_structure">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>届别</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_grade">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2022</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2023</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2024</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2025</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2026</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2027</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2028</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2029</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>学期</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_semester">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>00</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>01</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>02</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>03</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>04</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>05</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>06</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>序号</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_index"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_marks">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>160</y>
|
||||
<width>251</width>
|
||||
<height>171</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>将小闲平台答题纸 修改 界面中间靠右的所有分数复制到该文本框, 留空表示均为1分</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>140</y>
|
||||
<width>111</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>小闲平台各题满分</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_next">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>340</y>
|
||||
<width>161</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>请到终端完成之后的操作</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_系列讲义生成 import Ui_Form
|
||||
from database_tools_2 import *
|
||||
import os
|
||||
|
||||
class MyWindow_jysc(QWidget,Ui_Form):
|
||||
def __init__(self,database_name):
|
||||
super().__init__()
|
||||
self.database_name = database_name
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
|
||||
def bind(self):
|
||||
self.outputpath = os.path.join(os.getcwd(),"临时文件")
|
||||
self.lineEdit_path.setText(self.outputpath)
|
||||
self.TeachersCheckBoxList = [self.checkBox_ans,self.checkBox_objs,self.checkBox_tags,self.checkBox_solution,self.checkBox_usages,self.checkBox_origin,self.checkBox_remark]
|
||||
self.StudentsCheckBoxList = [self.checkBox_space,self.checkBox_ans]
|
||||
self.ContnetCheckBoxList = [self.checkBox_ans,self.checkBox_objs,self.checkBox_tags,self.checkBox_solution,self.checkBox_usages,self.checkBox_origin,self.checkBox_remark,self.checkBox_space]
|
||||
for widget in self.ContnetCheckBoxList:
|
||||
widget.setDisabled(True)
|
||||
self.studentlayout()
|
||||
self.disableusagessetting()
|
||||
self.radioButton_teacher.clicked.connect(self.teacherlayout)
|
||||
self.radioButton_student.clicked.connect(self.studentlayout)
|
||||
self.checkBox_usages.clicked.connect(self.toggleusagessetting)
|
||||
self.radioButton_student.clicked.connect(self.toggleusagessetting)
|
||||
self.radioButton_teacher.clicked.connect(self.toggleusagessetting)
|
||||
self.pushButton_exec.clicked.connect(self.saveandbuild)
|
||||
self.pushButton_SelectPath.clicked.connect(self.selectpath)
|
||||
|
||||
|
||||
|
||||
def disableusagessetting(self):
|
||||
self.lineEdit_high.setDisabled(True)
|
||||
self.lineEdit_low.setDisabled(True)
|
||||
self.lineEdit_grades.setDisabled(True)
|
||||
def enableusagessetting(self):
|
||||
self.lineEdit_high.setEnabled(True)
|
||||
self.lineEdit_low.setEnabled(True)
|
||||
self.lineEdit_grades.setEnabled(True)
|
||||
def toggleusagessetting(self):
|
||||
if self.checkBox_usages.isChecked() and self.radioButton_teacher.isChecked():
|
||||
self.enableusagessetting()
|
||||
else:
|
||||
self.disableusagessetting()
|
||||
|
||||
def studentlayout(self):
|
||||
for widget in self.TeachersCheckBoxList:
|
||||
widget.setDisabled(True)
|
||||
for widget in self.StudentsCheckBoxList:
|
||||
widget.setEnabled(True)
|
||||
|
||||
def selectpath(self):
|
||||
self.outputpath = QFileDialog.getExistingDirectory(None, "选择文件夹")
|
||||
self.lineEdit_path.setText(self.outputpath)
|
||||
|
||||
def teacherlayout(self):
|
||||
for widget in self.StudentsCheckBoxList:
|
||||
widget.setDisabled(True)
|
||||
for widget in self.TeachersCheckBoxList:
|
||||
widget.setEnabled(True)
|
||||
def generate_usages(self):
|
||||
high = self.lineEdit_high.text().strip()
|
||||
low = self.lineEdit_low.text().strip()
|
||||
if self.checkBox_usages.isChecked() == False:
|
||||
return [-2,-2]
|
||||
elif self.checkBox_usages.isChecked() and high == "" and low == "":
|
||||
return [-1,-1]
|
||||
else:
|
||||
if high == "":
|
||||
high = "0"
|
||||
if low == "":
|
||||
low = "0"
|
||||
return [int(high),int(low)]
|
||||
|
||||
def setdbname(self,string):
|
||||
self.database_name = string
|
||||
# print(self.database_name)
|
||||
|
||||
def saveandbuild(self):
|
||||
patterns = self.lineEdit_regex.text().strip().split(",")
|
||||
jsonpath = "../备课组" #有json文件的根目录, 文件名需为"校本材料.json"
|
||||
jsondicts = []
|
||||
for loc,dirs,files in os.walk(jsonpath):
|
||||
if "校本材料.json" in files:
|
||||
jsondicts.append(load_dict(os.path.join(loc,"校本材料.json")))
|
||||
|
||||
mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
|
||||
mycursor = mydb.cursor()
|
||||
# raw_pro_dict = load_dict("../题库0.3/Problems.json")
|
||||
# obj_dict = load_dict("../题库0.3/LessonObj.json")
|
||||
# basicknowledge_dict = load_dict("../题库0.3/BasicKnowledge.json")
|
||||
if self.radioButton_teacher.isChecked() and self.checkBox_usages.isChecked() and not self.lineEdit_grades.text().strip() == "":
|
||||
grades = self.lineEdit_grades.text().strip().split(",")
|
||||
else:
|
||||
grades = []
|
||||
# pro_dict = select_grade_from_pro_dict(raw_pro_dict,grades)
|
||||
# dictionaries = {} #合并字典
|
||||
# for t in (obj_dict,basicknowledge_dict,pro_dict):
|
||||
# dictionaries.update(t)
|
||||
configjson = {
|
||||
"教师版": self.radioButton_teacher.isChecked(),
|
||||
"字段显示设置": {
|
||||
"题后空间": self.checkBox_space.isChecked(),
|
||||
"课时目标": self.checkBox_objs.isChecked(),
|
||||
"题目标签": self.checkBox_tags.isChecked(),
|
||||
"答案": self.checkBox_ans.isChecked(),
|
||||
"解答与提示": self.checkBox_solution.isChecked(),
|
||||
"使用记录": self.generate_usages(),
|
||||
"来源": self.checkBox_origin.isChecked(),
|
||||
"备注": self.checkBox_remark.isChecked(),
|
||||
"届别": grades
|
||||
},
|
||||
"编译单个文件": self.checkBox_singlenote.isChecked(),
|
||||
"编译合集": self.checkBox_seriesnote.isChecked()
|
||||
}
|
||||
papernames = []
|
||||
multitexdata = []
|
||||
for notes_dict in jsondicts:
|
||||
for lessonid in notes_dict["notes"]:
|
||||
coincideflag = False
|
||||
for lessonpattern in patterns:
|
||||
if re.findall(lessonpattern,lessonid) != []:
|
||||
coincideflag = True
|
||||
break
|
||||
if coincideflag:
|
||||
print(f"正在生成 {lessonid} {notes_dict['notes'][lessonid]['filename']} 的 .tex 文件")
|
||||
filename = notes_dict["notes"][lessonid]["id"]+notes_dict["notes"][lessonid]["filename"]+".tex"
|
||||
papertype = lessonid[0]
|
||||
consecutivenumbering = notes_dict["structures"][papertype]["consecutivenumbering"]
|
||||
texdata = GenerateSingleLessonNotefromMariaDB(cursor = mycursor, id = lessonid,notesdict=notes_dict,templatepath="./模板文件/讲义模板.txt",outputfilepath = os.path.join(self.outputpath,filename),misc=configjson,consecutivenumbering = consecutivenumbering)
|
||||
papernames.append(notes_dict["notes"][lessonid]["id"]+" \\ "+notes_dict["notes"][lessonid]["name"])
|
||||
print(f"已生成 {papernames[-1]} 文件")
|
||||
multitexdata.append(re.findall(r"\\begin{center}\n{\\bf\\large \\papername}\n\\end{center}([\s\S]*\\end\{enumerate\})",texdata)[0])
|
||||
# print(lessonid)
|
||||
# print(configjson)
|
||||
# print("\n".join(patterns))
|
||||
mydb.close()
|
||||
merged = ""
|
||||
for i in range(len(papernames)):
|
||||
merged += "\n\n\\chapter{"+papernames[i]+"}\n\n\n"
|
||||
merged += multitexdata[i]
|
||||
|
||||
print("已生成合集的 .tex 文件")
|
||||
|
||||
mergedtext = StringSubstitute(r"<<待替换[\d]+>>",ReadTextFile("./模板文件/合集模板.txt"),[merged])
|
||||
if sys.platform != "win32":
|
||||
mergedtext = re.sub(r"fontset[\s]*=[\s]*none","fontset = fandol",mergedtext)
|
||||
mergedtext = re.sub(r"\\setCJKmainfont",r"% \\setCJKmainfont",mergedtext)
|
||||
SaveTextFile(mergedtext,os.path.join(self.outputpath,f"合集{GetDate()}.tex"))
|
||||
|
||||
# if not "编译合集" in configjson or configjson["编译合集"] == False:
|
||||
# tocompile = input("需要编译合集吗?(Y/[N]):")
|
||||
if configjson["编译合集"] == True:
|
||||
XeLaTeXCompile(self.outputpath,f"合集{GetDate()}.tex")
|
||||
print("合集编译完成")
|
||||
print("执行完毕.")
|
||||
startfile(self.outputpath)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,322 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>系列讲义生成</string>
|
||||
</property>
|
||||
<widget class="QLineEdit" name="lineEdit_regex">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>60</y>
|
||||
<width>431</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>60</y>
|
||||
<width>91</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>讲义编号表达式</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>570</x>
|
||||
<y>60</y>
|
||||
<width>171</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>用 "," 分隔的一系列正则表达式</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>510</x>
|
||||
<y>310</y>
|
||||
<width>221</width>
|
||||
<height>131</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>开始生成与编译</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>90</y>
|
||||
<width>61</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>文件路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_path">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>110</y>
|
||||
<width>701</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_SelectPath">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>660</x>
|
||||
<y>80</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>170</y>
|
||||
<width>81</width>
|
||||
<height>111</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>版式选择</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_student">
|
||||
<property name="text">
|
||||
<string>学生版</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_teacher">
|
||||
<property name="text">
|
||||
<string>教师版</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>250</x>
|
||||
<y>170</y>
|
||||
<width>151</width>
|
||||
<height>271</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>内容选项</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_space">
|
||||
<property name="text">
|
||||
<string>题后空间</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_ans">
|
||||
<property name="text">
|
||||
<string>答案</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_objs">
|
||||
<property name="text">
|
||||
<string>课时目标</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_tags">
|
||||
<property name="text">
|
||||
<string>题目标签</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_solution">
|
||||
<property name="text">
|
||||
<string>解答与提示</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_usages">
|
||||
<property name="text">
|
||||
<string>使用记录</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_origin">
|
||||
<property name="text">
|
||||
<string>来源</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_remark">
|
||||
<property name="text">
|
||||
<string>备注</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>510</x>
|
||||
<y>170</y>
|
||||
<width>222</width>
|
||||
<height>121</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_usagepanel">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>使用记录选择(都留空为全显示)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>高</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_high">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>低</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_low"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>届别选择(用 "," 分隔, 留空为全显示)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_grades"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>300</y>
|
||||
<width>81</width>
|
||||
<height>141</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>编译选项</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_singlenote">
|
||||
<property name="text">
|
||||
<string>单张编译</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_seriesnote">
|
||||
<property name="text">
|
||||
<string>合集编译</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_统考数据导入 import Ui_Form
|
||||
import os
|
||||
from database_tools_2 import *
|
||||
|
||||
|
||||
class MyWindow_tkdr(QWidget,Ui_Form):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
|
||||
def bind(self):
|
||||
self.pushButton_paper.clicked.connect(self.selectpaper)
|
||||
self.pushButton_excel.clicked.connect(self.selectexcel)
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
|
||||
def selectpaper(self):
|
||||
self.texfile = QFileDialog.getOpenFileName(self,"选择试卷文件",os.getcwd(),"试卷文件(*.tex *.pdf);;所有文件(*)")[0]
|
||||
self.lineEdit_paperfile.setText(self.texfile)
|
||||
def selectexcel(self):
|
||||
self.excelfile = QFileDialog.getOpenFileName(self,"选择统计文件",os.getcwd(),"Excel文件(*.xlsx);;所有文件(*)")[0]
|
||||
self.lineEdit_excelfile.setText(self.excelfile)
|
||||
def exec(self):
|
||||
sheetname = "难度统计" # excel中难度数据所在的工作表名
|
||||
date = self.lineEdit_date.text().strip() # 考试日期
|
||||
grade = self.lineEdit_grade.text().strip() # 考试年级
|
||||
max_classnum = int(self.lineEdit_classnum.text().strip()) # 年级参加考试的最大班级班号
|
||||
outputfilepath = r"文本文件/metadata.txt" # 输出的用于导入的metadata.txt文件位置
|
||||
checkingfilepath = r"临时文件/手动统计结果.txt" # 用于检查结构的文件所在位置
|
||||
|
||||
|
||||
|
||||
df = pd.read_excel(self.excelfile,sheet_name = sheetname)
|
||||
problems_list = generate_number_set(extractIDs(self.texfile))
|
||||
|
||||
#生成题号(1~n)与题库id对应
|
||||
id_dict = {}
|
||||
for i in range(len(problems_list)):
|
||||
id_dict[i+1] = problems_list[i]
|
||||
|
||||
output = "usages\n\n"
|
||||
checkoutput = ""
|
||||
#生成题号(1~n)与表格中数据列的对应
|
||||
idcol_dict = {}
|
||||
for i in id_dict:
|
||||
idcol_dict[i] = []
|
||||
mincol = -1
|
||||
for col_index in range(mincol+1,len(df.columns)):
|
||||
col = df.columns[col_index]
|
||||
if str(col).startswith(str(i)):
|
||||
idcol_dict[i].append(col_index)
|
||||
mincol = col_index
|
||||
if str(i) == str(col):
|
||||
break
|
||||
|
||||
#生成行号与班级的对应列表
|
||||
classrows_dict = {}
|
||||
for row in df.iloc[:,0]:
|
||||
if type(row) == int or type(row) == float:
|
||||
if 1<=row<=max_classnum:
|
||||
row = int(row)
|
||||
classrows_dict[list(df.iloc[:,0]).index(row)] = str(row).zfill(2) + "班"
|
||||
|
||||
#生成手动统计列表
|
||||
for cl in classrows_dict:
|
||||
classname = grade + classrows_dict[cl]
|
||||
checkoutput += "[BEGIN]\n"
|
||||
checkoutput += "## "+date+"\n"
|
||||
checkoutput += "** "+classname+"\n"
|
||||
for i in range(len(problems_list)):
|
||||
id = id_dict[i+1]
|
||||
results_cols = idcol_dict[i+1]
|
||||
results = []
|
||||
for col in results_cols:
|
||||
results.append("%.3f"%df.iloc[cl,col])
|
||||
checkoutput += id+"\t"+"\t".join(results) + "\n"
|
||||
output += id + "\n" + "\t".join([date,classname]+results) + "\n\n"
|
||||
checkoutput += "[END]\n\n\n"
|
||||
|
||||
SaveTextFile(output,outputfilepath)
|
||||
print("可以在 %s 文件中检查结构"%(SaveTextFile(checkoutput,checkingfilepath)))
|
||||
os.system("code %s"%checkingfilepath)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow_tkdr()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,273 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>统考数据导入</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>170</y>
|
||||
<width>381</width>
|
||||
<height>54</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>180</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>180</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>统计文件(.xlsx)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_excel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>文件选择</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_excelfile">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>260</y>
|
||||
<width>194</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>年级</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_grade">
|
||||
<property name="placeholderText">
|
||||
<string>如 2026届高一</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>290</y>
|
||||
<width>194</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>班级数</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_classnum">
|
||||
<property name="placeholderText">
|
||||
<string>如 12</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>510</x>
|
||||
<y>110</y>
|
||||
<width>141</width>
|
||||
<height>201</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="documentTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="plainText">
|
||||
<string>说明:
|
||||
.xlsx文件需要有一个名为"难度统计"的数据表.
|
||||
第一列从第二行起为班级号, 第一行从第二列起为题号.
|
||||
例如: 1,2,3,4,5,61,62,71,72,73,8,9,101,102,...
|
||||
</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>320</x>
|
||||
<y>230</y>
|
||||
<width>181</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>统考数据导入
|
||||
metadata.txt</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>110</y>
|
||||
<width>381</width>
|
||||
<height>54</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>180</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>180</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>试卷文件(.tex或.pdf)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_paper">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>文件选择</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_paperfile">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>230</y>
|
||||
<width>194</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>日期(yyyymmdd)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_date">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>如 20240101</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog, QTableWidgetItem
|
||||
from PySide6.QtGui import QColor
|
||||
from Ui_获取小闲平台使用数据 import Ui_Form
|
||||
from database_tools_2 import *
|
||||
import shutil,zipfile
|
||||
|
||||
|
||||
def getFilename(string):
|
||||
filename = re.findall(r"\d{21}_([\s\S]*?)_高[一二三]_数学",string)[0]
|
||||
return filename
|
||||
|
||||
def getDate(string):
|
||||
date = re.findall(r"\((\d{8})\).zip",string)
|
||||
if len(date) > 0:
|
||||
return date[0]
|
||||
else:
|
||||
return ""
|
||||
|
||||
class MyWindow_xxdr(QWidget,Ui_Form):
|
||||
|
||||
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
def bind(self):
|
||||
self.tempdir = "临时文件/zips"
|
||||
self.statsfilename = "小题分_按学号(数学).xlsx"
|
||||
self.answersheetseekingpath = "../备课组"
|
||||
self.lineEdit_threshold.setText("0.75")
|
||||
self.tableWidget.setColumnWidth(0,200)
|
||||
self.tableWidget.setColumnWidth(1,280)
|
||||
self.tableWidget.setColumnWidth(2,80)
|
||||
self.pushButton_file.clicked.connect(self.getFilePath)
|
||||
self.pushButton_folder.clicked.connect(self.getDirPath)
|
||||
self.pushButton_validcheck.clicked.connect(self.checkpathanddate)
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
self.tablevalid = True
|
||||
|
||||
|
||||
def getFilePath(self): #选取文件并放置在tableWidget的第一行
|
||||
self.tableWidget.setRowCount(1)
|
||||
pathlist = QFileDialog.getOpenFileName(self,"选择文件",".","zip文件(*.zip);;所有文件(*)")
|
||||
self.zipfilepath = pathlist[0]
|
||||
self.tableWidget.setItem(0,0,QTableWidgetItem(pathlist[0]))
|
||||
# self.singlefile = True
|
||||
filename = getFilename(pathlist[0])
|
||||
self.tableWidget.setItem(0,1,QTableWidgetItem(filename))
|
||||
self.tableWidget.setItem(0,2,QTableWidgetItem(getDate(pathlist[0])))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def getDirPath(self): #选取文件夹中的所有符合答题纸特征的.zip文件并放置在tableWidget中
|
||||
dirpath = QFileDialog.getExistingDirectory(self,"选择文件夹")
|
||||
self.filelist = [os.path.join(dirpath,f) for f in os.listdir(dirpath) if ".zip" in f and re.findall(r"\d{21}",f)!=[]]
|
||||
# self.singlefile = False
|
||||
count = 0
|
||||
for f in self.filelist:
|
||||
if count + 1 > self.tableWidget.rowCount():
|
||||
self.tableWidget.insertRow(self.tableWidget.rowCount())
|
||||
self.tableWidget.setItem(count,0,QTableWidgetItem(f))
|
||||
self.tableWidget.setItem(count,1,QTableWidgetItem(getFilename(f)))
|
||||
self.tableWidget.setItem(count,2,QTableWidgetItem(getDate(f)))
|
||||
count += 1
|
||||
|
||||
|
||||
def checkpathanddate(self): #检查文件名和日期是否有效, 文件名无效标黄色, 日期无效标红色
|
||||
if not float(self.lineEdit_threshold.text()) >= 0 or not float(self.lineEdit_threshold.text()) <= 1:
|
||||
self.lineEdit_threshold.setStyleSheet("background-color: red;")
|
||||
self.tablevalid = False
|
||||
self.using_rows = []
|
||||
self.tableWidget.clearSelection()
|
||||
for t in range(self.tableWidget.rowCount()):
|
||||
for i in range(3):
|
||||
self.tableWidget.item(t,i).setBackground(QColor("transparent"))
|
||||
for t in range(self.tableWidget.rowCount()):
|
||||
if re.findall(r"\d{21}",self.tableWidget.item(t,0).text()) == [] or not len(self.tableWidget.item(t,2).text().strip()) == 8:
|
||||
for i in range(3):
|
||||
self.tableWidget.item(t,i).setBackground(QColor("yellow"))
|
||||
else:
|
||||
self.using_rows.append(t)
|
||||
for row in range(self.tableWidget.rowCount()):
|
||||
date = self.tableWidget.item(row,2).text()
|
||||
if not len(date.strip()) == 8:
|
||||
self.tableWidget.item(row,2).setBackground(QColor("red"))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def exec(self): #执行操作并将使用数据汇入metadata.txt
|
||||
self.checkpathanddate()
|
||||
if len(self.using_rows) >= 2:
|
||||
SaveTextFile("","文本文件/metadata.txt")
|
||||
for row in self.using_rows:
|
||||
date = self.tableWidget.item(row,2).text()
|
||||
threshold = float(self.lineEdit_threshold.text())
|
||||
output = self.generateUsingInfo(zipfilepath=self.tableWidget.item(row,0).text(),threshold=threshold,date=date)
|
||||
if output == 1 or CheckUsagesValidity(output) != 0:
|
||||
for i in range(3):
|
||||
self.tableWidget.item(row,i).setBackground(QColor("red"))
|
||||
if output == 1:
|
||||
print(f"{self.tableWidget.item(row,1).text()} 有问题, 未能生成使用数据")
|
||||
else:
|
||||
print(f"{self.tableWidget.item(row,1).text()} 满分设置有误, 请检查")
|
||||
else:
|
||||
for i in range(3):
|
||||
self.tableWidget.item(row,i).setBackground(QColor("green"))
|
||||
print(f"{self.tableWidget.item(row,1).text()} 使用数据生成成功")
|
||||
if not self.checkBox.isChecked() and len(self.using_rows) == 1:
|
||||
SaveTextFile(output,"文本文件/metadata.txt")
|
||||
else:
|
||||
AppendTextFile(output,"文本文件/metadata.txt")
|
||||
os.system("code 文本文件/metadata.txt")
|
||||
|
||||
|
||||
|
||||
def generateUsingInfo(self,zipfilepath,threshold,date): #根据zipfilepath文件路径, threshold最低提交比例阈值, date日期产生对应一张答题纸的使用记录
|
||||
try:
|
||||
shutil.rmtree(self.tempdir)
|
||||
except:
|
||||
pass
|
||||
makedir(self.tempdir)
|
||||
try:
|
||||
xiaoxianpid = ParseZipname(zipfilepath)
|
||||
paperinfo = FindPaper(xiaoxianpid, self.answersheetseekingpath)
|
||||
gradename = paperinfo[1]
|
||||
idlist = paperinfo[2]
|
||||
excludejson = paperinfo[4]
|
||||
print(paperinfo)
|
||||
# print(paperinfo)
|
||||
zf = zipfile.ZipFile(zipfilepath)
|
||||
zf.extractall(self.tempdir) #解压zip文件中的所有内容到tempdir
|
||||
# # papertype = CheckPaperType(tempdir,statsfilename)
|
||||
statsfilepathlist = FindFile(self.tempdir,self.statsfilename)
|
||||
validcols,marks = generateColIndexandMarks(statsfilepathlist,self.statsfilename,paperinfo)
|
||||
dfcurrent = pd.read_excel(os.path.join(statsfilepathlist[0],self.statsfilename))
|
||||
correspondence_dict = generateIDtoUsageCorrespondence(idlist,validcols,dfcurrent.iloc[1,validcols])
|
||||
output = CalculateUsages(statsfilepathlist,self.statsfilename,gradename,threshold,marks,correspondence_dict,validcols,date,exclude=RefineExclude(excludejson))
|
||||
return output #返回由usages开始的使用记录文本
|
||||
except:
|
||||
return 1 #无法生成就返回1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow_xxdr()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_file">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>620</x>
|
||||
<y>70</y>
|
||||
<width>91</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择文件</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_threshold">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>620</x>
|
||||
<y>30</y>
|
||||
<width>91</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>623</x>
|
||||
<y>10</y>
|
||||
<width>61</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>设定阈值</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_folder">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>620</x>
|
||||
<y>110</y>
|
||||
<width>91</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择文件夹</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>620</x>
|
||||
<y>270</y>
|
||||
<width>91</width>
|
||||
<height>75</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>开始分析</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTableWidget" name="tableWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>600</width>
|
||||
<height>451</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="rowCount">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||
<number>130</number>
|
||||
</attribute>
|
||||
<row/>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>文件名</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>答题纸名称</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>中位扫描日期</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>620</x>
|
||||
<y>230</y>
|
||||
<width>91</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Append模式</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_validcheck">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>620</x>
|
||||
<y>160</y>
|
||||
<width>91</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>检查有效性</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_获取题号 import Ui_Form
|
||||
import os
|
||||
from database_tools_2 import *
|
||||
|
||||
class MyWindow_hqth(QWidget,Ui_Form):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
def bind(self):
|
||||
self.pushButton_exec.setDisabled(True)
|
||||
self.pushButton_selectfilepath.clicked.connect(self.selectfilepath)
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
def selectfilepath(self):
|
||||
self.filepath = QFileDialog.getOpenFileName(self,"选择.tex文件或.pdf文件",os.getcwd(),"tex或pdf文件(*.tex *.pdf);;所有文件(*)")[0]
|
||||
self.lineEdit.setText(self.filepath)
|
||||
self.pushButton_exec.setEnabled(True)
|
||||
def exec(self):
|
||||
self.plainTextEdit.setPlainText(ExportIDList(self.filepath))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>获取题号</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>文件路径</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_selectfilepath">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>670</x>
|
||||
<y>10</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择文件</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>100</y>
|
||||
<width>741</width>
|
||||
<height>361</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>40</y>
|
||||
<width>741</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>80</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>670</x>
|
||||
<y>70</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>获取题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_讲义结构与内容录入 import Ui_Form
|
||||
from database_tools_2 import *
|
||||
|
||||
|
||||
class MyWindow_jglr(QWidget,Ui_Form):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
def bind(self):
|
||||
self.label_next.setVisible(False)
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
self.lineEdit_structure.textChanged.connect(self.unvisible)
|
||||
self.comboBox_grade.currentIndexChanged.connect(self.unvisible)
|
||||
self.comboBox_semester.currentIndexChanged.connect(self.unvisible)
|
||||
|
||||
def unvisible(self):
|
||||
self.label_next.setVisible(False)
|
||||
def exec(self):
|
||||
if not len(self.lineEdit_structure.text()) == 1:
|
||||
print("首字母有误")
|
||||
else:
|
||||
self.label_next.setVisible(True)
|
||||
self.repaint()
|
||||
self.prefix = self.lineEdit_structure.text().upper()+self.comboBox_grade.currentText()+self.comboBox_semester.currentText()
|
||||
jsonfile = f"../备课组/{self.prefix[3:5]}届/校本材料.json"
|
||||
notes_dict = load_dict(jsonfile)
|
||||
|
||||
# print(len(notes_dict))
|
||||
if not self.prefix[0] in notes_dict["structures"]:
|
||||
AddNew = input("此类型不在列表中, 新增(A)/退出(Q):")
|
||||
if AddNew[0].upper() == "A":
|
||||
descr = input("类型描述:")
|
||||
cn = input("编号是否连续(T/F):")
|
||||
if cn[0].upper() == "T":
|
||||
cn = True
|
||||
else:
|
||||
cn = False
|
||||
partscount = int(input("分为多少个部分:"))
|
||||
new_struct_dict = {
|
||||
"description": descr,
|
||||
"consecutivenumbering": cn,
|
||||
"structure": {}
|
||||
}
|
||||
for i in range(partscount):
|
||||
partid = input(f"第 {i+1} 部分的代号:")
|
||||
partname = input(f"部分 {partid} 的名称:")
|
||||
spaceflag = input(f"部分 {partid}: {partname} 中是否要在题目后留空格(T/F):")
|
||||
if spaceflag[0].upper() == "T":
|
||||
spaceflag = True
|
||||
else:
|
||||
spaceflag = False
|
||||
new_struct_dict["structure"][partid] = {
|
||||
"name": partname,
|
||||
"spaceflag": spaceflag
|
||||
}
|
||||
notes_dict["structures"][self.prefix[0]] = new_struct_dict.copy()
|
||||
save_dict(notes_dict,jsonfile)
|
||||
else:
|
||||
pass
|
||||
else:
|
||||
numberlist = []
|
||||
for id in notes_dict["notes"]:
|
||||
if self.prefix in id:
|
||||
numberlist.append(id[-2:])
|
||||
print("该分类下已有材料编号: "+generate_exp(numberlist))
|
||||
pid = self.prefix + input("请输入新材料编号(两位数):")
|
||||
while pid in notes_dict["notes"]:
|
||||
print("编号重复, 请重新输入.")
|
||||
pid = self.prefix + input("请输入新材料编号(两位数):")
|
||||
name = input("请输入材料名称:")
|
||||
filenameraw = input("生成的文件名和材料名称是否一致?([Y]/如果不一致请输入文件名):")
|
||||
if filenameraw.upper() == "Y":
|
||||
filename = name
|
||||
else:
|
||||
filename = filenameraw
|
||||
new_note_dict = {
|
||||
"id": pid,
|
||||
"name": name,
|
||||
"filename": filename
|
||||
}
|
||||
structure = notes_dict['structures'][self.prefix[0]]['structure']
|
||||
print(f"此类材料共有 {len(structure)} 个部分, 分别是:")
|
||||
for p in structure:
|
||||
print(f"{p}: {structure[p]['name']}")
|
||||
new_note_dict[p] = []
|
||||
for p in structure:
|
||||
rawdata = input(f"现在输入 {p}: {structure[p]['name']} 部分的内容编号:")
|
||||
rawdata = re.sub(r"[^BXK\d:,]","",rawdata)
|
||||
if re.findall(r"\d",rawdata) == []:
|
||||
new_note_dict[p] = []
|
||||
else:
|
||||
new_note_dict[p] = generate_id_set(rawdata)
|
||||
print(f"{p}: {new_note_dict[p]}")
|
||||
notes_dict["notes"][pid] = new_note_dict.copy()
|
||||
notes_dict["notes"] = SortDict(notes_dict["notes"])
|
||||
save_dict(notes_dict,jsonfile)
|
||||
print("处理完成")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,171 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>460</x>
|
||||
<y>200</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>执行</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>220</x>
|
||||
<y>200</y>
|
||||
<width>221</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>种类</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_structure">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>届别</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_grade">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2022</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2023</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2024</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2025</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2026</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2027</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2028</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2029</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>学期</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_semester">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>00</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>01</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>02</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>03</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>04</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>05</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>06</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_next">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>400</x>
|
||||
<y>240</y>
|
||||
<width>141</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>请到终端执行下一步操作</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,340 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>题号筛选器</string>
|
||||
</property>
|
||||
<property name="windowOpacity">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton_content">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>30</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>内容</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_obj">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>60</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>目标编号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_tag">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>90</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>标签</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_usage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>120</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>使用记录</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_origin">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>150</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>出处</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_genre">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>180</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>题目类型</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_ans">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>210</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>答案</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_solution">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>240</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>解答与提示</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_same">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>270</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>相同题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_related">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>300</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>相关题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_remark">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>330</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>备注</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>490</x>
|
||||
<y>110</y>
|
||||
<width>161</width>
|
||||
<height>91</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>运行</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_undo">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>380</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>撤销上一个</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_clearAll">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>410</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>清除</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_conditions">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>220</x>
|
||||
<y>110</y>
|
||||
<width>261</width>
|
||||
<height>331</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>220</x>
|
||||
<y>90</y>
|
||||
<width>71</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>当前条件:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="checkBox_not">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>380</x>
|
||||
<y>30</y>
|
||||
<width>111</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选中表示不包含</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_SingleCondition">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>220</x>
|
||||
<y>60</y>
|
||||
<width>261</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>220</x>
|
||||
<y>30</y>
|
||||
<width>151</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>输入条件, 用","分隔表示"或"</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>490</x>
|
||||
<y>30</y>
|
||||
<width>91</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>筛选结果数目:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLCDNumber" name="lcdNumber_resCount">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>490</x>
|
||||
<y>50</y>
|
||||
<width>161</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="digitCount">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="value" stdset="0">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_savebuild">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>490</x>
|
||||
<y>240</y>
|
||||
<width>161</width>
|
||||
<height>201</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>保存和编译</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="checkBox_Detailed">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>490</x>
|
||||
<y>210</y>
|
||||
<width>79</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>详细信息</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,206 @@
|
|||
from PySide6.QtWidgets import QWidget, QApplication, QFileDialog
|
||||
from Ui_题目内容直接编辑 import Ui_Form
|
||||
from database_tools_2 import *
|
||||
|
||||
class MyWindow_bjtm(QWidget,Ui_Form):
|
||||
def __init__(self,database_name):
|
||||
super().__init__()
|
||||
self.database_name = database_name
|
||||
self.setupUi(self)
|
||||
self.bind()
|
||||
|
||||
def setdbname(self,string):
|
||||
self.database_name = string
|
||||
try:
|
||||
self.db.close()
|
||||
except:
|
||||
pass
|
||||
self.db = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
|
||||
self.cursor = self.db.cursor()
|
||||
self.changedids = []
|
||||
# print(self.database_name)
|
||||
|
||||
def bind(self):
|
||||
self.lineEdit_ID.textChanged.connect(self.getID)
|
||||
self.pushButton_content.clicked.connect(self.showcontent)
|
||||
self.pushButton_genre.clicked.connect(self.showgenre)
|
||||
self.pushButton_ans.clicked.connect(self.showans)
|
||||
self.pushButton_solution.clicked.connect(self.showsolution)
|
||||
self.pushButton_origin.clicked.connect(self.showorigin)
|
||||
self.pushButton_remarks.clicked.connect(self.showremarks)
|
||||
self.pushButton_exec.clicked.connect(self.exec)
|
||||
self.pushButton_tocommit.clicked.connect(self.tocommit)
|
||||
self.db = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name)
|
||||
self.cursor = self.db.cursor()
|
||||
self.changedids = []
|
||||
def getID(self):
|
||||
self.ID = self.lineEdit_ID.text().zfill(6)
|
||||
def showcontent(self):
|
||||
self.field = "题目内容"
|
||||
self.label_2.setText(f"题号 {self.lineEdit_ID.text()} 的 {self.field} 字段")
|
||||
sql = "SELECT content FROM problems WHERE ID = (%s);"
|
||||
val = (self.lineEdit_ID.text().zfill(6),)
|
||||
self.cursor.execute(sql,val)
|
||||
ret = self.cursor.fetchall()
|
||||
if ret[0][0] is None:
|
||||
self.originalcontent = ""
|
||||
else:
|
||||
self.originalcontent = ret[0][0].strip()
|
||||
self.plainTextEdit_toedit.setPlainText(self.originalcontent)
|
||||
def showgenre(self):
|
||||
self.field = "类型"
|
||||
self.label_2.setText(f"题号 {self.lineEdit_ID.text()} 的 {self.field} 字段")
|
||||
sql = "SELECT genre FROM problems WHERE ID = (%s);"
|
||||
val = (self.lineEdit_ID.text().zfill(6),)
|
||||
self.cursor.execute(sql,val)
|
||||
ret = self.cursor.fetchall()
|
||||
if ret[0][0] is None:
|
||||
self.originalcontent = ""
|
||||
else:
|
||||
self.originalcontent = ret[0][0].strip()
|
||||
self.plainTextEdit_toedit.setPlainText(self.originalcontent)
|
||||
def showans(self):
|
||||
self.field = "答案"
|
||||
self.label_2.setText(f"题号 {self.lineEdit_ID.text()} 的 {self.field} 字段")
|
||||
sql = "SELECT ans FROM problems WHERE ID = (%s);"
|
||||
val = (self.lineEdit_ID.text().zfill(6),)
|
||||
self.cursor.execute(sql,val)
|
||||
ret = self.cursor.fetchall()
|
||||
if ret[0][0] is None:
|
||||
self.originalcontent = ""
|
||||
else:
|
||||
self.originalcontent = ret[0][0].strip()
|
||||
self.plainTextEdit_toedit.setPlainText(self.originalcontent)
|
||||
def showsolution(self):
|
||||
self.field = "解答"
|
||||
self.label_2.setText(f"题号 {self.lineEdit_ID.text()} 的 {self.field} 字段")
|
||||
sql = "SELECT solution FROM problems WHERE ID = (%s);"
|
||||
val = (self.lineEdit_ID.text().zfill(6),)
|
||||
self.cursor.execute(sql,val)
|
||||
ret = self.cursor.fetchall()
|
||||
if ret[0][0] is None:
|
||||
self.originalcontent = ""
|
||||
else:
|
||||
self.originalcontent = ret[0][0].strip()
|
||||
self.plainTextEdit_toedit.setPlainText(self.originalcontent)
|
||||
def showorigin(self):
|
||||
self.field = "来源"
|
||||
self.label_2.setText(f"题号 {self.lineEdit_ID.text()} 的 {self.field} 字段")
|
||||
sql = "SELECT origin FROM problems WHERE ID = (%s);"
|
||||
val = (self.lineEdit_ID.text().zfill(6),)
|
||||
self.cursor.execute(sql,val)
|
||||
ret = self.cursor.fetchall()
|
||||
if ret[0][0] is None:
|
||||
self.originalcontent = ""
|
||||
else:
|
||||
self.originalcontent = ret[0][0].strip()
|
||||
self.plainTextEdit_toedit.setPlainText(self.originalcontent)
|
||||
def showremarks(self):
|
||||
self.field = "备注"
|
||||
self.label_2.setText(f"题号 {self.lineEdit_ID.text()} 的 {self.field} 字段")
|
||||
sql = "SELECT date,remark_content FROM remarks WHERE ID = (%s);"
|
||||
val = (self.lineEdit_ID.text().zfill(6),)
|
||||
self.cursor.execute(sql,val)
|
||||
ret_list = self.cursor.fetchall()
|
||||
if len(ret_list) == 0:
|
||||
self.originalcontent = ""
|
||||
else:
|
||||
self.originalcontent = "\n\n----------\n\n".join([ret[0]+"\t"+ret[1] for ret in ret_list])
|
||||
self.plainTextEdit_toedit.setPlainText(self.originalcontent)
|
||||
def exec(self):
|
||||
self.currentcontent = self.plainTextEdit_toedit.toPlainText().strip()
|
||||
if self.currentcontent == self.originalcontent:
|
||||
print("未改变, 不作处理.")
|
||||
elif self.field in ["题目内容","答案","解答","来源"]:
|
||||
corresp = {"题目内容":"content","答案":"ans","解答":"solution","来源":"origin"}
|
||||
sql = f"UPDATE problems SET {corresp[self.field]} = %s WHERE ID = %s;"
|
||||
val = (self.currentcontent,self.ID)
|
||||
self.cursor.execute(sql,val)
|
||||
sql = "INSERT INTO logs (DATE,TIME,username,action,id,db_content) VALUE (%s,%s,%s,%s,%s,%s);"
|
||||
val = (GetDate(),GetTime(),get_git_username(),f"修改{self.field}",self.ID,f"{self.originalcontent} -> {self.currentcontent}")
|
||||
self.cursor.execute(sql,val)
|
||||
if self.field == "题目内容":
|
||||
sql = f"INSERT INTO edit_history (ID,date,editor) VALUE (%s,%s,%s);"
|
||||
val = (self.ID,GetDate(),get_git_username())
|
||||
self.cursor.execute(sql,val)
|
||||
print(f"{self.ID} {self.field} 修改已完成")
|
||||
self.changedids.append(self.ID)
|
||||
elif self.field == "类型":
|
||||
sql = "UPDATE problems SET genre = %s WHERE ID = %s;"
|
||||
val = (self.currentcontent,self.ID)
|
||||
if self.currentcontent == "解答题":
|
||||
self.cursor.execute("UPDATE problems SET space = %s WHERE ID = %s;",("4em",self.ID))
|
||||
else:
|
||||
self.cursor.execute("UPDATE problems SET space = %s WHERE ID = %s;",("",self.ID))
|
||||
self.cursor.execute(sql,val)
|
||||
sql = "INSERT INTO logs (DATE,TIME,username,action,id,db_content) VALUE (%s,%s,%s,%s,%s,%s);"
|
||||
val = (GetDate(),GetTime(),get_git_username(),f"修改类型",self.ID,f"{self.originalcontent} -> {self.currentcontent}")
|
||||
self.cursor.execute(sql,val)
|
||||
print(f"{self.ID} {self.field} 修改已完成")
|
||||
self.changedids.append(self.ID)
|
||||
elif self.field == "备注":
|
||||
self.original_list = [item.strip() for item in self.originalcontent.split("-"*10)]
|
||||
self.current_list = [item.strip() for item in self.currentcontent.split("-"*10)]
|
||||
if len(self.original_list) != len(self.current_list):
|
||||
print("有问题, 需保持备注的数量一致")
|
||||
else:
|
||||
for i in range(len(self.original_list)):
|
||||
if self.original_list[i] != self.current_list[i]:
|
||||
rm_date_origin,rm_content_origin = parseRemark(self.original_list[i])
|
||||
rm_date_current,rm_content_current = parseRemark(self.current_list[i])
|
||||
sql = "UPDATE remarks SET date = %s, remark_content = %s WHERE ID = %s AND date = %s AND remark_content = %s;"
|
||||
val = (rm_date_current,rm_content_current,self.ID,rm_date_origin,rm_content_origin)
|
||||
self.cursor.execute(sql,val)
|
||||
sql = "INSERT INTO logs (DATE,TIME,username,action,id,db_content) VALUE (%s,%s,%s,%s,%s,%s);"
|
||||
val = (GetDate(),GetTime(),get_git_username(),f"修改备注",self.ID,f"{self.original_list[i]} -> {self.current_list[i]}")
|
||||
self.cursor.execute(sql,val)
|
||||
print(f"{self.ID} {self.field} 修改已完成")
|
||||
self.changedids.append(self.ID)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def tocommit(self):
|
||||
if len(self.changedids) > 0:
|
||||
configjson = BuildFullScheme
|
||||
latexbody = "\\begin{enumerate}\n\n"
|
||||
for id in sorted(list(set(self.changedids))):
|
||||
latexbody += generateLaTeXBodyContentfromMariaDB(self.cursor,id,configjson) + "\n\n"
|
||||
latexbody += "\\end{enumerate}"
|
||||
latex_raw = ReadTextFile("模板文件/讲义模板.txt")
|
||||
if configjson["教师版"] == True:
|
||||
latex_raw = latex_raw.replace(r"学号\blank{50} \ 姓名\blank{80}","上海市控江中学")
|
||||
|
||||
if sys.platform != "win32": #非win系统用默认字体
|
||||
latex_raw = re.sub(r"fontset[\s]*=[\s]*none","fontset = fandol",latex_raw)
|
||||
latex_raw = re.sub(r"\\setCJKmainfont",r"% \\setCJKmainfont",latex_raw)
|
||||
latex_data = StringSubstitute(r"<<[\s\S]*?待替换[\s\S]*?>>",latex_raw,("试编译",latexbody)) #替换标题和bodystring
|
||||
outputdir = os.path.join(os.getcwd(),"临时文件")
|
||||
outputfilepath = os.path.join(outputdir,"试编译.tex")
|
||||
SaveTextFile(latex_data,outputfilepath)
|
||||
if XeLaTeXCompile(outputdir,"试编译.tex",times=1):
|
||||
print("修改后检验成功, 已导入数据库.")
|
||||
self.db.commit()
|
||||
else:
|
||||
print("修改后检验失败, 已回滚.")
|
||||
self.db.rollback()
|
||||
self.changedids = []
|
||||
else:
|
||||
print("未作修改.")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication([])
|
||||
windows = MyWindow_bjtm()
|
||||
windows.show()
|
||||
app.exec()
|
||||
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>490</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>题库内容直接编辑</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>110</y>
|
||||
<width>54</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>题号</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEdit_ID">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>130</y>
|
||||
<width>71</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_content">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>160</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>题目内容</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_genre">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>190</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>类型</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_ans">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>220</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>答案</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_solution">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>250</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>解答</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_origin">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>280</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>来源</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_remarks">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>310</y>
|
||||
<width>75</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>备注列表</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>140</x>
|
||||
<y>110</y>
|
||||
<width>191</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>题号为 的 字段</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPlainTextEdit" name="plainTextEdit_toedit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>140</x>
|
||||
<y>130</y>
|
||||
<width>471</width>
|
||||
<height>201</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_exec">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>620</x>
|
||||
<y>130</y>
|
||||
<width>61</width>
|
||||
<height>91</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>修改</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_tocommit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>620</x>
|
||||
<y>230</y>
|
||||
<width>61</width>
|
||||
<height>101</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>提交</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue