excel2moodle.ui package

Here is the relevant stuff for the UI

Submodules

excel2moodle.ui.appUi module

AppUi holds the extended class mainWindow() and any other main Windows.

It needs to be seperated from windowMain.py because that file will be changed by the pyside6-uic command, which generates the python code from the .ui file

class excel2moodle.ui.appUi.EqCheckerWindow[source]

Bases: QWidget

onButRunCheck(catN, qN)[source]

Is Triggered by the Run Check now Button and runs the Equation Check.

Return type:

None

Parameters:
  • catN (int)

  • qN (int)

staticMetaObject = PySide6.QtCore.QMetaObject("EqCheckerWindow" inherits "QWidget": )
class excel2moodle.ui.appUi.MainWindow(settings, testDB)[source]

Bases: QMainWindow

Parameters:
closeEvent(event)[source]
Return type:

None

connectEvents()[source]
Return type:

None

onButGenTest()[source]

Open a file Dialog so the export file may be choosen.

Return type:

None

onButSpreadsheet()[source]
Return type:

None

onSelectionChanged(**args)[source]

Whenever the selection changes the total of selected points needs to be recalculated.

Return type:

None

onSheetPathChanged(sheet)[source]
Return type:

None

Parameters:

sheet (Path)

openAboutDlg()[source]
Return type:

None

openEqCheckerDlg()[source]
Return type:

None

openPreviewQuestionDlg()[source]
Return type:

None

parseSpreadsheetAll()[source]

Event triggered by the Tools/Parse all Questions Event.

It parses all the Questions found in the spreadsheet and then refreshes the list of questions. If successful it prints out a list of all exported Questions

Return type:

None

setIncludeCategoriesSetting()[source]
Return type:

None

setQVariantDefault(value)[source]
Return type:

None

Parameters:

value (int)

setStatus(status)[source]
Return type:

None

staticMetaObject = PySide6.QtCore.QMetaObject("MainWindow" inherits "QMainWindow": Methods:   #39 type=Slot, signature=setQVariantDefault()   #40 type=Slot, signature=parseSpreadsheetAll()   #41 type=Slot, signature=onSheetPathChanged(PyObject), parameters=PyObject   #42 type=Slot, signature=onSelectionChanged()   #43 type=Slot, signature=toggleQuestionSelectionState()   #44 type=Slot, signature=onButGenTest()   #45 type=Slot, signature=onButSpreadsheet()   #46 type=Slot, signature=treeRefreshCategory(PyObject), parameters=PyObject   #47 type=Slot, signature=openPreviewQuestionDlg()   #48 type=Slot, signature=openEqCheckerDlg()   #49 type=Slot, signature=openAboutDlg() )
toggleQuestionSelectionState(state)[source]
Return type:

None

treeRefreshCategory(cat)[source]

Append Category with its Questions to the treewidget.

Return type:

None

Parameters:

cat (Category)

updateLog(log)[source]
Return type:

None

class excel2moodle.ui.appUi.ParseAllThread(questionDB, mainApp)[source]

Bases: QRunnable

Parse the whole Spreadsheet. Start by reading the spreadsheet asynchron. When finished parse all Categories subsequently.

Parameters:
run()[source]
Return type:

None

excel2moodle.ui.dialogs module

This Module hosts the various Dialog Classes, that can be shown from main Window.

class excel2moodle.ui.dialogs.AboutDialog(parent)[source]

Bases: QMessageBox

Parameters:

parent (QWidget)

staticMetaObject = PySide6.QtCore.QMetaObject("AboutDialog" inherits "QMessageBox": )
class excel2moodle.ui.dialogs.QuestinoPreviewDialog(parent, question)[source]

Bases: QDialog

Parameters:
setAnswers()[source]
Return type:

None

setPicture()[source]
Return type:

None

setText()[source]
Return type:

None

setupQuestion()[source]
Return type:

None

staticMetaObject = PySide6.QtCore.QMetaObject("QuestinoPreviewDialog" inherits "QDialog": )
class excel2moodle.ui.dialogs.QuestionVariantDialog(parent, question)[source]

Bases: QDialog

Parameters:

question (Question)

property categoryWide
staticMetaObject = PySide6.QtCore.QMetaObject("QuestionVariantDialog" inherits "QDialog": )
property variant

excel2moodle.ui.questionPreviewDialog module

class excel2moodle.ui.questionPreviewDialog.Ui_QuestionPrevDialog[source]

Bases: object

retranslateUi(QuestionPrevDialog)[source]
setupUi(QuestionPrevDialog)[source]

excel2moodle.ui.settings module

Settings module provides the adjusted subclass of PySide6.QtCore.QSettings.

class excel2moodle.ui.settings.Settings[source]

Bases: QSettings

Settings for Excel2moodle.

get(key)[source]

Get the typesafe settings value.

Parameters:

key (SettingsKey)

localSettings: ClassVar[dict[str, str | float | Path]] = {}
set(key, value, local=False)[source]

Set the setting to value.

Parameters:
  • local (bool) – True saves local project specific settings. Defaults to False The local settings are meant to be set in the first sheet settings

  • key (SettingsKey | str)

  • value (float | bool | Path | str)

Return type:

None

setSpreadsheet(sheet)[source]

Save spreadsheet path and emit the changed event.

Return type:

None

Parameters:

sheet (Path)

shPathChanged
staticMetaObject = PySide6.QtCore.QMetaObject("Settings" inherits "QSettings": Methods:   #4 type=Signal, signature=shPathChanged(PyObject), parameters=PyObject )
class excel2moodle.ui.settings.SettingsKey(_, place, typ, default)[source]

Bases: StrEnum

Settings Keys are needed to always acess the correct Value.

As the QSettings settings are accesed via strings, which could easily gotten wrong. Further, this Enum defines, which type a setting has to be.

CATEGORIESSHEET = 'categoriesDataSheet'
INCLUDEINCATS = 'includeCats'
LOGFILE = 'logfile'
LOGLEVEL = 'loglevel'
PARSERNF_TOLERANCE = 'tolerance'
PICTUREFOLDER = 'pictureFolder'
PICTURESUBFOLDER = 'imgSubFolder'
POINTS = 'points'
QUESTIONVARIANT = 'defaultQuestionVariant'
SPREADSHEETFOLDER = 'spreadsheetFolder'
VERSION = 'version'
property default: str | int | float | Path | bool | None

Get default value for the key.

property full: str
property place: str
typ()[source]

Get default value for the key.

Return type:

type

excel2moodle.ui.treewidget module

class excel2moodle.ui.treewidget.CategoryItem(parent, category)[source]

Bases: QTreeWidgetItem

Parameters:

category (Category)

getCategory()[source]
Return type:

Category

getMaxVariants()[source]
Return type:

int

iterateChildren()[source]
class excel2moodle.ui.treewidget.QuestionItem(parent, question)[source]

Bases: QTreeWidgetItem

Parameters:

question (Question)

getQuestion()[source]

Return the question Object the QTreeWidgetItem represents.

Return type:

Question

excel2moodle.ui.variantDialog module

class excel2moodle.ui.variantDialog.Ui_Dialog[source]

Bases: object

retranslateUi(Dialog)[source]
setupUi(Dialog)[source]

excel2moodle.ui.windowEquationChecker module

class excel2moodle.ui.windowEquationChecker.Ui_EquationChecker[source]

Bases: object

retranslateUi(EquationChecker)[source]
setupUi(EquationChecker)[source]

excel2moodle.ui.windowMain module

class excel2moodle.ui.windowMain.Ui_MoodleTestGenerator[source]

Bases: object

retranslateUi(MoodleTestGenerator)[source]
setupUi(MoodleTestGenerator)[source]