我们正在尝试在movilizer中创建一个大菜单来支持我们所有的选项,同时这样做我们使用网格复杂的UI来支持更大的设备。
因为我们使用复杂的网格UI,所以我们目前在复杂的网格中有3个菜单和2个文本字段。但是,我们无法使用菜单分支到按下这些菜单中的按钮后调用的不同movelet。
<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>
我们代码中的这个示例摘录会抛出错误,说Q003不允许分支,但是我们需要这些单独的菜单。
有没有办法绕过这个问题而不必为每个菜单创建不同的movelet?
提前致谢!
答案 0 :(得分:0)
您只能使用MEL脚本实现此目的。 基本理念是:
这可以看起来像这样(简化),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>
和QEPS(进行分支,非常简化):
<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>