Skip to content
Snippets Groups Projects
Commit c56260b4 authored by Jan Maximilian Michal's avatar Jan Maximilian Michal
Browse files

Added gitlab-ci

parent 470b3bda
No related branches found
No related tags found
No related merge requests found
image: python:3.4
before_script:
- python -V
test:
script:
- pip install -e .
- pip install flake8
- flake8 hektor.py bin lib
Hektor QTI-XML to JSON converter
--------------------------------
This small converter should convert an Ilias export into
somthing more readable, like a json file. The main consumers
......@@ -6,12 +7,12 @@ of these files will be Grady or other applications that do
not want to deal with the QTI mess.
The name Hektor is taken from Homer's Iilas. Despite being the
greatest warrior of Troja he met his doom in the Ilias. Anyone who
greatest warrior of Troja he met his doom in the Ilias. Anyone who
works with the E-Learning Platform Ilias shall be equally doomed.
Requirements:
- lxml
Installation:
- `pip install -U hektor`
Usage:
- python3 hektor.py -h
- `python3 hektor.py -h`
......@@ -37,23 +37,23 @@ def parseme():
'input',
metavar='DATA',
type=lambda f: file_exists(parser, f),
help='A QTI-ZIP or a .xla Ilias export that contains course data')
help='an Ilias course export in .zip or .xls format')
parser.add_argument(
'output',
metavar='OUTFILE',
help='Where you want to put the output')
help='destination of converter output (JSON)')
parser.add_argument(
'-a', '--anonymous',
action='store_true',
help='Strip any personal information and create a reversing table')
help='replace personal information and create a reversing table')
parser.add_argument(
'-t', '--personal-secret-table',
help='Where to store personal information',
help='where to store personal information (CSV)',
)
parser.add_argument(
'-m', '--meta',
action='store_true',
help='If you want to add meta information (lecturer, course title)'
help='add meta information (lecturer, course title)'
)
args = parser.parse_args()
......@@ -186,6 +186,9 @@ def _postprocessing(structured_data: Dict[str, Any]) -> Dict[str, Any]:
def main():
global args
args = parseme()
processing = compose(_postprocessing, _processing, _preprocessing)
data = processing(args.input)
destination = args.output.split('.json')[0] + '.json'
......@@ -195,5 +198,4 @@ def main():
if __name__ == '__main__':
args = parseme()
main()
# New modules need to be registered here
from lib.generic import Converter
from lib.qti import QTIConverter
from lib.xls import XLSConverter
from lib.generic import Converter # noqa
from lib.qti import QTIConverter # noqa
from lib.xls import XLSConverter # noqa
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment