src/app/config/test-mode.ts
Properties |
Public
constructor(loginMode: string)
|
||||||
Defined in src/app/config/test-mode.ts:17
|
||||||
Parameters :
|
canReview |
Defined in src/app/config/test-mode.ts:8
|
forceNaviRestrictions |
Defined in src/app/config/test-mode.ts:11
|
forceTimeRestrictions |
Defined in src/app/config/test-mode.ts:10
|
modeId |
Type : string
|
Default value : "DEMO"
|
Defined in src/app/config/test-mode.ts:17
|
modeLabel |
Defined in src/app/config/test-mode.ts:16
|
presetCode |
Defined in src/app/config/test-mode.ts:12
|
receiveRemoteCommands |
Defined in src/app/config/test-mode.ts:15
|
saveResponses |
Defined in src/app/config/test-mode.ts:9
|
showTimeLeft |
Defined in src/app/config/test-mode.ts:13
|
showUnitMenu |
Defined in src/app/config/test-mode.ts:14
|
For the test or the survey, all execution parameters are given by the XML definition files. But before the test starts in production (hot) mode, there is the need to evaluate the test content and configuration. Then, some restrictions of the test may make it really hard to evaluate. For example, it would take too much time if you have to wait for the completion of all audio sequences. One could adapt the test definition for the evaluation period, but this is dangerous: After evaluation, you will change the test definition again and then risk new errors.
Our system allows multiple modes to run the test. Every login carries a token that declares this mode. You can first review only the design of the units and its arrangement, then switch on some restrictions and store responses, and finally evaluate the test like a testtaker.
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;
receiveRemoteCommands: false;
modeLabel: "Nur Ansicht (Demo)";
modeId: string = "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.receiveRemoteCommands = modeConfig.config.receiveRemoteCommands;
this.modeLabel = modeConfig.label;
this.modeId = mode;
} else {
console.error('TestConfig: invalid loginMode - take DEMO');
}
} else {
console.error('TestConfig: empty loginMode - take DEMO');
}
}
}