excel2moodle 0.5.0__py3-none-any.whl → 0.5.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- excel2moodle/core/question.py +5 -5
- excel2moodle/question_types/cloze.py +3 -3
- excel2moodle/question_types/nfm.py +1 -1
- excel2moodle/ui/dialogs.py +9 -5
- excel2moodle-0.5.1.dist-info/METADATA +106 -0
- {excel2moodle-0.5.0.dist-info → excel2moodle-0.5.1.dist-info}/RECORD +10 -10
- excel2moodle-0.5.0.dist-info/METADATA +0 -63
- {excel2moodle-0.5.0.dist-info → excel2moodle-0.5.1.dist-info}/WHEEL +0 -0
- {excel2moodle-0.5.0.dist-info → excel2moodle-0.5.1.dist-info}/entry_points.txt +0 -0
- {excel2moodle-0.5.0.dist-info → excel2moodle-0.5.1.dist-info}/licenses/LICENSE +0 -0
- {excel2moodle-0.5.0.dist-info → excel2moodle-0.5.1.dist-info}/top_level.txt +0 -0
excel2moodle/core/question.py
CHANGED
@@ -162,14 +162,14 @@ class Question:
|
|
162
162
|
"""Assemble the question to the valid xml Tree."""
|
163
163
|
mainText = self._getTextElement()
|
164
164
|
self.logger.debug("Starting assembly")
|
165
|
-
self.
|
166
|
-
textParts = self.
|
165
|
+
self._assembleAnswer(variant=variant)
|
166
|
+
textParts = self._assembleText(variant=variant)
|
167
167
|
if hasattr(self, "picture") and self.picture.ready:
|
168
168
|
mainText.append(self.picture.element)
|
169
169
|
self.logger.debug("Appended Picture element to text")
|
170
170
|
mainText.append(etHelpers.getCdatTxtElement(textParts))
|
171
171
|
|
172
|
-
def
|
172
|
+
def _assembleText(self, variant=0) -> list[ET.Element]:
|
173
173
|
"""Assemble the Question Text.
|
174
174
|
|
175
175
|
Intended for the cloze question, where the answers parts are part of the text.
|
@@ -202,7 +202,7 @@ class Question:
|
|
202
202
|
return self.bulletList
|
203
203
|
return None
|
204
204
|
|
205
|
-
def
|
205
|
+
def _assembleAnswer(self, variant: int = 0) -> None:
|
206
206
|
pass
|
207
207
|
|
208
208
|
def _setID(self, id=0) -> None:
|
@@ -229,7 +229,7 @@ class ParametricQuestion(Question):
|
|
229
229
|
def replaceMatch(match: Match[str]) -> str | int | float:
|
230
230
|
key = match.group(1)
|
231
231
|
if key in self.variables:
|
232
|
-
value = self.variables[key][variant]
|
232
|
+
value = self.variables[key][variant - 1]
|
233
233
|
return f"{value}".replace(".", ",\\!")
|
234
234
|
return match.group(0) # keep original if no match
|
235
235
|
|
@@ -30,7 +30,7 @@ class ClozeQuestion(ParametricQuestion):
|
|
30
30
|
self.questionTexts: dict[int, list[ET.Element]] = {}
|
31
31
|
self.partsNum: int = 0
|
32
32
|
|
33
|
-
def
|
33
|
+
def _assembleAnswer(self, variant: int = 1) -> None:
|
34
34
|
for part, ans in self.answerVariants.items():
|
35
35
|
result = ans[variant - 1]
|
36
36
|
if self.answerTypes.get(part, None) == "MC":
|
@@ -49,8 +49,8 @@ class ClozeQuestion(ParametricQuestion):
|
|
49
49
|
self.logger.debug("Appended Question Parts %s to main text", part)
|
50
50
|
self.questionTexts[part].append(ET.Element("hr"))
|
51
51
|
|
52
|
-
def
|
53
|
-
textParts = super().
|
52
|
+
def _assembleText(self, variant=0) -> list[ET.Element]:
|
53
|
+
textParts = super()._assembleText(variant=variant)
|
54
54
|
self.logger.debug("Appending QuestionParts to main text")
|
55
55
|
for paragraphs in self.questionTexts.values():
|
56
56
|
for par in paragraphs:
|
@@ -30,7 +30,7 @@ class NFMQuestion(ParametricQuestion):
|
|
30
30
|
super().__init__(*args, **kwargs)
|
31
31
|
self.answerVariants: list[ET.Element]
|
32
32
|
|
33
|
-
def
|
33
|
+
def _assembleAnswer(self, variant: int = 1) -> None:
|
34
34
|
prevAnsElement = self.element.find(XMLTags.ANSWER)
|
35
35
|
if prevAnsElement is not None:
|
36
36
|
self.element.remove(prevAnsElement)
|
excel2moodle/ui/dialogs.py
CHANGED
@@ -164,16 +164,20 @@ class AboutDialog(QtWidgets.QMessageBox):
|
|
164
164
|
self.setStandardButtons(QtWidgets.QMessageBox.StandardButton.Close)
|
165
165
|
|
166
166
|
self.aboutMessage: str = f"""
|
167
|
-
<h1> About {e2mMetadata["name"]} v
|
167
|
+
<h1> About {e2mMetadata["name"]} v{e2mMetadata["version"]}</h1><br>
|
168
168
|
<p style="text-align:center">
|
169
169
|
|
170
170
|
<b><a href="{e2mMetadata["homepage"]}">{e2mMetadata["name"]}</a> - {e2mMetadata["description"]}</b>
|
171
171
|
</p>
|
172
172
|
<p style="text-align:center">
|
173
|
-
|
174
|
-
<a href="{e2mMetadata["documentation"]}">documentation</a></b>
|
175
|
-
is also available.
|
173
|
+
If you need help you can find some <a href="https://gitlab.com/jbosse3/excel2moodle/-/example/"> examples.</a>
|
176
174
|
</br>
|
175
|
+
A Documentation can be viewed by clicking "F1",
|
176
|
+
or onto the documentation button.
|
177
|
+
</br>
|
178
|
+
</p>
|
179
|
+
<p style="text-align:center">
|
180
|
+
To see whats new in version {e2mMetadata["version"]} see the <a href="https://gitlab.com/jbosse3/excel2moodle#changelogs"> changelogs.</a>
|
177
181
|
</p>
|
178
182
|
<p style="text-align:center">
|
179
183
|
This project is maintained by {e2mMetadata["author"]}.
|
@@ -181,7 +185,7 @@ class AboutDialog(QtWidgets.QMessageBox):
|
|
181
185
|
Development takes place at <a href="{e2mMetadata["homepage"]}"> GitLab: {e2mMetadata["homepage"]}</a>
|
182
186
|
contributions are very welcome
|
183
187
|
</br>
|
184
|
-
If you encounter any issues please report them under the repositories issues page
|
188
|
+
If you encounter any issues please report them under the <a href="https://gitlab.com/jbosse3/excel2moodle/-/issues/"> repositories issues page </a>.
|
185
189
|
</br>
|
186
190
|
</p>
|
187
191
|
<p style="text-align:center">
|
@@ -0,0 +1,106 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: excel2moodle
|
3
|
+
Version: 0.5.1
|
4
|
+
Summary: A package for converting questions from a spreadsheet, to valid moodle-xml
|
5
|
+
Author: Jakob Bosse
|
6
|
+
License-Expression: GPL-3.0-or-later
|
7
|
+
Project-URL: Repository, https://gitlab.com/jbosse3/excel2moodle.git
|
8
|
+
Project-URL: Documentation, https://jbosse3.gitlab.io/excel2moodle
|
9
|
+
Keywords: moodle,XML,teaching,question,converter,open educational Ressource
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
11
|
+
Classifier: Operating System :: OS Independent
|
12
|
+
Requires-Python: >=3.10
|
13
|
+
Description-Content-Type: text/markdown
|
14
|
+
License-File: LICENSE
|
15
|
+
Requires-Dist: pyside6>=6.8.0
|
16
|
+
Requires-Dist: pandas>=2.1.3
|
17
|
+
Requires-Dist: lxml>=5.4.0
|
18
|
+
Requires-Dist: asteval>=1.0.6
|
19
|
+
Requires-Dist: python-calamine>=0.3.2
|
20
|
+
Dynamic: license-file
|
21
|
+
|
22
|
+
# excel 2 Moodle
|
23
|
+
{width=35%}
|
24
|
+
|
25
|
+
This Python program helps to create Moodle questions in less time.
|
26
|
+
The idea is to write the questions data into a spreadsheet file, from which the program generates the moodle compliant xml Files.
|
27
|
+
All questions or a selection of questions can be exported into one xml file to be imported into moodle.
|
28
|
+
|
29
|
+
## Concept
|
30
|
+
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.
|
31
|
+
|
32
|
+
A `settings` sheet contains global settings to be used for all questions and categories.
|
33
|
+
Another sheet stores metadata for the different categories of questions.
|
34
|
+
And each category lives inside a separate sheet inside the spreadsheet document.
|
35
|
+
|
36
|
+
## Getting Started
|
37
|
+
|
38
|
+
### Installation
|
39
|
+
To get started with excel2moodle first have a look at the [installation](https://jbosse3.gitlab.io/excel2moodle/howto.html#excel2moodle-unter-windows-installieren)
|
40
|
+
If you already have python and uv installed, it is as easy as running `uv tool install excel2moodle`.
|
41
|
+
|
42
|
+
### [ Documentation ](https://jbosse3.gitlab.io/excel2moodle/index.html)
|
43
|
+
Once excel2moodle is installed you can checkout the [example question sheet](https://gitlab.com/jbosse3/excel2moodle/-/tree/master/example?ref_type=heads)
|
44
|
+
in the repository.
|
45
|
+
|
46
|
+
Some steps are already documented as [ tutorials ](https://jbosse3.gitlab.io/excel2moodle/howto.html)
|
47
|
+
you can follow along.
|
48
|
+
|
49
|
+
And please have a look into the [**user Reference**](https://jbosse3.gitlab.io/excel2moodle/userReference.html)
|
50
|
+
of the documentation.
|
51
|
+
That part explains each part of defining a question.
|
52
|
+
|
53
|
+
|
54
|
+
## Functionality
|
55
|
+
* Equation Verification:
|
56
|
+
+ this tool helps you to validate the correct equation for the parametrized Questions.
|
57
|
+
* Question Preview:
|
58
|
+
+ This helps you when selecting the correct questions for the export.
|
59
|
+
* Export Options:
|
60
|
+
+ you can export the questions preserving the categories in moodle
|
61
|
+
|
62
|
+
### Question Types
|
63
|
+
* Generate multiple Choice Questions:
|
64
|
+
+ The answers can be pictures or normal text
|
65
|
+
* Generate Numeric Questions
|
66
|
+
* Generate parametrized numeric Questions
|
67
|
+
* Generate parametrized cloze Questions
|
68
|
+
|
69
|
+
|
70
|
+
{width=80%}
|
71
|
+
|
72
|
+
## Licensing and authorship
|
73
|
+
excel2moodle is lincensed under the latest [GNU GPL license](https://gitlab.com/jbosse3/excel2moodle/-/blob/master/LICENSE)
|
74
|
+
Initial development was made by Richard Lorenz, and later taken over by Jakob Bosse
|
75
|
+
|
76
|
+
## Supporting
|
77
|
+
A special thanks goes to the [Civil Engineering Departement of the Fachhochschule Potsdam](https://www.fh-potsdam.de/en/study-further-education/departments/civil-engineering-department)
|
78
|
+
where i was employed as a student associate to work on this project.
|
79
|
+
|
80
|
+
If You want to support my work as well, you can by me a [coffee](https://ko-fi.com/jbosse3)
|
81
|
+
|
82
|
+
# Changelogs
|
83
|
+
|
84
|
+
## 0.5.1 (2025-06-24)
|
85
|
+
Minor docs improvement and question variant bugfix
|
86
|
+
|
87
|
+
### bugfix (1 change)
|
88
|
+
|
89
|
+
- [Bullet points variant didn't get updated](https://gitlab.com/jbosse3/excel2moodle/-/commit/7b4ad9e9c8a4216167ae019859ebaa8def81d57f)
|
90
|
+
|
91
|
+
## 0.5.0 (2025-06-20)
|
92
|
+
settings handling improved
|
93
|
+
|
94
|
+
### feature (2 changes)
|
95
|
+
|
96
|
+
- [Pixmaps and vector graphics scaled to fit in preview](https://gitlab.com/jbosse3/excel2moodle/-/commit/00a6ef13fb2a0046d7641e24af6cf6f08642390e)
|
97
|
+
- [feature: category Settings implemented](https://gitlab.com/jbosse3/excel2moodle/-/commit/d673cc3f5ba06051aa37bc17a3ef0161121cb730)
|
98
|
+
|
99
|
+
### improvement (1 change)
|
100
|
+
|
101
|
+
- [Tolerance is harmonized by questionData.get()](https://gitlab.com/jbosse3/excel2moodle/-/commit/8d1724f4877e1584cc531b6b3f278bdea68b5831)
|
102
|
+
|
103
|
+
### Settings Errors are logged (1 change)
|
104
|
+
|
105
|
+
- [Log Errors in settings Sheet](https://gitlab.com/jbosse3/excel2moodle/-/commit/07e58f957c69ea818db1c5679cf89e287817ced3)
|
106
|
+
|
@@ -9,30 +9,30 @@ excel2moodle/core/exceptions.py,sha256=9xfsaIcm6Yej6QAZga0d3DK3jLQejdfgJARuAaG-u
|
|
9
9
|
excel2moodle/core/globals.py,sha256=Zm1wcrzQTRnhjrkwgBvo7VjKCFdPMjh-VLSSI5_QCO8,2837
|
10
10
|
excel2moodle/core/numericMultiQ.py,sha256=vr-gYogu2sf2a_Bhvhnu1ZSZFZXM32MfhJesjTkoOQM,2618
|
11
11
|
excel2moodle/core/parser.py,sha256=y0BXXt5j-4gRZO8otmEZ1Rmb0DW7hziesUoZ2kVpo9Y,8235
|
12
|
-
excel2moodle/core/question.py,sha256=
|
12
|
+
excel2moodle/core/question.py,sha256=vtrYq0J5D7PivkVo4eMUx_5l5jCyunmjThij38QopyY,11706
|
13
13
|
excel2moodle/core/settings.py,sha256=27D-P44rYk-DMrwI1dNpxHcznpFQf1W3XZrOc8e6rX4,5855
|
14
14
|
excel2moodle/core/stringHelpers.py,sha256=OzFZ6Eu3PeBLKb61K-aeVfUZmVuBerr9KfyOsuNRd7Y,2403
|
15
15
|
excel2moodle/core/validator.py,sha256=ssgkyUwrR-0AGPX1cUqvRwZsGja13J7HQ2W72ltqN-Y,4683
|
16
16
|
excel2moodle/extra/__init__.py,sha256=PM-id60HD21A3IcGC_fCYFihS8osBGZMIJCcN-ZRsIM,293
|
17
17
|
excel2moodle/extra/equationVerification.py,sha256=GLJl1r90d8AAiNy0H2hooZrg3D6aEwNfifYKAe3aGxM,3921
|
18
18
|
excel2moodle/question_types/__init__.py,sha256=81mss0g7SVtnlb-WkydE28G_dEAAf6oT1uB8lpK2-II,1041
|
19
|
-
excel2moodle/question_types/cloze.py,sha256=
|
19
|
+
excel2moodle/question_types/cloze.py,sha256=N-0fDSWfpxYN0YZmPQPEaNHpxqW1OOC32WNseYmy6zM,7657
|
20
20
|
excel2moodle/question_types/mc.py,sha256=2kn6dPjFVg97H8SlUBFbcPjzDk84vgDGCMOtSABseu0,5225
|
21
21
|
excel2moodle/question_types/nf.py,sha256=bMP4IXrhnXmAI0NmjEc7DtX4xGaUbxzLicE2LjeaUho,1150
|
22
|
-
excel2moodle/question_types/nfm.py,sha256=
|
22
|
+
excel2moodle/question_types/nfm.py,sha256=03-aihk9HtzRCgpCGz_5WOR4JOqdJlkafyKprgLrosI,4948
|
23
23
|
excel2moodle/ui/UI_equationChecker.py,sha256=evQDlqCHeooJcAnYjhFCyjlPhfknr7ULGKQwMmqQeJ4,8947
|
24
24
|
excel2moodle/ui/UI_exportSettingsDialog.py,sha256=71xxXEqtewN0ReMfJ5t4gbrX_Bf0VEuxJ_DIV7ZtH94,6045
|
25
25
|
excel2moodle/ui/UI_mainWindow.py,sha256=asWUmKIYqufKUvRuCuA1JoMyv4qfRXyoR70F0331lww,19291
|
26
26
|
excel2moodle/ui/UI_variantDialog.py,sha256=snVaF3_YAc7NWjMRg7NzbjL_PzNbOpt4eiqElkE46io,5414
|
27
27
|
excel2moodle/ui/__init__.py,sha256=4EdGtpzwH3rgw4xW9E5x9kdPQYwKbo9rehHRZTNxCrQ,44
|
28
28
|
excel2moodle/ui/appUi.py,sha256=88WODtEWqX1oQJebbPhlQChKM5N_9BH0ZuOpKVYrKm0,10863
|
29
|
-
excel2moodle/ui/dialogs.py,sha256=
|
29
|
+
excel2moodle/ui/dialogs.py,sha256=0h6aD4tguph1P07dorkn1A5B7_Z5SJZQ2_8xBYWK6MU,7689
|
30
30
|
excel2moodle/ui/equationChecker.py,sha256=ANpN7S0llkp6pGL1sKHII1Jc8YUvgDR458UnGVnZZOo,2702
|
31
31
|
excel2moodle/ui/treewidget.py,sha256=az64swVj1yQUsioeaZys32AauvQDdC4EKcqdbbWgL6s,2489
|
32
32
|
excel2moodle/ui/windowDoc.py,sha256=WvzHj6F4JvHP82WlTsyFeOXW024Xq3BUqtp--T4twuI,661
|
33
|
-
excel2moodle-0.5.
|
34
|
-
excel2moodle-0.5.
|
35
|
-
excel2moodle-0.5.
|
36
|
-
excel2moodle-0.5.
|
37
|
-
excel2moodle-0.5.
|
38
|
-
excel2moodle-0.5.
|
33
|
+
excel2moodle-0.5.1.dist-info/licenses/LICENSE,sha256=ywQqe6Sitymkf2lV2NRcx_aGsaC-KbSl_EfEsRXmNRw,35135
|
34
|
+
excel2moodle-0.5.1.dist-info/METADATA,sha256=H0kM9fFOx63yWYuKrq6ffdZglqWWCxdrxpKNdop3C0E,4614
|
35
|
+
excel2moodle-0.5.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
36
|
+
excel2moodle-0.5.1.dist-info/entry_points.txt,sha256=myfMLDThuGgWHMJDPPfILiZqo_7D3fhmDdJGqWOAjPw,60
|
37
|
+
excel2moodle-0.5.1.dist-info/top_level.txt,sha256=5V1xRUQ9o7UmOCmNoWCZPAuy5nXp3Qbzyqch8fUGT_c,13
|
38
|
+
excel2moodle-0.5.1.dist-info/RECORD,,
|
@@ -1,63 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: excel2moodle
|
3
|
-
Version: 0.5.0
|
4
|
-
Summary: A package for converting questions from a spreadsheet, to valid moodle-xml
|
5
|
-
Author: Jakob Bosse
|
6
|
-
License-Expression: GPL-3.0-or-later
|
7
|
-
Project-URL: Repository, https://gitlab.com/jbosse3/excel2moodle.git
|
8
|
-
Project-URL: Documentation, https://jbosse3.gitlab.io/excel2moodle
|
9
|
-
Keywords: moodle,XML,teaching,question,converter,open educational Ressource
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
11
|
-
Classifier: Operating System :: OS Independent
|
12
|
-
Requires-Python: >=3.10
|
13
|
-
Description-Content-Type: text/markdown
|
14
|
-
License-File: LICENSE
|
15
|
-
Requires-Dist: pyside6>=6.8.0
|
16
|
-
Requires-Dist: pandas>=2.1.3
|
17
|
-
Requires-Dist: lxml>=5.4.0
|
18
|
-
Requires-Dist: asteval>=1.0.6
|
19
|
-
Requires-Dist: python-calamine>=0.3.2
|
20
|
-
Dynamic: license-file
|
21
|
-
|
22
|
-
# excel 2 Moodle
|
23
|
-
[Deutsche README](https://gitlab.com/jbosse3/excel2moodle/-/blob/master/README.de.md)
|
24
|
-
|
25
|
-
{width=50%}
|
26
|
-
|
27
|
-
This Python program helps to create Moodle questions in less time.
|
28
|
-
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.
|
29
|
-
|
30
|
-
Furthermore this program lets you create a single XML-File with a selection of questions, that then can be imported to a Moodle-Test.
|
31
|
-
|
32
|
-
## Concept
|
33
|
-
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.
|
34
|
-
|
35
|
-
There Should be a sheet called "Kategorien", where an overview over the different categories is stored.
|
36
|
-
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.
|
37
|
-
Furthermore the points used for grading, are set in the "Kategorien" sheet
|
38
|
-
|
39
|
-
|
40
|
-
## Development State
|
41
|
-
This program is still quite rough, with very litte robustness against faulty user input inside the Spreadsheet.
|
42
|
-
|
43
|
-
## Functionality
|
44
|
-
* Parse multiple Choice Questions, each into one XML file
|
45
|
-
* Parse Numeric Questions, each into one XML file
|
46
|
-
* create single XML File from a selection of questions
|
47
|
-
|
48
|
-
## Development Goals
|
49
|
-
* [X] creating an example spreadsheet
|
50
|
-
* [X] Export function, to create numerical Question version from a matrix of variables and corresponding correct Answers:
|
51
|
-
* similar to the calculated question Type, but with the benefit, of serving all students the same exact question
|
52
|
-
* [.] making it more robust:
|
53
|
-
* [X] Adding Error Messages when exporting
|
54
|
-
* [X] Creating logging
|
55
|
-
* [ ] Logging Errors to File
|
56
|
-
* [ ] making it Image File-Type agnostic
|
57
|
-
* [ ] Creating a Settings Menu
|
58
|
-
* [ ] Making keys in spreadsheet selectable in the Settings
|
59
|
-
* [ ] Setting image folder
|
60
|
-
|
61
|
-
## Licensing and authorship
|
62
|
-
excel2moodle is lincensed under the latest [GNU GPL license](https://gitlab.com/jbosse3/excel2moodle/-/blob/master/LICENSE)
|
63
|
-
Initial development was made by Richard Lorenz, and later taken over by Jakob Bosse
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|