From e8dfc24398bac3358e14784bc1f576fdba4362cf Mon Sep 17 00:00:00 2001
From: jojohoch <joachim.hoch@iqb.hu-berlin.de>
Date: Thu, 6 Jan 2022 15:51:21 +0100
Subject: [PATCH] [player] Improve the determination of responseProgress

- Do not check whether pages or sections are valid
- Check the entire form and if necessary the controls
---
 .../src/app/components/unit-state/unit-state.component.ts   | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/projects/player/src/app/components/unit-state/unit-state.component.ts b/projects/player/src/app/components/unit-state/unit-state.component.ts
index 299d3a67d..cc345c677 100644
--- a/projects/player/src/app/components/unit-state/unit-state.component.ts
+++ b/projects/player/src/app/components/unit-state/unit-state.component.ts
@@ -85,15 +85,9 @@ export class UnitStateComponent implements OnInit, OnDestroy {
     const pagesControls: AbstractControl[] = (this.form.get('pages') as FormArray).controls;
     for (let i = 0; i < pagesControls.length; i++) {
       const pageControl = pagesControls[i];
-      if (pageControl.valid) {
-        return 'some';
-      }
       const sectionControls = (pageControl.get('sections') as FormArray).controls;
       for (let ii = 0; ii < sectionControls.length; ii++) {
         const sectionControl = sectionControls[ii];
-        if (sectionControl.valid) {
-          return 'some';
-        }
         const elementControls = (sectionControl.get('elements') as FormArray).controls;
         for (let iii = 0; iii < elementControls.length; iii++) {
           const elementControl = elementControls[iii];
-- 
GitLab