apluslms/a-plus-rst-tools

The question directives require a key/id when the category is added

Closed this issue · 2 comments

Normally when the question directive does not have the key/id, the a-plus-rst-tools do not complain about a missing key/id and it is automatically generated.

For example, the following directive will work.

  .. pick-one:: 10

  .. pick-any:: 10

But if we add the category/difficulty to the question directive

  .. pick-one:: A10

  .. pick-any:: A10

The course cannot be compiled and require either the key/id, before the [CATEGORY|POINTS], or to remove the category. The following error is reported in this specific case.

Exception occurred:
  File "/compile/a-plus-rst-tools/directives/questionnaire.py", line 256, in create_question
    question_points = int(self.arguments[0])
ValueError: invalid literal for int() with base 10: 'A10'

Therefore, if we want to add the category we should have something like this

  .. pick-one:: my-id-pick-one A10

  .. pick-any:: mi-id-pick-any A10

The category is defined in the questionnaire directive and not in the question directive

@jaguarfi Yes, it is correct that categories and difficulties are defined in the questionnaire directive. The exercise-level settings can not be changed in individual questions in one exercise/questionnaire. However, note that A+ has different settings "category" and "difficulty". The A-B-C values have been used for "difficulty" and "categories" are typically like "submit", "questionnaire", "Online exercises", "Visualizations", and so on.