summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-06-20 04:57:37 +0000
committerCoprDistGit <infra@openeuler.org>2023-06-20 04:57:37 +0000
commit63f8dd3dfdbc3a83d1fea2aa3e031ba0614d545b (patch)
tree7e071833ce9a9e19e09777404f94c7f13a719e59
parent0910d730e805c5020afc7906e8f158d083dc04fc (diff)
automatic import of python-moodlexportopeneuler20.03
-rw-r--r--.gitignore1
-rw-r--r--python-moodlexport.spec303
-rw-r--r--sources1
3 files changed, 305 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..c7fc1d6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/moodlexport-0.0.32.tar.gz
diff --git a/python-moodlexport.spec b/python-moodlexport.spec
new file mode 100644
index 0000000..b37b801
--- /dev/null
+++ b/python-moodlexport.spec
@@ -0,0 +1,303 @@
+%global _empty_manifest_terminate_build 0
+Name: python-moodlexport
+Version: 0.0.32
+Release: 1
+Summary: A package to export test questions into Moodle from python or latex
+License: MIT
+URL: https://github.com/Guillaume-Garrigos/moodlexport
+Source0: https://mirrors.aliyun.com/pypi/web/packages/c8/21/14e88ffacb0a96b7563da67e61a574e3f9a96bea05a1ac642d327ee56d52/moodlexport-0.0.32.tar.gz
+BuildArch: noarch
+
+
+%description
+# moodlexport
+
+This Python module provides code which allows to easily generate families of questions (called *categories* in Moodle) that can be directly created from either Python or Latex document, and then directly exported into Moodle (through the Moodle XML import functionality), where they can be used to create a test.
+
+| Overview of the possible conversions done within moodlexport |
+| --- |
+| <img src="doc/images/schema/schema.png" width="400"> |
+
+### Installing
+
+It can be installed with a pip command : `pip install moodlexport`
+
+### A quick overview of what this Module can do
+
+This module focuses on two type of questions provided by Moodle : the `multichoice` question (the student chooses one or more answers among others), and the `essay` question (the student is provided a space to type its answer, or upload a document).
+
+| An essay question | A multichoice question |
+| --- | --- |
+| <img src="examples/simplest_essay_question_from_python/moodle.png" width="300"> | <img src="examples/simplest_multichoice_question_from_python/moodle.png" width="300"> |
+
+Say that you want to define a multiple choice question in Moodle. This requires a lot of parameters to tune, but for now let's focus on the essential : what you basically needs is
+
+1. The body/text of your question
+2. A list of potential answers
+3. Setting which answer is the good one (see the documentation for more advanced settings like having more than one good answer)
+4. Exporting that to Moodle
+
+Here is a short overview on how to do that from Pyhton with `moodlexport`.
+
+| Writing a multichoice question from Python |
+| --- |
+| <img src="examples/simplest_multichoice_question_from_python/python.png" width="400"> |
+| <img src="examples/simplest_multichoice_question_from_python/moodle.png" width="400"> |
+| <img src="examples/simplest_multichoice_question_from_python/pdf.png" width="400"> |
+| From top to bottom: 1) the python code defining our question and producing a .xml file; 2) that question in Moodle after importing the .xml file; 3) a .pdf produced by the Python code, for convenience. You can find the corresponding code [here](examples/simplest_multichoice_question_from_python/template.ipynb) |
+
+You could equivalently obtain the very same result by typing the question in a Latex file, and using moodlexport to convert it:
+
+| Writing a multichoice question from Latex |
+| --- |
+| <img src="examples/simplest_multichoice_question_from_latex/latex.png" width="200"> |
+| <img src="examples/simplest_multichoice_question_from_latex/python.png" width="200"> |
+| <img src="examples/simplest_multichoice_question_from_python/moodle.png" width="400"> |
+| A latex file defining a question, and then converted to an .xml by Python. You can find the corresponding code [here](examples/simplest_multichoice_question_from_latex/template.ipynb) |
+
+To write an essay question, the syntax is as simple:
+
+| Writing an essay question from Python |
+| --- |
+| <img src="examples/simplest_essay_question_from_python/python.png" width="400"> |
+| <img src="examples/simplest_essay_question_from_python/moodle.png" width="400"> |
+| <img src="examples/simplest_essay_question_from_python/pdf.png" width="400"> |
+| From top to bottom: 1) the python code defining our question and producing a .xml file; 2) that question in Moodle after importing the .xml file; 3) a .pdf produced by the Python code, for convenience. You can find the corresponding code [here](examples/simplest_essay_question_from_python/template.ipynb) |
+
+The interest of writing your questions in Python is that you can easily generate random problems. Suppose for instance that we want a random question where we ask the student if a polynomial equation $aX^2 + bX +c = 0$, with integer coefficients, has a solution or no.
+One way to go is to generate a bunch of those questions, and then let Moodle pick one question at random among those during a `test`. Here is one way to do:
+
+| Generating random questions |
+| --- |
+| <img src="examples/simple_random_question/python.png" width="400"> |
+| <img src="examples/simple_random_question/moodle_cat.png" width="400"> |
+| <img src="examples/simple_random_question/moodle.png" width="400"> |
+| <img src="examples/simple_random_question/pdf.png" width="400"> |
+| From top to bottom: 1) the python code defining a category containing many variants of a same question, and producing a .xml file; 2) some of these questions appearing in a category in Moodle 3) one such question in Moodle; 4) a sample of the .pdf produced by the Python code. You can find the corresponding code [here](examples/simple_random_question/template.ipynb) |
+
+
+### Motivation
+
+The main motivation behind this module is that :
+- it is more comfortable to type maths in your day-to-day Latex interface than within Moodle
+- it is easier to define mathematical objects (vectors, matrix) in Python than in Moodle
+- generating **random problems** is quite intricate in Moodle, because we quickly face issues such as solutions being too complicated for the students (e.g. non integer), or Moodle being unable to handle certain student's answers (how would could Moodle interpret that $x+x$ is the same than $2x$?). This is much simpler to handle in Python.
+- it is easier to manipulate locally a Latex or Python file than doing it on the Moodle interface. It also simplifies collaborating projects.
+- it is more convenient to store/read questions/answers in pdf files, than using the Moodle 'bank of questions' interface.
+
+## More advanced documentation
+
+To read more about what this module can do, on how the parameters of your question can be set, see the complete documentation [here](doc/documentation.md).
+
+%package -n python3-moodlexport
+Summary: A package to export test questions into Moodle from python or latex
+Provides: python-moodlexport
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-moodlexport
+# moodlexport
+
+This Python module provides code which allows to easily generate families of questions (called *categories* in Moodle) that can be directly created from either Python or Latex document, and then directly exported into Moodle (through the Moodle XML import functionality), where they can be used to create a test.
+
+| Overview of the possible conversions done within moodlexport |
+| --- |
+| <img src="doc/images/schema/schema.png" width="400"> |
+
+### Installing
+
+It can be installed with a pip command : `pip install moodlexport`
+
+### A quick overview of what this Module can do
+
+This module focuses on two type of questions provided by Moodle : the `multichoice` question (the student chooses one or more answers among others), and the `essay` question (the student is provided a space to type its answer, or upload a document).
+
+| An essay question | A multichoice question |
+| --- | --- |
+| <img src="examples/simplest_essay_question_from_python/moodle.png" width="300"> | <img src="examples/simplest_multichoice_question_from_python/moodle.png" width="300"> |
+
+Say that you want to define a multiple choice question in Moodle. This requires a lot of parameters to tune, but for now let's focus on the essential : what you basically needs is
+
+1. The body/text of your question
+2. A list of potential answers
+3. Setting which answer is the good one (see the documentation for more advanced settings like having more than one good answer)
+4. Exporting that to Moodle
+
+Here is a short overview on how to do that from Pyhton with `moodlexport`.
+
+| Writing a multichoice question from Python |
+| --- |
+| <img src="examples/simplest_multichoice_question_from_python/python.png" width="400"> |
+| <img src="examples/simplest_multichoice_question_from_python/moodle.png" width="400"> |
+| <img src="examples/simplest_multichoice_question_from_python/pdf.png" width="400"> |
+| From top to bottom: 1) the python code defining our question and producing a .xml file; 2) that question in Moodle after importing the .xml file; 3) a .pdf produced by the Python code, for convenience. You can find the corresponding code [here](examples/simplest_multichoice_question_from_python/template.ipynb) |
+
+You could equivalently obtain the very same result by typing the question in a Latex file, and using moodlexport to convert it:
+
+| Writing a multichoice question from Latex |
+| --- |
+| <img src="examples/simplest_multichoice_question_from_latex/latex.png" width="200"> |
+| <img src="examples/simplest_multichoice_question_from_latex/python.png" width="200"> |
+| <img src="examples/simplest_multichoice_question_from_python/moodle.png" width="400"> |
+| A latex file defining a question, and then converted to an .xml by Python. You can find the corresponding code [here](examples/simplest_multichoice_question_from_latex/template.ipynb) |
+
+To write an essay question, the syntax is as simple:
+
+| Writing an essay question from Python |
+| --- |
+| <img src="examples/simplest_essay_question_from_python/python.png" width="400"> |
+| <img src="examples/simplest_essay_question_from_python/moodle.png" width="400"> |
+| <img src="examples/simplest_essay_question_from_python/pdf.png" width="400"> |
+| From top to bottom: 1) the python code defining our question and producing a .xml file; 2) that question in Moodle after importing the .xml file; 3) a .pdf produced by the Python code, for convenience. You can find the corresponding code [here](examples/simplest_essay_question_from_python/template.ipynb) |
+
+The interest of writing your questions in Python is that you can easily generate random problems. Suppose for instance that we want a random question where we ask the student if a polynomial equation $aX^2 + bX +c = 0$, with integer coefficients, has a solution or no.
+One way to go is to generate a bunch of those questions, and then let Moodle pick one question at random among those during a `test`. Here is one way to do:
+
+| Generating random questions |
+| --- |
+| <img src="examples/simple_random_question/python.png" width="400"> |
+| <img src="examples/simple_random_question/moodle_cat.png" width="400"> |
+| <img src="examples/simple_random_question/moodle.png" width="400"> |
+| <img src="examples/simple_random_question/pdf.png" width="400"> |
+| From top to bottom: 1) the python code defining a category containing many variants of a same question, and producing a .xml file; 2) some of these questions appearing in a category in Moodle 3) one such question in Moodle; 4) a sample of the .pdf produced by the Python code. You can find the corresponding code [here](examples/simple_random_question/template.ipynb) |
+
+
+### Motivation
+
+The main motivation behind this module is that :
+- it is more comfortable to type maths in your day-to-day Latex interface than within Moodle
+- it is easier to define mathematical objects (vectors, matrix) in Python than in Moodle
+- generating **random problems** is quite intricate in Moodle, because we quickly face issues such as solutions being too complicated for the students (e.g. non integer), or Moodle being unable to handle certain student's answers (how would could Moodle interpret that $x+x$ is the same than $2x$?). This is much simpler to handle in Python.
+- it is easier to manipulate locally a Latex or Python file than doing it on the Moodle interface. It also simplifies collaborating projects.
+- it is more convenient to store/read questions/answers in pdf files, than using the Moodle 'bank of questions' interface.
+
+## More advanced documentation
+
+To read more about what this module can do, on how the parameters of your question can be set, see the complete documentation [here](doc/documentation.md).
+
+%package help
+Summary: Development documents and examples for moodlexport
+Provides: python3-moodlexport-doc
+%description help
+# moodlexport
+
+This Python module provides code which allows to easily generate families of questions (called *categories* in Moodle) that can be directly created from either Python or Latex document, and then directly exported into Moodle (through the Moodle XML import functionality), where they can be used to create a test.
+
+| Overview of the possible conversions done within moodlexport |
+| --- |
+| <img src="doc/images/schema/schema.png" width="400"> |
+
+### Installing
+
+It can be installed with a pip command : `pip install moodlexport`
+
+### A quick overview of what this Module can do
+
+This module focuses on two type of questions provided by Moodle : the `multichoice` question (the student chooses one or more answers among others), and the `essay` question (the student is provided a space to type its answer, or upload a document).
+
+| An essay question | A multichoice question |
+| --- | --- |
+| <img src="examples/simplest_essay_question_from_python/moodle.png" width="300"> | <img src="examples/simplest_multichoice_question_from_python/moodle.png" width="300"> |
+
+Say that you want to define a multiple choice question in Moodle. This requires a lot of parameters to tune, but for now let's focus on the essential : what you basically needs is
+
+1. The body/text of your question
+2. A list of potential answers
+3. Setting which answer is the good one (see the documentation for more advanced settings like having more than one good answer)
+4. Exporting that to Moodle
+
+Here is a short overview on how to do that from Pyhton with `moodlexport`.
+
+| Writing a multichoice question from Python |
+| --- |
+| <img src="examples/simplest_multichoice_question_from_python/python.png" width="400"> |
+| <img src="examples/simplest_multichoice_question_from_python/moodle.png" width="400"> |
+| <img src="examples/simplest_multichoice_question_from_python/pdf.png" width="400"> |
+| From top to bottom: 1) the python code defining our question and producing a .xml file; 2) that question in Moodle after importing the .xml file; 3) a .pdf produced by the Python code, for convenience. You can find the corresponding code [here](examples/simplest_multichoice_question_from_python/template.ipynb) |
+
+You could equivalently obtain the very same result by typing the question in a Latex file, and using moodlexport to convert it:
+
+| Writing a multichoice question from Latex |
+| --- |
+| <img src="examples/simplest_multichoice_question_from_latex/latex.png" width="200"> |
+| <img src="examples/simplest_multichoice_question_from_latex/python.png" width="200"> |
+| <img src="examples/simplest_multichoice_question_from_python/moodle.png" width="400"> |
+| A latex file defining a question, and then converted to an .xml by Python. You can find the corresponding code [here](examples/simplest_multichoice_question_from_latex/template.ipynb) |
+
+To write an essay question, the syntax is as simple:
+
+| Writing an essay question from Python |
+| --- |
+| <img src="examples/simplest_essay_question_from_python/python.png" width="400"> |
+| <img src="examples/simplest_essay_question_from_python/moodle.png" width="400"> |
+| <img src="examples/simplest_essay_question_from_python/pdf.png" width="400"> |
+| From top to bottom: 1) the python code defining our question and producing a .xml file; 2) that question in Moodle after importing the .xml file; 3) a .pdf produced by the Python code, for convenience. You can find the corresponding code [here](examples/simplest_essay_question_from_python/template.ipynb) |
+
+The interest of writing your questions in Python is that you can easily generate random problems. Suppose for instance that we want a random question where we ask the student if a polynomial equation $aX^2 + bX +c = 0$, with integer coefficients, has a solution or no.
+One way to go is to generate a bunch of those questions, and then let Moodle pick one question at random among those during a `test`. Here is one way to do:
+
+| Generating random questions |
+| --- |
+| <img src="examples/simple_random_question/python.png" width="400"> |
+| <img src="examples/simple_random_question/moodle_cat.png" width="400"> |
+| <img src="examples/simple_random_question/moodle.png" width="400"> |
+| <img src="examples/simple_random_question/pdf.png" width="400"> |
+| From top to bottom: 1) the python code defining a category containing many variants of a same question, and producing a .xml file; 2) some of these questions appearing in a category in Moodle 3) one such question in Moodle; 4) a sample of the .pdf produced by the Python code. You can find the corresponding code [here](examples/simple_random_question/template.ipynb) |
+
+
+### Motivation
+
+The main motivation behind this module is that :
+- it is more comfortable to type maths in your day-to-day Latex interface than within Moodle
+- it is easier to define mathematical objects (vectors, matrix) in Python than in Moodle
+- generating **random problems** is quite intricate in Moodle, because we quickly face issues such as solutions being too complicated for the students (e.g. non integer), or Moodle being unable to handle certain student's answers (how would could Moodle interpret that $x+x$ is the same than $2x$?). This is much simpler to handle in Python.
+- it is easier to manipulate locally a Latex or Python file than doing it on the Moodle interface. It also simplifies collaborating projects.
+- it is more convenient to store/read questions/answers in pdf files, than using the Moodle 'bank of questions' interface.
+
+## More advanced documentation
+
+To read more about what this module can do, on how the parameters of your question can be set, see the complete documentation [here](doc/documentation.md).
+
+%prep
+%autosetup -n moodlexport-0.0.32
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-moodlexport -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0.32-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..68944aa
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+d2bd098d05cebca6655e56e98888b8dc moodlexport-0.0.32.tar.gz