-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple templates for a templated question/exam #49
Comments
Unless there are issues for the actual yaml/rust implementation, a simpler map could be template:
path: this_question_template
variants: # or perhaps better 'versions' / 'alternatives' / 'types' ... ?
- variant: verbose # rumbas compile --template-variant verbose .. will be needed
path: this_question_template_verbose
- variant: overview
path: this_question_template_overview
- variant: other # rumbas compile --template-variant other .. will be needed
path: this_question_template_other It will remain possible to just give a string which would equal template: <string_value> rumbas would have an exam-level --template-variant option, that would imply using templates of a given variant if present. If a question does not have a template at all, or does not have a given variant-template, the normal, default output is generated for that question. The suffix is not really needed per question, but rather per exam or per rumbas-run. Following exam-yaml could eg generate two exams: template-variants:
- variant: default
suffix: ''
- variant: overview
suffix: overview rumbas compile --template-variant overview --theme overview --suffix _overview See related issue #22 |
An exam can specify multiple variants and by default all of these will be compiled on compile, just like all locales are compiled by default. For the variants as well as the locale, a flag will be added to allow compiling just one locale or variant. I will update the initial issue with this information later. |
or even just variant templates in the question_templates folder with a naming-convention: derivative.yaml the suffix is the trailing part -short / -verbose / .... |
VariantsIt needs to work closer with the default values. New folder structure
Templating with variantsNew template field in a questiontemplate:
default: question_template
other: other_question_template
verbose: verbose_question_template It would still be possible to just write template: question_template to mean template:
default: question_template New variants field in an examvariants: [default, other, verbose] CompilationCommands
What does the compilation do?
Changing a theme
PSSomething else / relatedTo make life easier (and reduce duplicate yaml), a question_template should be able to use a template itself and this template needs to be templateable itself. This would make certain things easier, like setting certain fields (like advice) to an empty string. short_question_template.yaml
---
template: template:template # this is templateable
statement: template:statement
variables: template:variables
advice: "" general_question_template.yaml
---
statement: template:statement
variables: template:variables
advice: template:advice
... short_general_question_template.yaml
---
template: general_question_template
statement: template:statement
variables: template:variables
advice: ""
... |
This can now be handled by using symlinks.
|
Templates are now also templateable so the PS in #49 (comment) is also usable now. |
Instead of just a
template
field with a file_name (e.g.template: question_template
) it would become a map.It will remain possible to just give a string which would equal
The text was updated successfully, but these errors were encountered: