計算題:修订间差异

来自MoodleDocs
跳转至:导航、​搜索
无编辑摘要
无编辑摘要
第37行: 第37行:
#接下來新增'''正確答案公式'''這個公式必須含有試題內容中一個以上的通配符,見[[計算題#正確答案公式語法|正確答案公式語法]]有更進一步的資料。
#接下來新增'''正確答案公式'''這個公式必須含有試題內容中一個以上的通配符,見[[計算題#正確答案公式語法|正確答案公式語法]]有更進一步的資料。
# 選擇'''成績'''這個成績是學生針對該試題所給的答案得到的,這應該是題目得分的一個百分比,例如,你可以給正確答案100%,而接近正確答案則給50%,'''答案中有一個必須是100%分'''。
# 選擇'''成績'''這個成績是學生針對該試題所給的答案得到的,這應該是題目得分的一個百分比,例如,你可以給正確答案100%,而接近正確答案則給50%,'''答案中有一個必須是100%分'''。
#決定你可以接受答案錯誤的'''容許誤差''',這個容許誤差及誤差類型設定 for error that you will accept in the answer. The tolerance and tolerance type settings combine to give a range of acceptable scores. So, if tolerance = t, correct answer = x and the difference between the user's answer and the correct answer is dx, then the tolerance types are as follows:
#決定你可以接受答案錯誤的'''容許誤差''',這個容許誤差及誤差類型設定 可以提供一個可接受分數的範圍,所以假如容許誤差 = t ,正確答案 = x 且使用者的答案跟正確答案的差為dx,那麼誤差類型如下:
##Nominal - mark correct if dx <= t
## 額定誤差 - 假如 dx <= t 就是正確的
##Relative - mark correct if dx / x <= t
## 相對誤差 - 假如 dx / x <= t 就是正確的
##Geometric - mark correct if dx² / x² <= t²
## 幾何誤差 - 假如 dx² / x² <= t² 就是正確的
# The next 2 settings, "Correct answer shows" and "Format" determine the '''precision''' of the answer. Use these to select the number of decimal places or significant figures you want to use.
# 接下來兩個設定," 顯示正確的答案" " 格式" 決定答案的''' 精度''' ,使用這些來選擇你想要使用的小數位數或顯著數字的數字。
# Add some '''feedback''' which the student will see if they enter this answer.
# 新增一些''' 回饋''' 在學生輸入答案時可以看到。
# You can specify as many answer formulae as you like - click "Add another answer blank" to add more.
# 你可以指定許多你喜歡的正確答案公式 - 點擊" 新增另一個答案空格" 來新增。
# You can also specify units for the answers. For example, if you enter a unit of 'cm' here, and the accepted answer is 15, then the answers '15cm' and '15' are both accepted as correct. If you add more than one unit, you can also specify a multiplier. So, if your main answer was 5500 with unit W, you can also add the unit kW with a multiplier of 0.001. This means that the answers '5500', '5500W' or '5.5kW' would all be marked correct. Note that the accepted error is also multiplied, so an allowed error of 100W would become an error of 0.1kW.
# 你也可以指定答案的單位,例如,假如你在這裡輸入'cm' 單位,接受的答案是15,那麼答案是'15cm' '15' 都是正確的答案,假如你要新增一個以上的單位,你也可以用倍數的方式指定,所以,假如你的主要答案是5500,單位W,你也可以新增單位kW其倍數是0.001 ,這表示答案'5500' '5500W' '5.5kW' 都是正確的,注意接受的錯誤也是倍數的,所以允許100W的錯誤會變成0.1kW 的錯誤。
# Finally (!) you can click "Next page" to save what you've done and move on. If you are editing an existing question, you can click "Next page (new question)" to create a completely new question based on an existing one.
# 最後(!) 你可以點擊" 下一頁" 來儲存你所作及繼續前進,假如擬是編輯原有試題,你可以點擊 " 下一頁( 新的問題)" 來根據現有的試題新增一個全新的試題。


==== Penalty factor ====
==== 倒扣條件 ====


The 'penalty factor' only applies when the question is used in a quiz using adaptive mode - i.e. where the student is allowed multiple attempts at a question even within the same attempt at the quiz. If the penalty factor is more than 0, then the student will lose that proportion of the '''maximum''' grade upon each successive attempt. For example, if the default question grade is 10, and the penalty factor is 0.2, then each successive attempt after the first one will incur a penalty of 0.2 x 10 = 2 points.
' 倒扣條件' 只用在試題用在測驗卷使用適性模式時 - 例如,學生允許在測驗時試很多次即使是同樣的測試,假如倒扣條件大於0,那麼學生在成功的嘗試後將會失去''' 最高分的''' 機會,舉一個例假如預設的分數是10,倒扣條件是0.2 ,那麼在第一次嘗試後才成功的話將會發生倒扣0.2 x 10 = 2 分。


===Page 2. Choose dataset properties ===
=== 第二頁. 選擇資料集屬性 ===


Each wildcard that you specify in the answer formula must have an associated set of possible values - this is its ''dataset''. Each of the wildcards is listed on this page along with a choice of dataset:
每一個在答案正確公式裡的通配符必須有一個相關可能的值域 - 這就是'' 資料集'' ,列在這一頁的每個通配符有一個資料集的選擇:
*'''private''' i.e. only used by this question
*''' 私用的''' 例如只使用在這個試題
*'''shared''' i.e shared with other calculated questions in the same category
*''' 共享的''' 例如在相同類別裡共享其他的計算題


Using a shared dataset can save time when you are creating a lot of similar calculated questions.
使用共享的資料集可以節省時間在你要新增很多類似的計算題時。


If there is anything in the question text that looks like a wildcard, but does not appear in any of the answer formulae, you can specify whether or not this is meant to be a wildcard. If it is, you can choose whether it should use a private or shared dataset.
假如在是堤內榮中有任何像是通配符的東西,但是卻沒有出現在答案公式裡頭,你可以指定這是否是通配符,假如是你可以選擇要作為私用的或共享的資料集。


To continue, simply choose your preferred dataset for each wildcard, then click "Next Page".
要繼續,針對每個通配符選擇你喜歡的資料集,然後點擊" 下一頁"


===Page 3. Edit the datasets ===
===Page 3. Edit the datasets ===

2009年3月10日 (二) 01:59的版本


计算题提供了一种建立个别数字题的方法,题目里使用通配符(例如 {x} , {y})答题时通配符会被乱数替换。

举一个例,如果你想要建立很多"矩形面积的计算"问题给你的学生练习,你可以建立有两个通配符的试题(例如{base}, {height})然后放在"正确答案公式="的输入字段{base} * {height} ( * 是乘法的符号)。

正確答案公式= {base}*{height}


当学生作答时,Moodle会随机选取{base}{height}的值然后使用 正确答案公式来评分。

这个测验很难同时出现两次一样的题目。

这真的是你要的题型吗?

计算题的主要目的是建立有很多数值的试题版本,这个意思是你必须在答案中有一个以上的通配符。

假如你不需要乱数值,使用数字题型来取代。

通配符及资料集

当Moodle传送一个计算题给学生,通配符会被随机选择的值所取代,然而这些值不总是随机的- 他们是从已经预先定义好可能数值的资料集中随机选出的,这样可以允许你控制一些所选择的可能值 - 举个例来说,这是为了确定这些数字是实际的。

这些资料集可以是私用的共享的 - 私用的资料集在一个计算题被一个通配符所使用;共享的资料集是所有的计算题都可以共用这个通配符。

试题设定

要新增(或编辑)计算题有三页要处理,下面的操作会带你一步一步地操作这些页面:

第一页.编辑计算题

  1. 选取试题类别
  2. 这个类别中共享的通配符会列在下面。假如你改变类别,你需要点击"更新题库"按钮来更新这个列表,有可能没有共享的通配符 - 假如没有你可以稍后依照你自己的意愿来新增。
  3. 给定试题描述的名称 - 这个可以允许你在题库中办认。
  4. 输入试题内容,这应该是你想要学生回答的试题,而且必须包含所有要计算答案的资讯,因此他必须含有至少一个通配符在大括弧内,例如,假如你想要学生计算A加B,这个试题内容很可能是这样:"{A} + {B}=多少?"
  5. 假如你乡要新增一个试题的图片就选择一个图片来显示,对学生来说,图片会显示在试题内容后答案前,假如你想要控制图片如何显示,就把他放在试题内容中用HTML编辑器处理。
  6. 设定预设题目得分 (例如,这个试题的最高分)。
  7. 设定倒扣条件 (见下面的倒扣条件)。
  8. Moodle 1.7+: 假如你愿意,新增一般的回馈,这是显示给学生回答后所要显示的文字。
  9. 接下来新增正确答案公式这个公式必须含有试题内容中一个以上的通配符,见正确答案公式语法有更进一步的资料。
  10. 选择成绩这个成绩是学生针对该试题所给的答案得到的,这应该是题目得分的一个百分比,例如,你可以给正确答案100%,而接近正确答案则给50%,答案中有一个必须是100%分
  11. 决定你可以接受答案错误的容许误差,这个容许误差及误差类型设定可以提供一个可接受分数的范围,所以假如容许误差 = t,正确答案 = x 且用户的答案跟正确答案的差为dx,那么误差类型如下:
    1. 额定误差 - 假如 dx <= t 就是正确的
    2. 相对误差 - 假如 dx / x <= t 就是正确的
    3. 几何误差 - 假如 dx² / x² <= t²就是正确的
  12. 接下来两个设定,"显示正确的答案"及"格式"决定答案的精度,使用这些来选择你想要使用的小数位数或显著数字的数字。
  13. 新增一些回馈在学生输入答案时可以看到。
  14. 你可以指定许多你喜欢的正确答案公式 - 点击"新增另一个答案空格"来新增。
  15. 你也可以指定答案的单位,例如,假如你在这里输入'cm'单位,接受的答案是15,那么答案是'15cm'及'15'都是正确的答案,假如你要新增一个以上的单位,你也可以用倍数的方式指定,所以,假如你的主要答案是5500,单位W,你也可以新增单位kW其倍数是0.001,这表示答案'5500'、'5500W'或'5.5kW'都是正确的,注意接受的错误也是倍数的,所以允许100W的错误会变成0.1kW的错误。
  16. 最后(!)你可以点击"下一页"来储存你所作及继续前进,假如拟是编辑原有试题,你可以点击 "下一页(新的问题)"来根据现有的试题新增一个全新的试题。

倒扣条件

'倒扣条件'只用在试题用在测验卷使用适性模式时 - 例如,学生允许在测验时试很多次即使是同样的测试,假如倒扣条件大于0,那么学生在成功的尝试后将会失去最高分的机会,举一个例假如预设的分数是10,倒扣条件是0.2,那么在第一次尝试后才成功的话将会发生倒扣0.2 x 10 = 2分。

第二页.选择资料集属性

每一个在答案正确公式里的通配符必须有一个相关可能的值域 - 这就是资料集,列在这一页的每个通配符有一个资料集的选择:

  • 私用的 例如只使用在这个试题
  • 共享的例如在相同类别里共享其他的计算题

使用共享的资料集可以节省时间在你要新增很多类似的计算题时。

假如在是堤内荣中有任何像是通配符的东西,但是却没有出现在答案公式里头,你可以指定这是否是通配符,假如是你可以选择要作为私用的或共享的资料集。

要继续,针对每个通配符选择你喜欢的资料集,然后点击"下一页"。

Page 3. Edit the datasets

Now we need to create the set of possible values that each wildcard can take. Warning - this page is a bit confusing!

There are two ways of creating values - you can type them in yourself and add them to the list, or you can have Moodle generate them for you.

Adding/deleting your own values

Adding individual values to the list is easy:

  1. In the 'Param' field for each wildcard, enter the value you want
  2. Scroll down to the 'Add' section and click the Add button (leaving the number of items set to 1)
  3. Repeat the above steps as many times as necessary (the maximum number of items is 100)

To delete values from the list:

  1. In the 'Delete' section, select the number of items to delete
  2. Click the Delete button

Letting Moodle create values

  1. Start with the "Range of Values" fields, and enter the lower and upper limits for the values you would accept
  2. Choose a number of decimal places for the value
  3. Choose the distribution of values between the limits - 'uniform' means any value between the limits is equally likely to be generated; 'loguniform' means that values towards the lower limit are more likely.
  4. Now move down to the 'Add' section and click on "force regeneration"
  5. In the menu next to the Add button, choose the number of sets of random values (items) you wish to add to the list. (Note that the maximum total number of items in your list is 100.)
  6. Finally, click Add to append the new values to the list
  7. Note: If you want more control over the items that Moodle adds, you can do them one at a time and preview the values before you add them. Click the "Get New Item to Add" button to make Moodle generate new values in the "Item to Add" section at the top. If you like them, click "Add" for 1 item; if not, click "Get New Item to Add" again to get new values.

Finishing off

Once your list of items (values) is complete, you are finished. It's up to you how many values you add - the more values you add, the more a question can be used by the students without them seeing the same values repeatedly.

Note that if you delete values from the list, you can put them back again. Change the "Next Item to Add" option to "reuse previous value if available", then the next time you add items, Moodle will restore your previously-deleted items from the dataset.

Once your list of values is complete, you can click 'Save changes' to finish.

What does the 'Update the datasets parameters' button do?

As far as I can tell, it has the same function as the "Get New Item to Add" button, i.e. it generates a new set of values and displays them in the "Item to Add" section. However, it is less conveniently placed that that button, so it is probably best ignored.

Correct answer formula syntax

DO NOT PUT THE = sign in the formula.

  • In the recent versions of the calculated question type, you could have more than one answer formula and applied a specific grading value to each of them as long as there is at least one 100% correct answer formula.
If more than one correct answer formula input field are displayed when editing, 
your site has the multiple answer feature. 


  • As a general rule, write these formulas like you would in a calculator e.g. 3 + 5 * sin(3/{x}) A notable exception is exponentiation, where x3 cannot be entered as {x}^3, but instead should be entered as pow(x, 3).
  • Each function's placeholders and other arguments should be in parentheses (brackets). For example, if you want students to calculate the sine of one angle and two times cosine of another, you would enter sin({a}) + cos({b}*2).
  • It's usually better to have too many parentheses (brackets) than too few. The server won't care, and the more specific you are about what you mean, the more likely it will like your complex formulas.
  • There is no implicit multiplication. To you, the human editor, "5(23)" or "5x" may seem perfectly obvious. To the server doing the math, it's crazy talk and won't be understood. Always use the "*" for multiplication.
  • Any special mathematical function must have parentheses around its values. Take the sine function in the first bullet point for instance. Notice that the 3 / x is wrapped in parentheses (brackets)--this is so the server can understand it properly. Without those parentheses, the server won't know if you mean "(sin 3) / x" or "sin (3 / x)" and will reject the entire formula accordingly.

Available functions

Calculated questions can use more than simple arithmetic operators. The following functions are allowed in versions 1.5 and newer.

Function Explanation
abs Absolute value
acos Arc cosine -- in radians!!! Convert your degree measurement to radians before you take the acos of it.
acosh Inverse hyperbolic cosine -- in radians!!! Convert your degree measurement to radians before you take the acosh of it.
asin Arc sine -- in radians!!! Convert your degree measurement to radians before you take the asin of it.
asinh Inverse hyperbolic sine -- in radians!!! Convert your degree measurement to radians before you take the asing of it.
atan2 Arc tangent of two variables -- pass in two values like (x, y), and you'll get the atah(y/x), adjusted to the proper quadrant.
atan Arc tangent -- in radians!!! Convert your degree measurement to radians before you take the atan of it.
atanh Inverse hyperbolic tangent
bindec Binary to decimal
ceil Round fractions up
cos Cosine -- in radians!!! Convert your degree measurement to radians before you take the cos of it.
cosh Hyperbolic cosine -- in radians!!! Convert your degree measurement to radians before you take the cosh of it.
decbin Decimal to binary
decoct Decimal to octal
deg2rad Converts the number in degrees to the radian equivalent
exp Calculates the exponent of e
expm1 Returns exp(number) - 1, computed in a way that is accurate even when the value of number is close to zero
floor Round fractions down
fmod Returns the floating-point modulus of two numbers - i.e. the remainder when the first is divided by the second.
is_finite Finds whether a value is a legal finite number
is_infinite Finds whether a value is infinite
is_nan Finds whether a value is not a number
log10 Base-10 logarithm
log1p Returns log(1 + number), computed in a way that is accurate even when the value of number is close to zero
log Natural logarithm (ln)
max Find highest value
min Find lowest value
octdec Octal to decimal
pi Get value of pi
pow (numberToRaise, NumberRaisedTo) Exponential expression
rad2deg Converts the radian number to the equivalent number in degrees
rand Generate a random integer
round Rounds a float
sin Sine -- in radians!!! Convert your degree measurement to radians before you take the sin of it.
sinh Hyperbolic sine -- in radians!!! Convert your degree measurement to radians before you take the sinh of it.
sqrt Square root
tan Tangent -- in radians!!! Convert your degree measurement to radians before you take the tan of it.
tanh Hyperbolic tangent -- in radians!!! Convert your degree measurement to radians before you take the tanh of it.

Predefined constants

Actually there is NO Predefined constant that is allowed other than pi() as a function without parameter.