动作物件
在制作带有程式功能的互动式学习单时,动作物件(Action Object)可能会派上用场。
动作物件有四种类型:
勾选框
勾选框为真假值的图像表征,可以使用 勾选框工具或 Checkbox_指令来建立。
输入字段
Input Boxes work as text inputs for scripts. The script is triggered by changing text in the Input Box and either pressing enter or leaving the Input Box. The inserted value may be accessed using the %0 variable.
a=a+%0
in script will increase number a by the entered value. Works only if a is free.If you want the Input Box to change value of a free object (or redefine dependent object), you may define that object as linked. This way you don't have to insert any script.
Input Boxes can be created using the Input Box Tool or the InputBox Command.
按钮
按钮(button)是为了通过点按动作来触发程式脚本。虽然透过点按其他物件(例如:一张图片)也能触发程式脚本,但使用按钮能让您的学习单更直观。
按钮可以使用 [[按钮_工具]按钮]工具或 Button_指令来建立。
下拉式选单
若您想要显示某个串列的内容,可以整合至下拉式选单(drop-down list):
- 在 绘图区中显示:开启串列的 属性对话窗,在一般分页勾选“显示为下拉式选单”。
- 在 试算表中显示:您可以在储存格中输入一个集合(如:A1={1,2,3,4}),然后打开 试算表选项,并勾选“使用按钮与勾选框”,这时储存格就会变为一个下拉式选单。备注: 请看以下的影片说明(没有录音):
如果在程式中要使用目前下拉式选单所选择的项目,可以使用 SelectedIndex 与 SelectedElement 两个指令。
x+1
、x^2
、sqrt(x)
的下拉式选单,首先在指令列输入 L={x+1, x^2,sqrt(x)}
建立一个串列。然后在代数区的串列按鼠标右键并点选属性。在跳出的对话窗中勾选“显示为下拉式选单”。您也可以帮下拉式选单加上标签文字。若要在绘图区画上目前选择的函数图形,可到指令列输入:SelectedElement(L)
。