The following environment variables are available to the build container:
- COURSE_KEY: the Git Manager specific course key. E.g. aplus_manual_master or c1234_2021
- COURSE_ID: database id of the course on A+. E.g. 142
- STATIC_URL_PATH: URL to the course static files (no host or scheme). E.g. /static/default or /static/aplus_manual_master
- STATIC_CONTENT_HOST: full static file URL (including scheme and host). E.g. https://gitmanager.cs.aalto.fi/static/default
- CHANGED_FILES: files changed since last successful build, separated
by a newline (\n). If changes couldn't be detected or there were more than 10 changed
files, the variable is set to
*
. See "Optimizing build using CHANGED_FILES" below for more.
The CHANGED_FILES environment variable can be used to optimize the course build script by skipping steps that are unnecessary due there having been no changes to the dependencies. For example, if the course build script were to generate exercises based on some configuration files written by the course staff, generating the exercises could be skipped if the configuration files (or the generation script itself) have not changed.
IMPORTANT: Any files generated by the build script will be deleted after the build (through
git clean
) and will not be available to the next build unless the files or their
directories have been added to the apps.meta exclude_patterns. Therefore, you must add
any files whose generation you wish to optimize by skipping when generation is unnecessary
to he exclude_patterns.
To implement this optimization, all you have to do is add the files/directories to the
exclude_patterns as explained above and run a build step only if a dependent file is in the
CHANGED_FILES list or if CHANGED_FILES is *
. Note that you can make the build step dependent
on a directory by checking if any of the changed files are within that directory (e.g. by
checking if the file path starts with the directory path).
If your build script depends on this variable but you wish to trigger a full rebuild, you have the following options:
- Make all build steps dependent on a single file that rarely changes. You can then trigger a full rebuild whenever by changing that file (e.g. add/remove an extra new line). For example, making everything dependent on the main build script would most likely be a good idea.
- Check the "Set CHANGED_FILES to *" box in the Git Manager UI and trigger the build manually.
- Temporarily add
rebuild_all=true
to the GET parameters of the git commit hook URL. - Add a temporary change to the start of your build script that changes the
CHANGED_FILES
variable to*
. - Temporarily modify your build script to ignore
CHANGED_FILES
. - Modify 10+ files.
Configuration is written as JSON or YAML inside subdirectories.
Each subdirectory holding an index.json
or index.yaml
is a
valid active course.
Dates will be parsed as '%Y-%m-%dT%H:%M:%SZ', '%Y-%m-%dT%H:%M:%S', '%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M', '%Y-%m-%d %H' or '%Y-%m-%d'. Durations are given in (int)(unit), where units are y, m, d, h or w.
-
grader_config
: where to find course configuration files, defaults to the course root folderbuild_image
: container image used to build the course, defaults to a value set by the service administrators.build_cmd
: command passed to the container image above. If not specified, the image default is used.exlude_patterns
: a list of exclude patterns for paths to ignore when cleaning the git directory. E.g.exclude_patterns = _build exercises
makes sure that _build and exercises folders that were left over from last build are not removed before rebuilding. See git clean command's exclude flag for more information.
-
- The directory name acts as a course key, which is used in
- URLs:
/course_key
- URLs:
name
: A public complete course namedescription
(optional): A private course descriptionlang
(optional/a+): The default language.contact
: (optional/a+) A private contact email for course configurationcontact_phone
: (optional) A private contact phone number for course responsibleassistants
: (optional/a+) A list of assistant student idsstart
: (optional/a+) The course instance start dateend
: (optional/a+) The course instance end datestatic_dir
: (optional) This subdirectory will be linked to URL /static/course_keyhead_urls
: (optional/a+) A list of URLs to JS and CSS files that A+ includes on all course pages. For example, a common JavaScript library could be included this way without adding it separately to each exercise description.enrollment_start
: The enrollment start dateenrollment_end
: The enrollment end datelifesupport_time
: The lifesupport date (model answers are hidden from students)archive_time
: The archive date (no submissions allowed after it)enrollment_audience
: Selects the user group that is allowed to enroll in the course. One of the following:internal
: only internal students (they have a student number and should log-in with internal accounts)external
: only external students (no student number and login with Google accounts)all
: internal and external students
view_content_to
: Selects the user group that may view course contents. One of the following:enrolled
: only enrolled studentsenrollment_audience
: logged-in users in the enrollment audience (the audience is set separately)all_registered
: all logged-in userspublic
: all anonymous and authenticated users
index_mode
: Selects the display mode for the course front page. One of the following:results
: exercise resultstoc
: table of contentslast
: opens the page that the user viewed last timeexperimental
: do not use this
content_numbering
: numbering mode for the course contents (chapters and exercises). One of the following:none
: no numbers shownarabic
: arabic numbers (1, 2, 3)roman
: roman numbers (I, II, III)hidden
: no numbers, but child objects may show the hierarchy in numbering. If there are children (e.g., exercises are children of the module) and the parent has hidden numbering, then the children may have numbers such as "1.2" instead of just "2" (exercise 2 in the round 1). The hidden setting is more sensible inmodule_numbering
thancontent_numbering
.
module_numbering
: numbering mode for the modules (exercise rounds). The options are the same as forcontent_numbering
.course_description
: HTML text for the course front pagecourse_footer
: HTML text for the footer of the front pageconfigures
: list of external configuration settings. A list ofurl
: where to send the course configuration (optional). If missing, the service uses the default grader configured by the server admins.files
: what files to send. A dict of<name>: <path>
pairs. The file/directory at<path>
is sent to the url with the name<name>
.
exercises
: (deprecated, see modules) A list of active exercise keysmodules
: a list ofkey
: part of the urlname
,title
: (optional/a+) The name of the course moduleorder
: (optional/a+) the order number of the modulestatus
: (optional/a+) ready/hidden/maintenancepoints_to_pass
: (optional/a+) limit to get passed marksintroduction
: (optional/a+) introductionopen
: (optional/a+) first access dateclose
: (optional/a+) deadline dateduration
: (optional/a+) deadline in duration from openread-open
: (optional/a+) module reading opening timelate_close
: (optional/a+) late deadline datelate_duration
: (optional/a+) late deadline in duration from first deadlinelate_penalty
: (optional/a+) factor of points worth for late submissiontype
: (optional/a+) a key name in 'module_types'children
: a list ofkey
: part of the urlname
,title
: (optional/a+) The name of the learning objectcategory
: a key name in 'categories'status
: (optional/a+) ready/unlisted/hidden/maintenanceaudience
: (optional/a+) the audience on A+. One of the following:internal
: only internal students (they have a student number and should log-in with internal accounts)external
: only external students (no student number and login with Google accounts)all
: internal and external students
order
: (optional/a+) the order number of the exercisemodel_answer
exercise_template
exercise_info
url
: (optional*/a+) where to find the exercise/chapter, optional for chaptersuse_wide_column
: (optional/a+) true to loose third columndescription
: (optional/a+) exercise descriptiontype
: (optional/a+) a key name in 'exercise_types'children
: (optional/a+) list recursion- Extended with of these:
- Chapter:
static_content
: a localized path to the static content directorygenerate_table_of_contents
: (optional/a+) whether to generate the table of contents
- Exercise:
config
: (optional) a path to exercise configuration. Must be either a json or a yaml file. See <grader_config>/ specification below.max_submissions
: (optional/a+)max_points
: (optional/a+)points_to_pass
: (optional/a+) limit to get passed marksmin_group_size
: (optional/a+)max_group_size
: (optional/a+)allow_assistant_viewing
: (optional/a+) true or falseallow_assistant_grading
: (optional/a+) true or falsegenerate_table_of_contents
: (optional/a+) show index of childrenconfigure
: external configuration settingsurl
: where to send the exercise configuration (optional). If missing, the service uses the default grader configured by the server admins.files
: what files to send. A dict of<name>: <path>
pairs. The file/directory at<path>
is sent to the url with the name<name>
.
- LTI exercise (extends Exercise):
lti
: the label used in A+ for the LTI servicelti_context_id
: LTI context idlti_resource_link_id
: LTI resource link idlti_aplus_get_and_post
: whether to perform GET and POST from A+ to custom service URL with LTI data appendedlti_open_in_iframe
: whether to open the exercise in an iframe
- Exercise collection:
target_category
: the category name of the collectiontarget_url
: URL of the course instancemax_points
: maximum points givenpoints_to_pass
: (optional/a+) points needed to pass
categories
: a dict where the key is the category key and value is a dictname
: name of the categorystatus
: (optional/a+) ready/hiddendescription
: (optional/a+)points_to_pass
: (optional/a+) limit to get passed marksconfirm_the_level
: (optional/a+) whether a user must have more than 0 points in this category before their other points in the same chpater/module become confirmedaccept_unofficial_submits
: (optional/a+) whether to allow more submissions after deadline/max submission count is exceeded. The points given in those cases will not officially count.
module_types
,exercise_types
: keyed maps of default valuesnumerate_ignoring_modules
: (optional/a+) true to numerate I:1...n, II:n+1...m
- The directory name acts as a course key, which is used in
This file must end in .json
or .yaml
, and be in the respective format.
<config path>
may omit the filename extension.
- The file name acts as an exercise key, which is used in
- URLs:
/course_key/exercise_key
- Must match the exercise list in
index.[json|yaml]
- URLs:
- May override the following fields from the exercise config specified in index.json/yaml:
name
,title
description
url
exercise_info
model_answer
exercise_template
include
(optional): Include configuration files rendered from templates.file
: A path to an exercise configuration file. May contain optional Django template syntax, which allows passing of parameters with thetemplate_context
key.force
(optional): Defaults to false. If true, all keys and their contents in the file where theinclude
key is located will be overwritten with the corresponding keys and contents from the file which is being included. If false, a ConfigError is thrown if the include file contains keys which already exist in the file where the keys are being included.template_context
(optional): Context dictionary containing key value pairs for rendering the included file.
instructions_file
(optional) (DEPRECATED): A path to a file that will be automatically added to the configuration files list. If the path starts with./
, it will be prepended with the course key. DEPRECATION: Sometime in the future, this file will not be added automatically.model_files
(optional): It is a list of model answers that are available only after the deadline has passed. Possibly overridesmodel_answer
, see Precedence below. Themodel_files
take file paths as input. These paths are relative to the root of the course repository, e.g.,exercises/hello_world/model.py
.template_files
(optional): List of template files for the student (e.g., base code or skeleton code that the student starts to modify). Possibly overridesexercise_template
, see Precedence below. A+ shows the templates in the exercise navigation bar. Give a list of file paths as the value. The file paths start from the root of the course repository, e.g.,exercises/hello_world/submission.py
.- Any additional fields needed by the grading service
The precedence order for model_answer
and exercise_template
is as follows:
model_answer
/exercise_template
in course_key/exercise_key.[json|yaml]model_files
/template_files
in course_key/exercise_key.[json|yaml]model_answer
/exercise_template
in course_key/index.[json|yaml]