Closed markkuriekkinen closed 3 years ago
This is somehow related to the yaml generation functionality. For example, the structure of links1_chapter2.yaml
looks like this:
fieldgroups:
- fields|i18n:
en:
- more|i18n:
en: ...
fi: ...
sv:
- more: ...
Finnish doesn't have its own top level element. Instead, the Finnish translations are listed under en
. This causes the Finnish field list to be None
, which crashes zip_longest
because one of its arguments was None
. If I fix the yaml files manually by duplicating the en
element and renaming it to fi
, it no longer crashes.
So, which component here is working incorrectly?
If it is the latter, I think the method ConfigParser._process_exercise_data
is responsible for loading the yaml files, and it can't handle that file structure.
@skulonen I think a-plus-rst-tools is very broken with three languages. Compare the built yaml file to the two-lingual course that works correctly (apluslms/test-course branch multilang). The three-lingual version is not only missing languages, but also contains languages in the wrong level.
Therefore, the first priority is to fix the three-lingual course compilation in a-plus-rst-tools.
Two-lingual course looks like this:
fieldgroups:
- fields:
- more|i18n:
en: English text
fi: Tekstiä suomeksi
mooc-grader aplus-json export crashes in trilingual courses (mooc-grader v1.7)
It looks like the code should combine fields from different languages, but the third language becomes
None
sometimes (in a questionnaire).None
causes a crash since it is not an iterable forzip_longest
. The value should be fields from YAML such as[{'title': '', 'fields': None}]
.Longer error traceback: