Newer
Older
// @ts-ignore
import testModes from './test-modes.json';
// this file is generated by 'generateTestModeClass' script from 'app/config/test-modes.json' and 'app/config/mode-options.json'
// do not change anything here directly!
export class TestMode {
canReview: false;
saveResponses: false;
forceTimeRestrictions: false;
forceNaviRestrictions: false;
presetCode: true;
showTimeLeft: true;
showUnitMenu: false;
isMonitorable: false;
modeLabel: "Nur Ansicht (Demo)";
public constructor (loginMode: string = 'DEMO') {
if (loginMode) {
const regExPattern = /(DEMO|MONITOR-GROUP|HOT|REVIEW|TRIAL)/;
if (regExPattern.test(loginMode.toUpperCase())) {
const mode = loginMode.toUpperCase().match(regExPattern)[0];
const modeConfig = testModes[mode];
this.canReview = modeConfig.config.canReview;
this.saveResponses = modeConfig.config.saveResponses;
this.forceTimeRestrictions = modeConfig.config.forceTimeRestrictions;
this.forceNaviRestrictions = modeConfig.config.forceNaviRestrictions;
this.presetCode = modeConfig.config.presetCode;
this.showTimeLeft = modeConfig.config.showTimeLeft;
this.showUnitMenu = modeConfig.config.showUnitMenu;
this.isMonitorable = modeConfig.config.isMonitorable;
this.modeLabel = modeConfig.label;