File

src/app/config/booklet-config.ts

Index

Properties
Methods

Properties

force_presentation_complete
Type : "OFF" | "ON"
Default value : "OFF"
force_responses_complete
Type : "OFF" | "SOME" | "COMPLETE" | "COMPLETE_AND_VALID"
Default value : "OFF"
loading_mode
Type : "LAZY" | "EAGER"
Default value : "LAZY"
logPolicy
Type : "disabled" | "lean" | "rich" | "debug"
Default value : "rich"
page_navibuttons
Type : "OFF" | "MERGED" | "SEPARATE_TOP" | "SEPARATE_BOTTOM"
Default value : "SEPARATE_BOTTOM"
pagingMode
Type : "separate" | "concat-scroll" | "concat-scroll-snap"
Default value : "separate"
stateReportPolicy
Type : "none" | "eager" | "on-demand"
Default value : "eager"
unit_menu
Type : "OFF" | "ENABLED_ONLY" | "FULL"
Default value : "OFF"
unit_navibuttons
Type : "OFF" | "ARROWS_ONLY" | "FULL"
Default value : "FULL"
unit_screenheader
Type : "OFF" | "WITH_UNIT_TITLE" | "WITH_BOOKLET_TITLE" | "EMPTY"
Default value : "EMPTY"
unit_show_time_left
Type : "OFF" | "ON"
Default value : "OFF"
unit_title
Type : "OFF" | "ON"
Default value : "ON"

Methods

Public setFromKeyValuePairs
setFromKeyValuePairs(config)
Parameters :
Name Optional
config No
Returns : void
Public setFromXml
setFromXml(bookletConfigElement: Element)
Parameters :
Name Type Optional
bookletConfigElement Element No
Returns : void

Booklet config

There are some configuration parameters for adjusting the behaviour during the test.This document describes the ways to bring the parameters to the application and lists all possible keys.

Configuration file on the server

There is one file on the server where the application looks for booklet definitions:

/config/bookletDefintions.json

This configuration is loaded at (re)start of the application and is applied for all booklets, if no other configuration is found. This is a simple JSON file with key value pairs. Example:

{
    "force_responses_complete": "OFF",
    "unit_navibuttons": "ARROWS_ONLY",
...
}

The adminstrator of the server can upload this file. We aim at providing an administration feature of the super-admin section of the application to manage this configuration.

Configuration via booklet XML

The configuration can be set for every single booklet. You need to add one XML-Element into the booklet-file. Example:

...
</Metadata>
<BookletConfig>
    <Config key="force_responses_complete">OFF</CustomText>
    <Config key="unit_navibuttons">ARROWS_ONLY</CustomText>
...
</BookletConfig>

List of parameters

export class BookletConfig {
	// this file is generated by 'generateBookletConfigClass' script from 'app/config/booklet-config.json'
	// do not change anything here directly!

	loading_mode: "LAZY" | "EAGER" = "LAZY";
	logPolicy: "disabled" | "lean" | "rich" | "debug" = "rich";
	pagingMode: "separate" | "concat-scroll" | "concat-scroll-snap" = "separate";
	stateReportPolicy: "none" | "eager" | "on-demand" = "eager";
	page_navibuttons: "OFF" | "MERGED" | "SEPARATE_TOP" | "SEPARATE_BOTTOM" = "SEPARATE_BOTTOM";
	unit_navibuttons: "OFF" | "ARROWS_ONLY" | "FULL" = "FULL";
	unit_menu: "OFF" | "ENABLED_ONLY" | "FULL" = "OFF";
	force_presentation_complete: "OFF" | "ON" = "OFF";
	force_responses_complete: "OFF" | "SOME" | "COMPLETE" | "COMPLETE_AND_VALID" = "OFF";
	unit_screenheader: "OFF" | "WITH_UNIT_TITLE" | "WITH_BOOKLET_TITLE" | "EMPTY" = "EMPTY";
	unit_title: "OFF" | "ON" = "ON";
	unit_show_time_left: "OFF" | "ON" = "OFF";

	public setFromKeyValuePairs(config) {
		if (config) {
			if (config['loading_mode']) { this.loading_mode = config['loading_mode']}
			if (config['logPolicy']) { this.logPolicy = config['logPolicy']}
			if (config['pagingMode']) { this.pagingMode = config['pagingMode']}
			if (config['stateReportPolicy']) { this.stateReportPolicy = config['stateReportPolicy']}
			if (config['page_navibuttons']) { this.page_navibuttons = config['page_navibuttons']}
			if (config['unit_navibuttons']) { this.unit_navibuttons = config['unit_navibuttons']}
			if (config['unit_menu']) { this.unit_menu = config['unit_menu']}
			if (config['force_presentation_complete']) { this.force_presentation_complete = config['force_presentation_complete']}
			if (config['force_responses_complete']) { this.force_responses_complete = config['force_responses_complete']}
			if (config['unit_screenheader']) { this.unit_screenheader = config['unit_screenheader']}
			if (config['unit_title']) { this.unit_title = config['unit_title']}
			if (config['unit_show_time_left']) { this.unit_show_time_left = config['unit_show_time_left']}
		}
	}

	public setFromXml(bookletConfigElement: Element) {
		if (bookletConfigElement) {
			const bookletConfigs = Array.prototype.slice.call(bookletConfigElement.childNodes).filter(function (e) { return e.nodeType === 1; });
			for (let childIndex = 0; childIndex < bookletConfigs.length; childIndex++) {
				const configKey = bookletConfigs[childIndex].getAttribute('key');
				const configValue = bookletConfigs[childIndex].textContent;
				switch (configKey) {
					case 'loading_mode':
						this.loading_mode = configValue;
						break;
					case 'logPolicy':
						this.logPolicy = configValue;
						break;
					case 'pagingMode':
						this.pagingMode = configValue;
						break;
					case 'stateReportPolicy':
						this.stateReportPolicy = configValue;
						break;
					case 'page_navibuttons':
						this.page_navibuttons = configValue;
						break;
					case 'unit_navibuttons':
						this.unit_navibuttons = configValue;
						break;
					case 'unit_menu':
						this.unit_menu = configValue;
						break;
					case 'force_presentation_complete':
						this.force_presentation_complete = configValue;
						break;
					case 'force_responses_complete':
						this.force_responses_complete = configValue;
						break;
					case 'unit_screenheader':
						this.unit_screenheader = configValue;
						break;
					case 'unit_title':
						this.unit_title = configValue;
						break;
					case 'unit_show_time_left':
						this.unit_show_time_left = configValue;
						break;
				}
			}
		}
	}
}

result-matching ""

    No results matching ""