@@ -57,7 +57,7 @@ export class QuestionValueGetterContext implements IValueGetterContext {
57
57
constructor ( protected question : Question , protected isUnwrapped ?: boolean ) { }
58
58
getValue ( path : Array < IValueGetterItem > , isRoot : boolean , index : number , createObjects : boolean ) : IValueGetterInfo {
59
59
const expVar = settings . expressionVariables ;
60
- if ( path . length === 0 || ( path . length === 1 && path [ 0 ] . name === expVar . question ) ) return this . getQuestionValue ( ) ;
60
+ if ( path . length === 0 || ( path . length === 1 && path [ 0 ] . name === expVar . question ) ) return this . getQuestionValue ( index ) ;
61
61
if ( path . length > 1 && path [ 0 ] . name === expVar . panel ) {
62
62
const panel : any = this . question . parent ;
63
63
if ( panel && panel . isPanel ) {
@@ -86,9 +86,13 @@ export class QuestionValueGetterContext implements IValueGetterContext {
86
86
if ( survey ) return ( < any > survey ) . getValueGetterContext ( ) . getValue ( path , false , index , false ) ;
87
87
return undefined ;
88
88
}
89
- private getQuestionValue ( ) : IValueGetterInfo {
89
+ private getQuestionValue ( index : number ) : IValueGetterInfo {
90
90
const q = this . question ;
91
- return { isFound : true , context : this , value : q . getFilteredValue ( this . isUnwrapped ) , requireStrictCompare : q . requireStrictCompare } ;
91
+ let val = q . getFilteredValue ( this . isUnwrapped ) ;
92
+ if ( index > - 1 && Array . isArray ( val ) ) {
93
+ val = index < val . length ? val [ index ] : undefined ;
94
+ }
95
+ return { isFound : true , context : this , value : val , requireStrictCompare : q . requireStrictCompare } ;
92
96
}
93
97
}
94
98
export abstract class QuestionItemValueGetterContext extends ValueGetterContextCore {
0 commit comments