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

Fix variable infos for likert and likert row

parent 48e91be3
No related branches found
Tags editor/2.3.0+player/2.3.0
No related merge requests found
......@@ -8,7 +8,11 @@ import {
} from 'common/components/compound-elements/likert/likert-radio-button-group.component';
import { environment } from 'common/environment';
import { VariableInfo, VariableValue } from '@iqb/responses';
import { AbstractIDService, InputElementProperties, TextImageLabel, UIElementType } from 'common/interfaces';
import {
AbstractIDService,
InputElementProperties,
TextImageLabel, UIElementType
} from 'common/interfaces';
import { InstantiationEror } from 'common/errors';
export class LikertRowElement extends InputElement implements LikertRowProperties {
......@@ -41,6 +45,11 @@ export class LikertRowElement extends InputElement implements LikertRowPropertie
}
}
// eslint-disable-next-line class-methods-use-this
getVariableInfos(options?: unknown): VariableInfo[] {
return [];
}
getVariableInfoOfRow(options: TextImageLabel[]): VariableInfo {
return {
id: this.id,
......
......@@ -13,7 +13,7 @@ import { VariableInfo } from '@iqb/responses';
import {
AbstractIDService,
OptionElement,
PositionedUIElement, TextImageLabel,
TextImageLabel,
UIElementProperties,
UIElementType,
UIElementValue
......@@ -123,11 +123,13 @@ export class LikertElement extends CompoundElement implements OptionElement, Lik
}
getVariableInfos(): VariableInfo[] {
return this.rows.map(row => row.getVariableInfoOfRow(this.options));
return [...super.getVariableInfos(), ...this.rows.map(row => row.getVariableInfoOfRow(this.options))];
}
getBlueprint(): LikertElement {
return { ...this, rows: this.rows.map(el => el.getBlueprint()), id: undefined, alias: undefined };
return {
...this, rows: this.rows.map(el => el.getBlueprint()), id: undefined, alias: undefined
};
}
}
......
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