excel2moodle 0.7.0__tar.gz → 0.7.1__tar.gz

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.
Files changed (52) hide show
  1. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/PKG-INFO +12 -1
  2. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/README.md +11 -0
  3. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/core/question.py +2 -0
  4. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/core/settings.py +2 -0
  5. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/question_types/mc.py +43 -5
  6. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle.egg-info/PKG-INFO +12 -1
  7. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/pyproject.toml +1 -1
  8. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/LICENSE +0 -0
  9. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/__init__.py +0 -0
  10. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/__main__.py +0 -0
  11. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/core/__init__.py +0 -0
  12. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/core/bullets.py +0 -0
  13. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/core/category.py +0 -0
  14. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/core/dataStructure.py +0 -0
  15. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/core/etHelpers.py +0 -0
  16. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/core/exceptions.py +0 -0
  17. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/core/globals.py +0 -0
  18. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/core/parser.py +0 -0
  19. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/core/stringHelpers.py +0 -0
  20. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/core/validator.py +0 -0
  21. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/extra/__init__.py +0 -0
  22. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/extra/equationChecker.py +0 -0
  23. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/extra/scriptCaller.py +0 -0
  24. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/extra/updateQuery.py +0 -0
  25. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/extra/variableGenerator.py +0 -0
  26. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/logger.py +0 -0
  27. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/question_types/__init__.py +0 -0
  28. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/question_types/cloze.py +0 -0
  29. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/question_types/nf.py +0 -0
  30. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/question_types/nfm.py +0 -0
  31. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/ui/UI_equationChecker.py +0 -0
  32. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/ui/UI_exportSettingsDialog.py +0 -0
  33. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/ui/UI_mainWindow.py +0 -0
  34. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/ui/UI_updateDlg.py +0 -0
  35. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/ui/UI_variableGenerator.py +0 -0
  36. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/ui/UI_variantDialog.py +0 -0
  37. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/ui/__init__.py +0 -0
  38. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/ui/appUi.py +0 -0
  39. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/ui/dialogs.py +0 -0
  40. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle/ui/treewidget.py +0 -0
  41. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle.egg-info/SOURCES.txt +0 -0
  42. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle.egg-info/dependency_links.txt +0 -0
  43. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle.egg-info/entry_points.txt +0 -0
  44. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle.egg-info/requires.txt +0 -0
  45. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/excel2moodle.egg-info/top_level.txt +0 -0
  46. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/setup.cfg +0 -0
  47. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/test/test_bullets.py +0 -0
  48. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/test/test_feedbacking.py +0 -0
  49. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/test/test_nfmParsing.py +0 -0
  50. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/test/test_parseQuestion.py +0 -0
  51. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/test/test_picture.py +0 -0
  52. {excel2moodle-0.7.0 → excel2moodle-0.7.1}/test/test_questionDataGet.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: excel2moodle
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: A package for converting questions from a spreadsheet, to valid moodle-xml
5
5
  Author: Jakob Bosse
6
6
  License-Expression: GPL-3.0-or-later
@@ -90,6 +90,17 @@ If You want to support my work as well, you can by me a [coffee](https://ko-fi.c
90
90
 
91
91
  # Changelogs
92
92
 
93
+ ## 0.7.1 (2025-10-04)
94
+ feedbacking improved
95
+
96
+ ### documentation (1 change)
97
+
98
+ - [documentation improvement](https://gitlab.com/jbosse3/excel2moodle/-/commit/1a1110d05b49175e049a9ca18a027216a765e277)
99
+
100
+ ### feature (1 change)
101
+
102
+ - [Added MC answer feedback support](https://gitlab.com/jbosse3/excel2moodle/-/commit/4f5fe550786cf29839ba54fbdfedbf03c72d3009)
103
+
93
104
  ## 0.7.0 (2025-09-30)
94
105
  Rework of the equation checker done!
95
106
 
@@ -68,6 +68,17 @@ If You want to support my work as well, you can by me a [coffee](https://ko-fi.c
68
68
 
69
69
  # Changelogs
70
70
 
71
+ ## 0.7.1 (2025-10-04)
72
+ feedbacking improved
73
+
74
+ ### documentation (1 change)
75
+
76
+ - [documentation improvement](https://gitlab.com/jbosse3/excel2moodle/-/commit/1a1110d05b49175e049a9ca18a027216a765e277)
77
+
78
+ ### feature (1 change)
79
+
80
+ - [Added MC answer feedback support](https://gitlab.com/jbosse3/excel2moodle/-/commit/4f5fe550786cf29839ba54fbdfedbf03c72d3009)
81
+
71
82
  ## 0.7.0 (2025-09-30)
72
83
  Rework of the equation checker done!
73
84
 
@@ -60,6 +60,8 @@ class QuestionData(dict):
60
60
  Tags.QUESTIONPART,
61
61
  Tags.TEXT,
62
62
  Tags.MEDIASCRIPTS,
63
+ Tags.TRUEANSFB,
64
+ Tags.FALSEANSFB,
63
65
  ],
64
66
  default: object = None,
65
67
  ) -> list: ...
@@ -95,6 +95,8 @@ class Tags(StrEnum):
95
95
  FALSEFB = "falsefeedback", str, "Your answer is sadly wrong, try again!!!"
96
96
  PCORRECFB = "partialcorrectfeedback", str, "Your answer is partially right."
97
97
  GENERALFB = "feedback", str, "You answered this question."
98
+ TRUEANSFB = "trueanswerfeedback", list, None
99
+ FALSEANSFB = "falseanswerfeedback", list, None
98
100
 
99
101
  MEDIASCRIPTS = "mediascripts", list, None
100
102
  MEDIACALL = "parametricmedia", str, None
@@ -52,11 +52,21 @@ class MCQuestionParser(QuestionParser):
52
52
 
53
53
  def getAnsElementsList(
54
54
  self,
55
- answerList: list,
55
+ answerList: list[str],
56
+ feedbackList: list[str],
56
57
  fraction: float = 50,
57
58
  format="html",
58
59
  ) -> list[ET.Element]:
60
+ """Take the answer Strings and format them each into a xml-tree.
61
+
62
+ If a feedbackList is given it is used. Otherwise the standard feedbacks are used.
63
+ """
59
64
  elementList: list[ET.Element] = []
65
+ if feedbackList is None:
66
+ if fraction > 0:
67
+ feedbackList = [self.rawInput.get(Tags.FALSEFB) for _ in answerList]
68
+ else:
69
+ feedbackList = [self.rawInput.get(Tags.TRUEFB) for _ in answerList]
60
70
  for i, ans in enumerate(answerList):
61
71
  p = TextElements.PLEFT.create()
62
72
  if self.answerType == "picture":
@@ -72,7 +82,7 @@ class MCQuestionParser(QuestionParser):
72
82
  elementList[-1].append(
73
83
  self.getFeedBEle(
74
84
  XMLTags.ANSFEEDBACK,
75
- text=self.rawInput.get(Tags.FALSEFB),
85
+ text=feedbackList[i],
76
86
  style=TextElements.SPANRED,
77
87
  ),
78
88
  )
@@ -82,7 +92,7 @@ class MCQuestionParser(QuestionParser):
82
92
  elementList[-1].append(
83
93
  self.getFeedBEle(
84
94
  XMLTags.ANSFEEDBACK,
85
- text=self.rawInput.get(Tags.TRUEFB),
95
+ text=feedbackList[i],
86
96
  style=TextElements.SPANGREEN,
87
97
  ),
88
98
  )
@@ -121,12 +131,40 @@ class MCQuestionParser(QuestionParser):
121
131
  self.rawInput.get(Tags.FALSE), style=self.answerType
122
132
  )
123
133
  self.logger.debug(f"got the following false answers \n {falseAList=}")
134
+ trueFbs = self.rawInput.get(Tags.TRUEANSFB)
135
+ falseFbs = self.rawInput.get(Tags.FALSEANSFB)
136
+ if trueFbs is None:
137
+ trueFbs = [self.rawInput.get(Tags.FALSEFB) for _ in trueAnsList]
138
+ if falseFbs is None:
139
+ falseFbs = [self.rawInput.get(Tags.TRUEFB) for _ in falseAList]
140
+ if len(trueFbs) < len(trueAnsList):
141
+ self.logger.warning(
142
+ "There are less true-feedbacks than true-answers given. Using fallback feedback"
143
+ )
144
+ delta = len(trueAnsList) - len(trueFbs)
145
+ while delta > 0:
146
+ trueFbs.append(self.rawInput.get(Tags.TRUEFB))
147
+ delta -= 1
148
+ if len(falseFbs) < len(falseAList):
149
+ self.logger.warning(
150
+ "There are less false-feedbacks than false-answers given. Using fallback feedback"
151
+ )
152
+ delta = len(falseAList) - len(falseFbs)
153
+ while delta > 0:
154
+ falseFbs.append(self.rawInput.get(Tags.TRUEFB))
155
+ delta -= 1
124
156
  truefrac = 1 / len(trueAnsList) * 100
125
157
  falsefrac = 1 / len(falseAList) * (-100)
126
158
  self.tmpEle.find(XMLTags.PENALTY).text = str(round(truefrac / 100, 4))
127
- ansList = self.getAnsElementsList(trueAnsList, fraction=round(truefrac, 4))
159
+ ansList = self.getAnsElementsList(
160
+ answerList=trueAnsList, feedbackList=trueFbs, fraction=round(truefrac, 4)
161
+ )
128
162
  ansList.extend(
129
- self.getAnsElementsList(falseAList, fraction=round(falsefrac, 4)),
163
+ self.getAnsElementsList(
164
+ answerList=falseAList,
165
+ feedbackList=falseFbs,
166
+ fraction=round(falsefrac, 4),
167
+ ),
130
168
  )
131
169
  return ansList
132
170
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: excel2moodle
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: A package for converting questions from a spreadsheet, to valid moodle-xml
5
5
  Author: Jakob Bosse
6
6
  License-Expression: GPL-3.0-or-later
@@ -90,6 +90,17 @@ If You want to support my work as well, you can by me a [coffee](https://ko-fi.c
90
90
 
91
91
  # Changelogs
92
92
 
93
+ ## 0.7.1 (2025-10-04)
94
+ feedbacking improved
95
+
96
+ ### documentation (1 change)
97
+
98
+ - [documentation improvement](https://gitlab.com/jbosse3/excel2moodle/-/commit/1a1110d05b49175e049a9ca18a027216a765e277)
99
+
100
+ ### feature (1 change)
101
+
102
+ - [Added MC answer feedback support](https://gitlab.com/jbosse3/excel2moodle/-/commit/4f5fe550786cf29839ba54fbdfedbf03c72d3009)
103
+
93
104
  ## 0.7.0 (2025-09-30)
94
105
  Rework of the equation checker done!
95
106
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "excel2moodle"
7
- version = "0.7.0"
7
+ version = "0.7.1"
8
8
  authors = [
9
9
  { name="Jakob Bosse" },
10
10
  ]
File without changes
File without changes