計算問題タイプ

提供:MoodleDocs
移動先:案内検索



作成中です - Mitsuhiro Yoshida 2009年9月26日 (土) 15:02 (UTC)

計算問題では、小テスト受験時に、ワイルドカード (例 {x} , {y}) を使用することで、ランダム数値と置換される個々の数値問題の作成手段を提供します。

例えば、あなたの生徒に練習させるため、多数の「長方形の計算エリア」を持つ問題を作成したい場合、2つのワイルドカード (例 {base}, {height}) を持った問題を作成して、「正解の公式=」の入力フィールドに、{base} * {height}を入れることができます (* は、乗算記号です)。

正解の公式= {base}*{height}

学生がテストを受験する場合、Moodleは、{base}および{height}の値をランダムに選択して、Correct Answer Formulaの結果をもとに、解答に対して評定します。

テストでは、極めて稀に、同じ値が2回使われることがあります。

これは本当に、あなたが必要とする問題タイプですか?

計算問題の主な目的は、異なる数値を持った複数バージョンの問題を作成することにあります。これは、あなたが答えの中に、少なくとも1つのワイルドカードを置く必要があることを意味します。

あなたがランダム要素を必要としない場合、代わりに数値問題タイプを使用してください。

ワイルドカードおよびデータセット

Moodleが学生に対して計算問題を提供する場合、ランダムに選択された値とワイルドカードが置換されます。しかし、これらの値は完全にランダムという訳ではありません - 正確にいえば、事前に定義された可能性のある「データセット」からランダムに選択されます。このことにより、あなたは、選択されるべき可能性のある値をコントロールすることができます - 例えば、現実的な値をランダムに提供する場合です。

データセットは、「プライベート」または「共有」にすることができます - プライベートデータセットは、1つの計算問題内の1つのワイルドカードに使用されます。共有データセットは、すべての計算問題内の1つのワイルドカードに使用されます。

問題設定

計算問題を作成 (または修正) するには、操作する必要のある、3つのページがあります。以下のインストラクションでは、少しずつ、あなたに操作方法を紹介します:

ページ 1. 計算問題を編集する

  1. 問題「カテゴリ」を選択してください。
  2. このカテゴリにある、すべての共有ワイルドカード一覧が表示されます。あなたがカテゴリを変更した場合、この一覧をリフレッシュするため、「カテゴリを更新する」ボタンをクリックしてください。まだ、共有ワイルドカードが登録されていないかもしれません - その場合、あなたは、必要であれば、後で共有ワイルドカードを作成することができます。
  3. 問題に説明的な「名称」を与えてください - これにより、あなたが問題バンクでこの問題を認識しやすくなります。
  4. 問題テキストを入力してください。このテキストは、あなたが学生に答えて欲しい問題にしてください。また、学生が計算により答えを求めるための、すべての情報を含む必要があります。そのため、問題テキストには、少なくとも、波括弧に囲まれた1つのワイルドカードを含む必要があります。例えば、あなたが学生にAおよびBを合算させたい場合、問題テキストは、次のようになります: "{A} + {B}の答えは?"
  5. あなたの問題に画像を追加したい場合、表示するイメージを選択してください。学生には、問題テキストの直後、選択肢の前にイメージが表示されます。イメージの表示に関して、あなたがさらにコントロールしたい場合、HTMLエディタを使用して、問題テキストの上部にイメージを配置してください。
  6. 評点のデフォルト値を設定してください (例 この問題の最大点数)。
  7. ペナルティ要素を設定してください (詳細は、下記ペナルティ要素をご覧ください)。
  8. Moodle 1.7+以降、あなたが望む場合、一般的なフィードバックを追加することができます。これは、学生が問題に答えた後、表示されるテキストです。
  9. 次に、正解の公式を入力してください。この公式には、少なくとも、問題テキストに表示するためのワイルドカードを含む必要があります。詳細は、正解の公式をご覧ください。
  10. この問題の解答時、学生に与えるための評点を選択してください。この評点は、利用可能な合計点のパーセンテージです。例えば、あなたは、正解に100%、ほぼ正解に50%を与えることができます。答えの1つは、100%にする必要があります
  11. あなたが解答に受け入れることのできる間違いの許容誤差を指定してください。許容誤差および許容誤差タイプ、両者の設定により、受け入れる評点の幅を決定することができます。例えば、許容誤差 = t、正解 = x、ユーザ解答と正解の差 = dx の場合、許容誤差タイプは、以下のようになります:
    1. 名義尺度- dx <= t の場合、正解と見做されます。
    2. 相対度数 - dx / x <= t の場合、正解と見做されます。
    3. 幾何平均値 - dx² / x² <= t² の場合、正解と見做されます。
  12. 次の2つの設定「正解の表示」および「フォーマット」では、答えの正確さを決定します。あなたが使用したい、小数点および有効数字を選択するため、これらの設定を使用してください。
  13. この答えを入力した場合、学生に表示されるフィードバックを追加してください。
  14. あなたは、好きなだけ多くの公式を設定することができます - さらに追加するには「さらに答え入力欄を追加する」ボタンをクリックしてください。
  15. あなたは、答えの単位を指定することもできます。例えば、あなたがここに単位「cm」、受け入れることのできる答えに「15」を指定した場合、「15cm」および「15」の両方とも正解とされます。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.
  16. 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.

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

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 - the function does not take an argument, like in Excel.
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.