Reputation: 13
We are trying to create a large menu in movilizer to support all our options, while doing so we are using a grid complex UI to support larger devices.
Because we use the complex grid UI we currently have 3 menu's and 2 text fields in our complex grid. However we cannot use the menu to branch to different movelets that are called after pressing the buttons in those menu's.
<question key="Q003" type="6">
<answer attributeType="14"
key="A003_1"
nextQuestionKey="Q407"
<text>menu1button</text>
</answer>
<answer attributeType="72"
key="A003_5"
nextQuestionKey="Q004">
<predefinedValue>X</predefinedValue>
</answer>
<complex linearGroupId="Information" gridGroupId="gridMenu" gridHorizontalLayout="false" linearPos="1" gridPosX="0" gridPosY="1" groupTitle="menuGrid"/>
</question>
<question key="Q004" type="6">
<answer attributeType="14"
key="A004_1"
nextQuestionKey="Q408"
<text>menu2button</text>
</answer>
<answer attributeType="72"
key="A004_3"
nextQuestionKey="Q005">
<predefinedValue>X</predefinedValue>
</answer>
<complex linearGroupId="Information" gridGroupId="gridMenu" gridHorizontalLayout="false" linearPos="2" gridPosX="1" gridPosY="1" groupTitle="menuGrid"/>
</question>
This example excerpt from our code will throw an error saying branching is not allowed for question Q003, however we need these seperate menu's.
Is there any way to circumvent this problem without having to create different movelets for each menu?
Thanks in advance!
Upvotes: 1
Views: 80
Reputation: 608
you can only achieve this using MEL scripts. Basic idea is:
This can then look something like this (simplified), Q003:
<question key="Q003" type="6">
<answer key="A003_1"
nextQuestionKey="Q004">
<text>menu1button</text>
</answer>
<answer attributeType="72"
key="A003_DEFAULT"
nextQuestionKey="Q004">
<predefinedValue>X</predefinedValue>
</answer>
<onEnterAssignment>
$local:selections = null;
</onEnterAssignment>
<onLeaveOkPersistAssignment>
$local:selections["Q003"] = getQuestionKey();
</onLeaveOkPersistAssignment>
<complex linearGroupId="Information" gridGroupId="gridMenu" gridHorizontalLayout="false" linearPos="1" gridPosX="0" gridPosY="1" groupTitle="menuGrid"/>
</question>
Q004:
<question key="Q004" type="6">
<answer key="A004_1"
nextQuestionKey="QEPS">
<text>menu2button</text>
</answer>
<answer attributeType="72"
key="A004_DEFAULT"
nextQuestionKey="QEPS">
<predefinedValue>X</predefinedValue>
</answer>
<onLeaveOkPersistAssignment>
$local:selections["Q004"] = getQuestionKey();
</onLeaveOkPersistAssignment>
<complex linearGroupId="Information" gridGroupId="gridMenu" gridHorizontalLayout="false" linearPos="2" gridPosX="1" gridPosY="1" groupTitle="menuGrid"/>
</question>
And QEPS (which does the branching, very simplified):
<question key="QEPS" type="41">
<answer key="AEPS_1"
nextQuestionKey="END"/>
<restriction position="0" nextQuestionKey="Q003">
<condition>$local:selections["Q003"] != $answer:"A003_DEFAULT" ?OR $local:selections["Q004"] != $answer:"A004_DEFAULT"</condition>
</restriction>
</question>
Upvotes: 0