excel2moodle 0.5.1__py3-none-any.whl → 0.6.0__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/bullets.py +98 -0
- excel2moodle/core/dataStructure.py +6 -7
- excel2moodle/core/globals.py +3 -8
- excel2moodle/core/parser.py +37 -65
- excel2moodle/core/question.py +144 -76
- excel2moodle/extra/variableGenerator.py +250 -0
- excel2moodle/question_types/cloze.py +269 -103
- excel2moodle/question_types/nfm.py +41 -102
- excel2moodle/ui/UI_mainWindow.py +63 -36
- excel2moodle/ui/UI_variableGenerator.py +197 -0
- excel2moodle/ui/appUi.py +107 -44
- excel2moodle/ui/dialogs.py +44 -77
- excel2moodle/ui/equationChecker.py +2 -2
- excel2moodle/ui/treewidget.py +9 -24
- {excel2moodle-0.5.1.dist-info → excel2moodle-0.6.0.dist-info}/METADATA +67 -2
- {excel2moodle-0.5.1.dist-info → excel2moodle-0.6.0.dist-info}/RECORD +20 -19
- excel2moodle/core/numericMultiQ.py +0 -80
- excel2moodle/ui/windowDoc.py +0 -27
- {excel2moodle-0.5.1.dist-info → excel2moodle-0.6.0.dist-info}/WHEEL +0 -0
- {excel2moodle-0.5.1.dist-info → excel2moodle-0.6.0.dist-info}/entry_points.txt +0 -0
- {excel2moodle-0.5.1.dist-info → excel2moodle-0.6.0.dist-info}/licenses/LICENSE +0 -0
- {excel2moodle-0.5.1.dist-info → excel2moodle-0.6.0.dist-info}/top_level.txt +0 -0
@@ -2,37 +2,38 @@ excel2moodle/__init__.py,sha256=mnb-RWgmWIPSBk4S65a_jP6rxntAkTeYxN0ObUJalbQ,1801
|
|
2
2
|
excel2moodle/__main__.py,sha256=sG4ygwfVFskLQorBn-v98SvasNcPmwl_vLYpruT5Hk8,1175
|
3
3
|
excel2moodle/logger.py,sha256=fq8ZOkCI1wj38v8IyrZsUlpt16onlSH_phqbVvYUwBQ,3725
|
4
4
|
excel2moodle/core/__init__.py,sha256=87BwhtZse72Tk17Ib-V9X2k9wkhmtVnEj2ZmJ9JBAnI,63
|
5
|
+
excel2moodle/core/bullets.py,sha256=F9g0dZfkMjoYQ5jneT47GwM1-RAyhPF8y203W5mOYpU,3505
|
5
6
|
excel2moodle/core/category.py,sha256=wLzpbweQbzaItdbp2NCPI_Zmk94fy1EDOwEEN8zPvkU,2123
|
6
|
-
excel2moodle/core/dataStructure.py,sha256=
|
7
|
+
excel2moodle/core/dataStructure.py,sha256=eMQAuTTKXLmE72I6MP1255BP15N-35Qb4bESyIy4K7w,16011
|
7
8
|
excel2moodle/core/etHelpers.py,sha256=G37qplp8tPJxqHNCBrf2Wo0jJZ0aDbxE9slQavqYqd8,2293
|
8
9
|
excel2moodle/core/exceptions.py,sha256=9xfsaIcm6Yej6QAZga0d3DK3jLQejdfgJARuAaG-uZY,739
|
9
|
-
excel2moodle/core/globals.py,sha256=
|
10
|
-
excel2moodle/core/
|
11
|
-
excel2moodle/core/
|
12
|
-
excel2moodle/core/question.py,sha256=vtrYq0J5D7PivkVo4eMUx_5l5jCyunmjThij38QopyY,11706
|
10
|
+
excel2moodle/core/globals.py,sha256=URrDtWUeaZvhv38ETk_MGRDZpWF0J5cTWO_Jpf0rS9E,2807
|
11
|
+
excel2moodle/core/parser.py,sha256=ExTgPkRXevXDcnQlWE2oGoEp6mbpzP1GBmzY4zs-OPU,7220
|
12
|
+
excel2moodle/core/question.py,sha256=pltXKN52tBpFoPKEt9cIdGzZzVKpCQcXun2g9Eu1ljE,13726
|
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
|
+
excel2moodle/extra/variableGenerator.py,sha256=fiXaTeFaC--1KRyMNcsjBgUlUZ8H1rGS6f_WenN60fQ,9851
|
18
19
|
excel2moodle/question_types/__init__.py,sha256=81mss0g7SVtnlb-WkydE28G_dEAAf6oT1uB8lpK2-II,1041
|
19
|
-
excel2moodle/question_types/cloze.py,sha256=
|
20
|
+
excel2moodle/question_types/cloze.py,sha256=SvUS4gVKTr6z26KI17zV7pNIGIWQ2JdIVtPr-hgOOo8,13602
|
20
21
|
excel2moodle/question_types/mc.py,sha256=2kn6dPjFVg97H8SlUBFbcPjzDk84vgDGCMOtSABseu0,5225
|
21
22
|
excel2moodle/question_types/nf.py,sha256=bMP4IXrhnXmAI0NmjEc7DtX4xGaUbxzLicE2LjeaUho,1150
|
22
|
-
excel2moodle/question_types/nfm.py,sha256=
|
23
|
+
excel2moodle/question_types/nfm.py,sha256=p1yP6QWtFzQpVVfpjZ7R8GrsEtUSUPklbvjC8_VgYmQ,2734
|
23
24
|
excel2moodle/ui/UI_equationChecker.py,sha256=evQDlqCHeooJcAnYjhFCyjlPhfknr7ULGKQwMmqQeJ4,8947
|
24
25
|
excel2moodle/ui/UI_exportSettingsDialog.py,sha256=71xxXEqtewN0ReMfJ5t4gbrX_Bf0VEuxJ_DIV7ZtH94,6045
|
25
|
-
excel2moodle/ui/UI_mainWindow.py,sha256=
|
26
|
+
excel2moodle/ui/UI_mainWindow.py,sha256=9w8bRgOrVEX7BRGQvMuVhPCiSOsXYkMb4rxLDeRErII,21544
|
27
|
+
excel2moodle/ui/UI_variableGenerator.py,sha256=DjpZnBELSqyOjJdwjXNP2V71rCPm3tr6_XkNT9F3e34,11205
|
26
28
|
excel2moodle/ui/UI_variantDialog.py,sha256=snVaF3_YAc7NWjMRg7NzbjL_PzNbOpt4eiqElkE46io,5414
|
27
29
|
excel2moodle/ui/__init__.py,sha256=4EdGtpzwH3rgw4xW9E5x9kdPQYwKbo9rehHRZTNxCrQ,44
|
28
|
-
excel2moodle/ui/appUi.py,sha256=
|
29
|
-
excel2moodle/ui/dialogs.py,sha256=
|
30
|
-
excel2moodle/ui/equationChecker.py,sha256=
|
31
|
-
excel2moodle/ui/treewidget.py,sha256=
|
32
|
-
excel2moodle/
|
33
|
-
excel2moodle-0.
|
34
|
-
excel2moodle-0.
|
35
|
-
excel2moodle-0.
|
36
|
-
excel2moodle-0.
|
37
|
-
excel2moodle-0.
|
38
|
-
excel2moodle-0.5.1.dist-info/RECORD,,
|
30
|
+
excel2moodle/ui/appUi.py,sha256=0jxpgGiDU82AEDrj-BFgD9XdktrY_0EB7bAVMqWzJLY,13283
|
31
|
+
excel2moodle/ui/dialogs.py,sha256=8m1_hBGHt56T581PpPDsCrAd66cIy_Kxo_8NIy9kw_0,6179
|
32
|
+
excel2moodle/ui/equationChecker.py,sha256=RII9DlZAlHqe5udBWzeUaozhtyi3ZkCZs8h3-oO6pEw,2700
|
33
|
+
excel2moodle/ui/treewidget.py,sha256=aLR_B1iT2j1AAGk_9Dc6WtRbq1XijK8pICG8BEOW_Ak,1916
|
34
|
+
excel2moodle-0.6.0.dist-info/licenses/LICENSE,sha256=ywQqe6Sitymkf2lV2NRcx_aGsaC-KbSl_EfEsRXmNRw,35135
|
35
|
+
excel2moodle-0.6.0.dist-info/METADATA,sha256=ry39D3WK7oORTNVo4H1zmK9SU3d1QYEPNGBFwEpoRLI,8429
|
36
|
+
excel2moodle-0.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
37
|
+
excel2moodle-0.6.0.dist-info/entry_points.txt,sha256=myfMLDThuGgWHMJDPPfILiZqo_7D3fhmDdJGqWOAjPw,60
|
38
|
+
excel2moodle-0.6.0.dist-info/top_level.txt,sha256=5V1xRUQ9o7UmOCmNoWCZPAuy5nXp3Qbzyqch8fUGT_c,13
|
39
|
+
excel2moodle-0.6.0.dist-info/RECORD,,
|
@@ -1,80 +0,0 @@
|
|
1
|
-
"""Numeric Multi Questions Module to calculate results from a formula.
|
2
|
-
|
3
|
-
This module calculates a series of results from al matrix of variables.
|
4
|
-
For each column in the matrix there will be one result.
|
5
|
-
As well it returns a bullet points string that shows the numerical values corresponding to the set of variables
|
6
|
-
"""
|
7
|
-
|
8
|
-
import re
|
9
|
-
|
10
|
-
import pandas as pd
|
11
|
-
from asteval import Interpreter
|
12
|
-
|
13
|
-
astEval = Interpreter()
|
14
|
-
|
15
|
-
|
16
|
-
def getVariablesDict(df: pd.DataFrame, keyList: list, index: int) -> dict:
|
17
|
-
"""Liest alle Variablen-Listen deren Name in ``keyList`` ist aus dem DataFrame im Column[index]."""
|
18
|
-
dic = {}
|
19
|
-
for k in keyList:
|
20
|
-
val = df.loc[str(k)][index]
|
21
|
-
if isinstance(val, str) and val is not None:
|
22
|
-
li = val.split(";")
|
23
|
-
dic[str(k)] = li
|
24
|
-
else:
|
25
|
-
dic[str(k)] = [str(val)]
|
26
|
-
return dic
|
27
|
-
|
28
|
-
|
29
|
-
def setParameters(parameters: dict, index: int) -> None:
|
30
|
-
"""Ubergibt die Parameter mit entsprechenden Variablen-Namen an den asteval-Interpreter.
|
31
|
-
|
32
|
-
Dann kann dieser die equation loesen.
|
33
|
-
"""
|
34
|
-
for k, v in parameters.items():
|
35
|
-
comma = re.compile(r",")
|
36
|
-
value = comma.sub(".", v[index])
|
37
|
-
astEval.symtable[k] = float(value)
|
38
|
-
|
39
|
-
|
40
|
-
def insertVariablesToBPoints(varDict: dict, bulletPoints: str, index: int) -> str:
|
41
|
-
"""Für jeden Eintrag im varDict, wird im bulletPoints String der
|
42
|
-
Substring "{key}" durch value[index] ersetzt.
|
43
|
-
"""
|
44
|
-
for k, v in varDict.items():
|
45
|
-
s = r"{" + str(k) + r"}"
|
46
|
-
matcher = re.compile(s)
|
47
|
-
bulletPoints = matcher.sub(str(v[index]), bulletPoints)
|
48
|
-
return bulletPoints
|
49
|
-
|
50
|
-
|
51
|
-
def getVarsList(bps: str) -> list:
|
52
|
-
"""Durchsucht den bulletPoints String nach den Variablen `{var}`."""
|
53
|
-
vars = re.findall(r"\{\w\}", str(bps))
|
54
|
-
variablen = []
|
55
|
-
for v in vars:
|
56
|
-
variablen.append(v.strip("{}"))
|
57
|
-
return variablen
|
58
|
-
|
59
|
-
|
60
|
-
def parseNumericMultiQuestion(
|
61
|
-
datFrame: pd.DataFrame,
|
62
|
-
bulletPoints: str,
|
63
|
-
equation: str,
|
64
|
-
questionIndex: int,
|
65
|
-
) -> tuple[list[str], list[float]]:
|
66
|
-
"""Berechnet die Ergebnisse anhand der Variablen in *bulletPoints*.
|
67
|
-
|
68
|
-
Gibt eine Liste mit allen Ergebnissen zurück
|
69
|
-
und eine Liste mit den bulletPoints-Strings, die die Numerischen Variablen enthalten
|
70
|
-
"""
|
71
|
-
results = []
|
72
|
-
bps = []
|
73
|
-
varNames = getVarsList(bulletPoints)
|
74
|
-
variables = getVariablesDict(datFrame, varNames, questionIndex)
|
75
|
-
length = len(next(iter(variables.values())))
|
76
|
-
for n in range(length):
|
77
|
-
setParameters(variables, n)
|
78
|
-
results.append(astEval(equation))
|
79
|
-
bps.append(insertVariablesToBPoints(variables, bulletPoints, n))
|
80
|
-
return bps, results
|
excel2moodle/ui/windowDoc.py
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
import sys
|
2
|
-
|
3
|
-
from PySide6 import QtCore, QtWebEngineWidgets, QtWidgets
|
4
|
-
|
5
|
-
from excel2moodle import e2mMetadata
|
6
|
-
|
7
|
-
|
8
|
-
class DocumentationWindow(QtWidgets.QMainWindow):
|
9
|
-
def __init__(self, parent=None) -> None:
|
10
|
-
super().__init__(parent)
|
11
|
-
|
12
|
-
self.web_view = QtWebEngineWidgets.QWebEngineView()
|
13
|
-
self.setCentralWidget(self.web_view)
|
14
|
-
|
15
|
-
# Load the HTML documentation
|
16
|
-
url = QtCore.QUrl(e2mMetadata["documentation"])
|
17
|
-
print(f"Opening URL {url}")
|
18
|
-
self.web_view.setUrl(url)
|
19
|
-
|
20
|
-
|
21
|
-
if __name__ == "__main__":
|
22
|
-
app = QtWidgets.QApplication(sys.argv)
|
23
|
-
|
24
|
-
window = DocumentationWindow()
|
25
|
-
window.show()
|
26
|
-
|
27
|
-
sys.exit(app.exec())
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|