{% Dim instanceId = CurrentADC.InstanceId Dim inputName = CurrentQuestion.InputName() Dim inputValue = CurrentQuestion.InputValue() Dim caption Dim image Dim index Dim isHeader Dim columnCounter Dim i Dim j Dim k Dim flowDirection Dim ar = CurrentQuestion.AvailableResponses Dim otherIDarray As NumberArray Dim arrOpenValues As StringArray Dim arrOpenNames As StringArray Dim otherID For i = 1 to ar.Count If (ar[i].isOpen = True) Then arrOpenValues.Push(ar[i].OpenQuestion.InputValue()) arrOpenNames.Push(ar[i].OpenQuestion.InputName()) otherIDarray.Push(ar[i].Index) Endif Next i %} {% Dim splitcapsArr Dim arialabel Dim numberOfColumns = CurrentADC.PropValue("columns").ToNumber() Dim flow = CurrentADC.PropValue("columnsFlow") Dim showHeader =CurrentADC.PropValue("showHeaders") ="1" Dim expandableHeaders = CurrentADC.PropValue("expandableHeaders") ="1" Dim accordionInitialState = CurrentADC.PropValue("accordionInitialState") Dim nbColumns = numberOfColumns IF (numberOfColumns > 0) Then columnCounter = numberOfColumns For i = 1 To ar.Count If (flow = "vertical") Then flowDirection = (((1 + (Int((i - 1) / nbColumns))) + ((Int(ar.Count / nbColumns)) * ((i - 1) mod nbColumns))) * (1 - (Int(i / ((ar.Count + 1) - (ar.Count mod nbColumns)))))) + ((Int(i / ((ar.Count + 1) - (ar.Count mod nbColumns)))) * i) Else flowDirection = i EndIf inputValue = ar[flowDirection].InputValue() image = ar.ResourceURL[flowDirection] index = ar[flowDirection].index isHeader = ar[flowDirection].isHeader splitcapsArr = ar[flowDirection].Caption.Split("|") IF splitcapsArr.Count > 1 THEN caption = splitcapsArr[1] ariaLabel = splitcapsArr[2] ELSE caption = splitcapsArr[1] ariaLabel = splitcapsArr[1] ENDIF if ( (columnCounter mod numberOfColumns) = 0 ) Then %}
{% EndIf %} {% If ((isHeader = False) or (showHeader = True)) Then %} {% If (isHeader = true) Then %}
{% Else %}
{% EndIF %} {% IF (image <> "") Then %} {%= caption %} {% EndIF %} {%:= caption %}
{% For k = 1 To otherIDarray.Count otherID = otherIDarray[k].ToNumber() IF index = otherID Then %}
{% EndIF %} {% Next %}
{% EndIF %} {% columnCounter = columnCounter - 1 IF ((columnCounter < 1) or (i = ar.Count)) Then %}
{% columnCounter = numberOfColumns EndIF Next Else For j = 1 To ar.Count inputValue = ar[j].InputValue() caption = ar[j].Caption image = ar.ResourceURL[j] index = ar[j].index isHeader = ar[j].isHeader splitcapsArr = ar[j].Caption.Split("|") IF splitcapsArr.Count > 1 THEN caption = splitcapsArr[1] ariaLabel = splitcapsArr[2] ELSE caption = splitcapsArr[1] ariaLabel = splitcapsArr[1] ENDIF %} {% If ((isHeader = False) or (showHeader = True)) Then %} {% If (isHeader = true) Then%}
{% If (expandableHeaders = True) Then If (accordionInitialState = "expanded") Then %} {% Else %} {% EndIf %} {% EndIf %} {%:= caption %}
{% Dim m Dim chr chr = ar[j].Children For m = 1 To chr.Count splitcapsArr = chr[m].Caption.Split("|") IF splitcapsArr.Count > 1 THEN caption = splitcapsArr[1] ariaLabel = splitcapsArr[2] ELSE caption = splitcapsArr[1] ariaLabel = splitcapsArr[1] ENDIF %}
{% IF (chr.ResourceURL[m] <> "") Then %} {%:= caption %} {% EndIF %} {%:= caption %}
{% For k = 1 To otherIDarray.Count otherID = otherIDarray[k].ToNumber() IF (chr[m].index = otherID) Then %}
{% EndIF %} {% Next k %}
{% Next m %}
{% ElseIf ((isHeader = false) AND (ar[j].Parent.isHeader <> true)) Then %}
{% IF (image <> "") Then %} {%= caption %} {% EndIF %} {%:= caption %}
{% For k = 1 To otherIDarray.Count otherID = otherIDarray[k].ToNumber() IF (index = otherID) Then %}
{% EndIF %} {% Next %}
{% EndIF %} {% EndIF %} {% Next %}
{% EndIF %}