Skip to content
Snippets Groups Projects
Commit e876bc7f authored by paflov's avatar paflov
Browse files

fixes a bug which made tests in modes without saveReponses to write back some...

fixes a bug which made tests in modes without saveReponses to write back some data when test with saveReponses was opened before.

Explanation: The testmode comes later with getTestData and is set correctly in the RUNNING stage, while in LOADING stage it war still the testmode of the test before! So if we opened a test in TRIAL mode after running a test in HOT mode, the loading stage will be write back to backend. As a workaround, we reset to DEMO here, so while in loading stage `saveResponses` is always false.

As all tests of one login are always in the same mode, maybe it would be better to retrieve the testmode from the login instead by getTestData.
parent c828b7eb
No related branches found
No related tags found
No related merge requests found
......@@ -354,6 +354,11 @@ export class TestControllerComponent implements OnInit, OnDestroy {
this.routingSubscription = this.route.params.subscribe(params => {
if (this.tcs.testStatus$.getValue() !== TestControllerState.ERROR) {
this.tcs.testId = params.t;
// Reset TestMode to be Demo, before the correct one comes with getTestData
// TODO maybe it would be better to retrieve the testmode from the login
this.tcs.testMode = new TestMode();
localStorage.setItem(TestControllerComponent.localStorageTestKey, params.t);
this.unsubscribeTestSubscriptions();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment