Тип вопроса «вычисляемый»

Материал из База знаний Центра ПУСК МФТИ


Вычисляемые вопросы предлагают способ создания отдельных числовых вопросов с использованием подстановочных знаков (т.е. вы можете использовать общие имена переменных, такие как "x" , "y", заключенные в фигурные скобки, для создания подстановочных знаков "{x}" и "{y}"), которые при прохождении теста заменяются случайными значениями.

For example, if you want to create a large number of "Calculate the area of a rectangle" problems to drill your students, you could create a question with two wildcards (i.e. {base}, {height} created from the common base, height variable names) and put in the "Correct Answer Formula=" input field {base} * {height} ( * being the multiplication sign ).

Correct Answer Formula= {base}*{height}


When a student takes the test, Moodle will randomly select values for {base} and {height} and grade the response using the result of the Correct Answer Formula.

The test will very rarely appear the same way twice.

Is this really the question type for you?

The main purpose of the calculated question is to create multiple versions of a question with different numerical values. This means you must have at least one wildcard in one of the answers.

If you don't need a random element, use the Numerical question type instead.

Simple calculated question type

The simple calculated question offers the most used features of the calculated question with a much simpler creation interface.

Wildcards and datasets

When Moodle delivers a Calculated question to the student, the wildcards are replaced with randomly-selected values. However, these values are not completely random - rather, they are randomly selected from a pre-defined dataset of possible values. This allows you some control over the possible values chosen - for example, in order to make sure the numbers are realistic.

These datasets can be private or shared - private datasets are used by one wildcard within one calculated question; shared datasets are used by one wildcard within all calculated questions that use it.

Question set-up

To create (or modify) a calculated question there are three pages to work through. The instructions below take you through the pages, step by step:

Страница 1. Редактирование расчетного вопроса

  1. Выберите вопрос "категория"
  2. Ниже перечислены все общие подстановочные знаки для этой категории. Если вы меняете категорию, вам нужно нажать кнопку "Обновить категорию", чтобы обновить этот список. Возможно, пока нет общих шаблонов - если нет, вы можете создать их позже, если пожелаете.
  3. Присвойте вопросу описательное "название" - это позволит вам идентифицировать его в банке вопросов.
  4. Введите "текст вопроса". Это должен быть вопрос, на который вы хотите, чтобы ученик ответил, и он должен содержать всю информацию, необходимую для расчета ответа. Поэтому в нем должен быть хотя бы один подстановочный знак, заключенный в фигурные скобки. Например, если вы хотите, чтобы ученик просуммировал числа A и B, текст вопроса может звучать так: "Что такое {A} + {B}?" Вы также можете включить значения, вычисленные с помощью подстановочных знаков, используя синтаксис "{=...}: например, вопрос "Что такое {={A}+{B}} - {A}?" со значениями подстановочных знаков A=4 и B=3 будет отображаться как "Что такое 7 - 4?"
  5. Выберите изображение для отображения, если вы хотите добавить картинку к вопросу. Для учащихся оно отображается сразу после текста вопроса и перед вариантами ответов. Если вы хотите лучше контролировать отображение изображения, включите его в текст вопроса выше, используя редактор HTML.
  6. Установите "оценку вопроса по умолчанию" (т.е. максимальное количество баллов за этот вопрос).
  7. Установите "Штрафной коэффициент" (см. Penalty factor ниже).
  8. "Moodle 1.7+:" Если хотите, добавьте общую обратную связь. Это текст, который появляется у студента после того, как он / она ответит на вопрос.
  9. Далее добавьте "формулу ответа". Эта формула должна содержать как минимум те подстановочные знаки, которые указаны в тексте вопроса. Более подробную информацию смотрите в разделе Синтаксис формулы правильного ответа.
  10. Выберите "оценку", которую учащийся получит за этот вопрос, если он даст такой ответ. Это должно быть процентное соотношение от общего количества доступных оценок. Например, вы могли бы поставить 100% за правильный ответ и 50% за ответ, который близок к правильному. ""Один из ответов должен быть оценен на 100%"".
  11. Определите "допустимую" погрешность, которую вы будете допускать в ответе. Настройки допустимости и типа допуска в совокупности дают диапазон допустимых значений. Итак, если допуск = t, правильный ответ = x и разница между ответом пользователя и правильным ответом равна dx, то типы допусков следующие:
    1. Номинальный - отметьте правильный, если |dx| <= t
    2. Относительный - отметьте правильно, если |dx| / x <= t
    3. Геометрический - отметьте правильно, если x/(1+t) <= (x+dx) <= x*(1+t)
  12. Следующие 2 параметра, "Отображение правильного ответа" и "Формат", определяют "точность" ответа. Используйте их, чтобы выбрать количество знаков после запятой или значащих цифр, которые вы хотите использовать.
  13. Добавьте "обратную связь", которую ученик увидит, если введет этот ответ.
  14. Вы можете указать столько формул ответов, сколько захотите - нажмите "Добавить еще один пустой вариант ответа", чтобы добавить еще.
  15. Вы также можете указать единицы измерения для ответов. Например, если вы введете здесь единицу измерения "см", а принятый ответ будет равен 15, то оба ответа "15 см" и "15" будут приняты как правильные. Если вы добавляете более одной единицы измерения, вы также можете указать множитель. Итак, если ваш основной ответ был 5500 с единицей измерения W, вы также можете добавить единицу измерения kW с множителем 0,001. Это означает, что все ответы "5500", "5500 Вт" или "5,5 кВт" будут помечены как правильные. Обратите внимание, что допустимая ошибка также умножается, поэтому допустимая ошибка в 100 Вт будет равна ошибке в 0,1 кВт.
  16. Наконец (!) вы можете нажать "Следующая страница", чтобы сохранить то, что вы сделали, и двигаться дальше. Если вы редактируете существующий вопрос, вы можете нажать "Следующая страница (новый вопрос)", чтобы создать совершенно новый вопрос на основе существующего.

Штрафной коэффициент

"Штрафной коэффициент" применяется только в том случае, если вопрос используется в тесте в адаптивном режиме, т.е. когда учащемуся разрешается несколько попыток ответить на вопрос даже в рамках одной попытки в тесте. Если штрафной коэффициент больше 0, то ученик будет терять эту долю от "максимальной" оценки при каждой последующей попытке. Например, если оценка за вопрос по умолчанию равна 10, а штрафной коэффициент равен 0,2, то за каждую последующую попытку после первой будет начисляться штраф в размере 0,2 х 10 = 2 балла.

Tolerance

As for numerical questions it is possible to allow a margin within which all responses are accepted as correct. The "Tolerance" field is used for this. However, there are three different types of tolerances. These are Relative, Nominal and Geometric. If we say that the correct answer at quiz time is calculated to 200 and the tolerance is set to 0.5 then the different tolerance types work like this:

Relative: A tolerance interval is calculated by multiplying the correct answer with 0.5, i.e. in this case we get 100 so for this tolerance the correct response must be between 100 and 300. (200 ± 100) This is useful if the magnitude of the correct answer can differ greatly between different wildcard values.

Nominal: This is the simplest tolerance type but not very powerful. The correct response must be between 199.5 and 200.5 (200 ± 0.5) This tolerance type can be useful if the differences between different correct answers are small.

Geometric: The upper limit of the tolerance interval is calculated as 200 + 0.5*200 and is the same as for the relative case. The lower limit is calculated as 200/(1 + 0.5). The correct response must then be between 133.33 and 300. This is useful for complex calculation that must have great tolerances where relative tolerances of 1 or more would be used for the upper limit but clearly not acceptable for the lower limit as it would make zero a correct answer for all cases.

The field Significant Figures does only relate to how the correct answer should be presented in the review or the reports. Examples: If it is set to 3 then the correct answer 13.333 would be presented as 13.3; 1236 would be presented as 1240; 23 would be presented as 23.0 etc.

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.

Note that even when creating a question for the first time, this page may say that your wildcard "will use the same existing private dataset as before." This just means that Moodle has already tentatively created a private data set for that wildcard: if a private dataset is what you want, leave this choice selected.

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?

Warning: This button can affect several questions, so be careful before using it. Assume you have selected dataset parameter for {a} to be any value between 1-10 and generated a question. In the second question also you decide to use a SHARED wildcard called {a}. Inherently, it will show a value between 1-10. However, your need here changes and you want to make it 11-100 instead. Then, you change them in the range and click this button. Voila! the values change and you can add new items here using the 'Get New item to add'. However, if you go back to your previous question, you will see that values would change there too, because it is a shared dataset. If you do not update parameters, then this may not happen and will generate a new set of values and displays them in the "Item to Add" section.

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 cosine of two times another angle, you would enter sin({a}) + cos({b}*2) or sin({a}) + cos(2*{b}).
  • 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.

Доступные функции

В вычисляемых вопросах могут использоваться не только простые арифметические операторы. В версиях 1.5 и более поздних версиях разрешены следующие функции.

"Примечание: внутри этих функций можно использовать формулы и подстановочные знаки. Подстановочные знаки заключены в фигурные скобки {}".

Функция Пояснение Использование/Синтаксис
abs Абсолютное значение
acos Косинус дуги - выводится в радианах.
acosh Обратный гиперболический косинус - выводится в радианах.
asin Синус дуги - вывод в радианах.
asinh Обратный гиперболический синус.-- вывод в радианах.
atan2 Угловой тангенс двух переменных - введите два значения, например (y, x), и вы получите значение atan(y/x), настроенное на соответствующий квадрант. (Примечание: Переменные расположены в порядке, обратном порядку значений atan2(x,y) в Excel) Выходные данные представлены в радианах.
atan Угол наклона дуги - выводится в радианах.
atanh Обратный гиперболический тангенс - выводится в радианах.
bindec Преобразование двоичного числа в десятичное
ceil Округление дробей до целого числа ceil({a})
cos Косинус - в радианах!!! Преобразуйте значение градуса в радианы, прежде чем переводить его в значение cos.
cosh Гиперболический косинус - в радианах!!! Переведите значение градуса в радианы, прежде чем приступать к его измерению.
decbin Преобразование десятичной системы счисления в двоичную
decoct Из десятичной в восьмеричную
deg2rad Преобразует число в градусах в радианный эквивалент
exp Вычисляет показатель степени e
expm1 Возвращает значение exp(number) - 1, вычисленное таким образом, чтобы оно было точным, даже если значение number близко к нулю
floor Округление дробей до целого числа этаж([значение]) "например. этаж({x}/{y})"
fmod Возвращает модуль двух чисел с плавающей запятой, т.е. остаток при делении первого на второе.
is_finite Определяет, является ли значение допустимым конечным числом
is_infinite Определяет, является ли значение бесконечным
is_nan Определяет, не является ли значение числом
log10 Логарифм по основанию-10
log1p Возвращает логарифм(1 + число), вычисленный таким образом, чтобы он был точным, даже если значение number близко к нулю
log Натуральный логарифм ("ln")
max Найти наибольшее значение
min Найти наименьшее значение
octdec От восьмеричного к десятичному
pi Получаем значение pi - функция не принимает аргумент, как в Excel. pi()
pow Экспоненциальное выражение или число, возведенное в степень pow([число для возведения], [степень]) "например, pow({x},{y})"
rad2deg Преобразует число в радианах в эквивалентное число в градусах
rand Сгенерировать случайное целое число
round Округляет число с плавающей запятой до указанного числа знаков после запятой; если вам нужно округлить сумму до ближайших 100, разделите полученное число на 100, округлите до 0 знаков после запятой, затем умножьте на 100 округлить([сумма],[количество знаков после запятой]) "например. ОКРУГЛИТЬ({a},3)"
sin Синус - в радианах!!! Преобразуйте градусное значение в радианы, прежде чем принимать значение sin.
Гиперболический синус - в радианах!!! Преобразуйте ваши градусы измерения в радианы, прежде чем принимать их за чистую монету.
sqrt Квадратный корень
tan Касательная - в радианах!!! Преобразуйте ваши градусы измерения в радианы, прежде чем принимать их во внимание.
tanh Гиперболический тангенс - в радианах!!! Преобразуйте значение градуса в радианы, прежде чем измерять его в tanh.

Predefined constants

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

Synchronization

You could use shared wild cards to get the same values across questions in a quiz.

A simple example will be to use the same radius in a first question asking for the perimeter of a circle of {radius}cm and a second question asking for the surface of a circle of {radius}cm.

When the quiz will be shown to the student the two questions will shown the same {radius} value.

However the synchronization will work ONLY if the questions are kept in the SAME category and have the SAME NUMBER OF DATASETS .

If you need to move the synchronized questions to another category, you need to do it by editing the questions.

I have a problem: The wild card values are reset when trying to add a new parameter

See also

Using Moodle forum discussions:

index.php?title=Категория:Mathematics

de:Fragetyp Berechnet es:Tipo de Pregunta Calculada fr:Question calculée zh:計算題 ja:計算問題タイプ