timApp.gamification package
Contents
timApp.gamification package#
Submodules#
timApp.gamification.gamificationdata module#
Collection of gamification functions.
- exception timApp.gamification.gamificationdata.GamificationException[source]#
Bases:
Exception
The exception that is thrown when an error occurs during a gamification check.
- timApp.gamification.gamificationdata.gamify(initial_data: timApp.document.yamlblock.YamlBlock)[source]#
- timApp.gamification.gamificationdata.get_demo_data(demo_paths, default_max)[source]#
Configure data of all demos.
- Parameters
demo_paths – Demo path dicts.
default_max – default maximum points.
- Returns
List of demo data dicts.
- timApp.gamification.gamificationdata.get_doc_data(gamify_data: timApp.document.yamlblock.YamlBlock)[source]#
Parses json to find and link appropriate data into lecture and demo documents.
:param gamify_data = Checked documents in JSON :returns: Arrays of lecture and demo documents
- timApp.gamification.gamificationdata.get_lecture_data(lecture_paths)[source]#
Configure data of all lecture documents.
- Parameters
lecture_paths – Lecture path dicts.
- Returns
List of lecture data dicts.
- timApp.gamification.gamificationdata.get_sorted_lists(items, item_name: str)[source]#
Fetches document list from a dictionary list and sorts it and the dictionary list. Checks also whether every path was founf from database and raises error accordingly.
- Parameters
items – Dictionary list with ‘path’ keys.
item_name – Name of the item type (demo, lecture, etc.).
- Returns
Documents and original items as lists sorted by paths.
timApp.gamification.generateMap module#
- timApp.gamification.generateMap.create_demo_layers(layers, layerid, points, maxpoints, mapwidth, properties)[source]#