Skip to content
Snippets Groups Projects
Commit e8dfc243 authored by jojohoch's avatar jojohoch
Browse files

[player] Improve the determination of responseProgress

- Do not check whether pages or sections are valid
- Check the entire form and if necessary the controls
parent 2f2f0903
No related branches found
No related tags found
No related merge requests found
...@@ -85,15 +85,9 @@ export class UnitStateComponent implements OnInit, OnDestroy { ...@@ -85,15 +85,9 @@ export class UnitStateComponent implements OnInit, OnDestroy {
const pagesControls: AbstractControl[] = (this.form.get('pages') as FormArray).controls; const pagesControls: AbstractControl[] = (this.form.get('pages') as FormArray).controls;
for (let i = 0; i < pagesControls.length; i++) { for (let i = 0; i < pagesControls.length; i++) {
const pageControl = pagesControls[i]; const pageControl = pagesControls[i];
if (pageControl.valid) {
return 'some';
}
const sectionControls = (pageControl.get('sections') as FormArray).controls; const sectionControls = (pageControl.get('sections') as FormArray).controls;
for (let ii = 0; ii < sectionControls.length; ii++) { for (let ii = 0; ii < sectionControls.length; ii++) {
const sectionControl = sectionControls[ii]; const sectionControl = sectionControls[ii];
if (sectionControl.valid) {
return 'some';
}
const elementControls = (sectionControl.get('elements') as FormArray).controls; const elementControls = (sectionControl.get('elements') as FormArray).controls;
for (let iii = 0; iii < elementControls.length; iii++) { for (let iii = 0; iii < elementControls.length; iii++) {
const elementControl = elementControls[iii]; const elementControl = elementControls[iii];
......
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