All,
Thanks to Rich and Tyler for their helpful posts. I have implemented
the following code, but it seems to not work. I'm wondering if this
is a bug. I'm running mrStudio 4.5. The code below does not seem to
update the IOM.Properties["SectionNumber"].Value from "2" to "1" when
I use the previous button after viewing Q3.
Metadata(en-US, Question, Label)
Section1 "Section A"
info;
Section2 "Secction B"
info;
Q1 "This is my Q1 question text" text;
Q2 "What is your first name?"
text;
Q3 "What is your last name?"
text;
End Metadata
Routing(Web)
Dim SectionHeader[11], Label[11], i, SectionName[11]
'LIST ALL SECTION INFO QUESTIONS BELOW
set SectionHeader[1]=Section1
set SectionHeader[2]=Section2
set SectionHeader[3]=NULL
set SectionHeader[4]=NULL
set SectionHeader[5]=NULL
set SectionHeader[6]=NULL
set SectionHeader[7]=NULL
set SectionHeader[8]=NULL
set SectionHeader[9]=NULL
set SectionHeader[10]=NULL
Sub OnInterviewStart(IOM)
Dim Property
Set Property = IOM.Properties.CreateProperty()
Property.Name = "SectionNumber"
Property.Value = 1
IOM.Properties.Add(Property)
End Sub
Sub OnBeforeQuestionAsk(Question, IOM)
Dim i
For i=1 to 10
if IOM.Properties["SectionNumber"].Value=i then
IOM.Banners[..].Style.Color = "#E5E5E5"
IOM.Banners[..].Style.Font.Size=8
IOM.Banners[..].Style.Font.Family="Helvetica"
IOM.Banners[i-1].Style.Color = "#007D90"
End if
Next
End Sub
for i=1 to 10
if not SectionHeader[i].IsNullObject() then
if SectionHeader[i].Label <> "" then
SectionName[i]="SideBanner" + CTEXT(i)
End if
IOM.Banners.Add(SectionName[i], SectionHeader[i].label)
End if
Next
IOM.LayoutTemplate="Template_DefaultALT.htm"
Set IOM.Properties["SectionNumber"].Value=1
Q1.Ask()
Q2.Ask()
Set IOM.Properties["SectionNumber"].Value=2
Q3.Ask()
End Routing