excel2moodle documentation — excel2moodle 0.3.0 documentation

# excel2moodle documentation

This Python program helps to create Moodle questions in less time.

The aim is to put alle the information for the questions into a spreadsheet file, and then parse it, to generate Moodle compliant XML-Files. Furthermore this program lets you create a single `.xml`-File with a selection of questions, that then can be imported to a Moodle-Test.

## Concept

The concept is, to store the different questions into categories of similar types and difficulties of questions, for each of which, a separated sheet in the Spreadsheet document should be created.

There Should be a sheet called "Kategorien", where an overview over the different categories is stored. This sheet stores The names and descriptions, for all categories. The name have to be the same as the actual sheet names with the questions. Furthermore the points used for grading, are set in the "Kategorien" sheet

## Functionality

- Parse multiple Choice Questions, each into one XML file

- Parse Numeric Questions, each into one XML file

- create single XML File from a selection of questions

class excel2moodle.LogHandler(*args, **kwargs)

  Bases: `Handler`

  emit(record)

    Do whatever it takes to actually log the specified logging record.

    This version is intended to be implemented by subclasses and so raises a NotImplementedError.

    Return type:

      `None`

class excel2moodle.QSignaler

  Bases: `QObject`

  signal
  staticMetaObject = PySide6.QtCore.QMetaObject("QSignaler" inherits "QObject": Methods: #4 type=Signal, signature=signal(QString), parameters=QString )

# excel2moodle User Guide

> A User guide is accesed through the User Guide User Guide link in the Table of contents. The most of this documentation is relevant for developement purpose

## Code documentation

- User Guide
  - Writing questions into the spreadsheet
    - Question-type agnostic fields
    - Creating valid questions of Type `NFM`
  - Generating questions from the spreadsheet
  - Creating an exam question selection
  - Using the extra modules from the `Tools` section
    - Available extra functionality
- excel2moodle.extra package
  - Submodules
  - excel2moodle.extra.equationVerification module
    - Usage
      - From the main UI
      - As Script
    - `checkResult()`
    - `equationChecker()`
    - `main()`
- excel2moodle.core package
  - Submodules
  - excel2moodle.core.category module
    - `Category`
      - `Category.getCategoryHeader()`
      - `Category.id`
      - `Category.name`
      - `Category.parsAll()`
      - `Category.parseQ()`
  - excel2moodle.core.dataStructure module
    - `QuestionDB`
      - `QuestionDB.appendQElements()`
      - `QuestionDB.appendQuestions()`
      - `QuestionDB.dataChanged`
      - `QuestionDB.onSheetPathChanged()`
      - `QuestionDB.parseAll()`
      - `QuestionDB.retrieveCategoriesData()`
  - excel2moodle.core.etHelpers module
    - `getCdatTxtElement()`
    - `getElement()`
    - `getFeedBEle()`
    - `getTextElement()`
  - excel2moodle.core.exceptions module
    - `InvalidFieldException`
    - `NanException`
    - `QNotParsedException`
  - excel2moodle.core.globals module
    - `DFIndex`
      - `DFIndex.ANSTYPE`
      - `DFIndex.BPOINTS`
      - `DFIndex.FALSE`
      - `DFIndex.NAME`
      - `DFIndex.NUMBER`
      - `DFIndex.PICTURE`
      - `DFIndex.RESULT`
      - `DFIndex.TEXT`
      - `DFIndex.TRUE`
      - `DFIndex.TYPE`
    - `TextElements`
      - `TextElements.LISTITEM`
      - `TextElements.PLEFT`
      - `TextElements.SPANGREEN`
      - `TextElements.SPANORANGE`
      - `TextElements.SPANRED`
      - `TextElements.ULIST`
      - `TextElements.create()`
      - `TextElements.style`
    - `XMLTags`
      - `XMLTags.ANSFEEDBACK`
      - `XMLTags.ANSWER`
      - `XMLTags.CORFEEDB`
      - `XMLTags.GENFEEDB`
      - `XMLTags.HIDE`
      - `XMLTags.ID`
      - `XMLTags.INCORFEEDB`
      - `XMLTags.NAME`
      - `XMLTags.PCORFEEDB`
      - `XMLTags.PENALTY`
      - `XMLTags.PICTURE`
      - `XMLTags.POINTS`
      - `XMLTags.QTEXT`
      - `XMLTags.QUESTION`
      - `XMLTags.TEXT`
      - `XMLTags.TOLERANCE`
      - `XMLTags.TYPE`
      - `XMLTags.dfkey`
      - `XMLTags.set()`
  - excel2moodle.core.numericMultiQ module
    - `getVariablesDict()`
    - `getVarsList()`
    - `insertVariablesToBPoints()`
    - `parseNumericMultiQuestion()`
    - `setParameters()`
  - excel2moodle.core.parser module
    - `MCQuestionParser`
      - `MCQuestionParser.getAnsElementsList()`
      - `MCQuestionParser.setAnswers()`
    - `NFMQuestionParser`
      - `NFMQuestionParser.getVariablesDict()`
      - `NFMQuestionParser.getVarsList()`
      - `NFMQuestionParser.insertVariablesToBPoints()`
      - `NFMQuestionParser.setAnswers()`
      - `NFMQuestionParser.setVariants()`
    - `NFQuestionParser`
      - `NFQuestionParser.setAnswers()`
    - `QuestionParser`
      - `QuestionParser.appendFromSettings()`
      - `QuestionParser.appendToQuestion()`
      - `QuestionParser.formatBulletList()`
      - `QuestionParser.getFeedBEle()`
      - `QuestionParser.getNumericAnsElement()`
      - `QuestionParser.hasPicture()`
      - `QuestionParser.parse()`
      - `QuestionParser.setAnswers()`
      - `QuestionParser.setBPoints()`
      - `QuestionParser.setMainText()`
  - excel2moodle.core.question module
    - `Picture`
    - `Question`
      - `Question.assemble()`
      - `Question.setID()`
  - excel2moodle.core.questionValidator module
    - `Validator`
      - `Validator.setup()`
      - `Validator.validate()`
  - excel2moodle.core.questionWriter module
    - `write_question_MC()`
    - `write_question_NF()`
  - excel2moodle.core.stringHelpers module
    - `getBase64Img()`
    - `getUnitsElementAsString()`
    - `get_bullet_string()`
    - `printDom()`
    - `stripWhitespace()`
    - `texWrapper()`
- excel2moodle.ui package
  - Submodules
  - excel2moodle.ui.appUi module
    - `EqCheckerWindow`
      - `EqCheckerWindow.onButRunCheck()`
      - `EqCheckerWindow.staticMetaObject`
    - `MainWindow`
      - `MainWindow.closeEvent()`
      - `MainWindow.connectEvents()`
      - `MainWindow.onButGenTest()`
      - `MainWindow.onButOpenEqChecker()`
      - `MainWindow.onButSpreadsheet()`
      - `MainWindow.onOpenDocumentation()`
      - `MainWindow.onParseAll()`
      - `MainWindow.onSelectionChanged()`
      - `MainWindow.onSheetPathChanged()`
      - `MainWindow.previewQ()`
      - `MainWindow.refreshList()`
      - `MainWindow.setIncludeCategoriesSetting()`
      - `MainWindow.setStatus()`
      - `MainWindow.staticMetaObject`
      - `MainWindow.toggleQuestionSelectionState()`
      - `MainWindow.updateLog()`
  - excel2moodle.ui.dialogs module
    - `QuestinoPreviewDialog`
      - `QuestinoPreviewDialog.setAnswers()`
      - `QuestinoPreviewDialog.setPicture()`
      - `QuestinoPreviewDialog.setText()`
      - `QuestinoPreviewDialog.setupQuestion()`
      - `QuestinoPreviewDialog.staticMetaObject`
    - `QuestionVariantDialog`
      - `QuestionVariantDialog.categoryWide`
      - `QuestionVariantDialog.staticMetaObject`
      - `QuestionVariantDialog.variant`
  - excel2moodle.ui.questionPreviewDialog module
    - `Ui_QuestionPrevDialog`
      - `Ui_QuestionPrevDialog.retranslateUi()`
      - `Ui_QuestionPrevDialog.setupUi()`
  - excel2moodle.ui.settings module
    - `Settings`
      - `Settings.get()`
      - `Settings.set()`
      - `Settings.setSpreadsheet()`
      - `Settings.shPathChanged`
      - `Settings.staticMetaObject`
  - excel2moodle.ui.treewidget module
    - `CategoryItem`
      - `CategoryItem.getCategory()`
      - `CategoryItem.getMaxVariants()`
      - `CategoryItem.iterateChildren()`
    - `QuestionItem`
      - `QuestionItem.getQuestion()`
  - excel2moodle.ui.variantDialog module
    - `Ui_Dialog`
      - `Ui_Dialog.retranslateUi()`
      - `Ui_Dialog.setupUi()`
  - excel2moodle.ui.windowEquationChecker module
    - `Ui_EquationChecker`
      - `Ui_EquationChecker.retranslateUi()`
      - `Ui_EquationChecker.setupUi()`
  - excel2moodle.ui.windowMain module
    - `Ui_MoodleTestGenerator`
      - `Ui_MoodleTestGenerator.retranslateUi()`
      - `Ui_MoodleTestGenerator.setupUi()`

# Indices and Tables

- Index

- Module Index

- Search Page