excel2moodle.ui package — excel2moodle 0.5.0 documentation

# 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.MainWindow(settings, testDB)

  Bases: `QMainWindow`

  Parameters:

    - settings (Settings)

    - testDB (QuestionDB)

  actionSpreadsheet()
    Return type:

      `None`

  closeEvent(event)
    Return type:

      `None`

  connectEvents()
    Return type:

      `None`

  onButGenTest()

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

    Return type:

      `None`

  onSelectionChanged(**args)

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

    Return type:

      `None`

  openAboutDlg()
    Return type:

      `None`

  openDocumentation()
    Return type:

      `None`

  openEqCheckerDlg()
    Return type:

      `None`

  parseSpreadsheetAll()

    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()
    Return type:

      `None`

  setQVariantDefault(value)
    Return type:

      `None`

    Parameters:

      value (int)

  setSheetPath(sheet)
    Return type:

      `None`

    Parameters:

      sheet (Path)

  setStatus(status)
    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=onSelectionChanged() #42 type=Slot, signature=toggleQuestionSelectionState() #43 type=Slot, signature=onButGenTest() #44 type=Slot, signature=actionSpreadsheet() #45 type=Slot, signature=treeRefreshCategory(PyObject), parameters=PyObject #46 type=Slot, signature=updateQuestionPreview() #47 type=Slot, signature=openEqCheckerDlg() #48 type=Slot, signature=openAboutDlg() #49 type=Slot, signature=openDocumentation() )
  toggleQuestionSelectionState(state)
    Return type:

      `None`

  treeRefreshCategory(cat)

    Append Category with its Questions to the treewidget.

    Return type:

      `None`

    Parameters:

      cat (Category)

  updateLog(log)
    Return type:

      `None`

  updateQuestionPreview()
    Return type:

      `None`

class excel2moodle.ui.appUi.ParseAllThread(questionDB, mainApp)

  Bases: `QRunnable`

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

  Parameters:

    - questionDB (QuestionDB)

    - mainApp (MainWindow)

  run()
    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)

  Bases: `QMessageBox`

  Parameters:

    parent (QWidget)

  staticMetaObject = PySide6.QtCore.QMetaObject("AboutDialog" inherits "QMessageBox": )

class excel2moodle.ui.dialogs.ExportDialog(parent)

  Bases: `QDialog`

  property exportFile: Path
  getExportFile()
    Return type:

      `None`

  staticMetaObject = PySide6.QtCore.QMetaObject("ExportDialog" inherits "QDialog": )

class excel2moodle.ui.dialogs.QuestionPreview(parent)

  Bases: `object`

  setAnswers()
    Return type:

      `None`

  setPicture()
    Return type:

      `None`

  setText()
    Return type:

      `None`

  setupQuestion(question)
    Return type:

      `None`

    Parameters:

      question (Question)

class excel2moodle.ui.dialogs.QuestionVariantDialog(parent, question)

  Bases: `QDialog`

  Parameters:

    question (Question)

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

## excel2moodle.ui.treewidget module

class excel2moodle.ui.treewidget.CategoryItem(parent, category)

  Bases: `QTreeWidgetItem`

  Parameters:

    category (Category)

  getCategory()
    Return type:

      `Category`

  getMaxVariants()
    Return type:

      `int`

  iterateChildren()

class excel2moodle.ui.treewidget.QuestionItem(parent, question)

  Bases: `QTreeWidgetItem`

  Parameters:

    question (Question | ParametricQuestion)

  getQuestion()

    Return the question Object the QTreeWidgetItem represents.

    Return type:

      `Question` | `ParametricQuestion`

## excel2moodle.ui.equationChecker module

class excel2moodle.ui.equationChecker.EqCheckerWindow

  Bases: `QWidget`

  setup(question)
    Return type:

      `None`

    Parameters:

      question (ParametricQuestion)

  staticMetaObject = PySide6.QtCore.QMetaObject("EqCheckerWindow" inherits "QWidget": )
  updateCalculation()
    Return type:

      `None`