Example usage
To use pymoodef in a project
Imports
from pymoodef.questions import Questions
from pymoodef.datasets import get_questions_ini, get_questions_csv
Create an object of the class
The object has a default configuration, with which we can operate.
q = Questions()
Read the ini file
Define the configuration of the questions (category, copyright, license, possibility of transforming the images they include).
ini = get_questions_ini()
q.define_ini(ini)
Read a question file
We read a file in csv format, by default, the columns are separated by ‘,’.
csv = get_questions_csv()
q.define_from_csv(csv)
Generate the xml file
We generate the xml file that is saved where we indicate in the function parameter.
xml = q.generate_xml('questions.xml')