# Talk:Calculated question type

Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Calculated question type.

I'm trying to create just a SAMPLE calculated question to evaluate moodle quiz export XML, and am finding it about impossible to figure out. I've done some programming, and have figured some of it, but this is a very unfriendly format explanation. It would be lovely if there could be some explanation as to what a wild card is, and how to create data sets. I can put in a bit about the first thing, but the datasets still have me stumped. D.I. von Briesen 18:16, 23 June 2007 (CDT)

Please explain what a "placeholder" is - there is no other mention anywhere in Moodle (according to search!)

How does it match "item" in the question creation?

## Calculate Question: Random Numbers

Calculated Questions in Moodle allow for the creation of a question with "wildcards". The wildcards are used to create a database of numerical values...randomly generated...but static thereafter. So, if only two entries of random numbers are made into the database...(eg. x = 3 and x = 5...randomly generated of course), then the question only uses 3 and 5 for the wildcard. For additional values of the wildcard, additional entries must be randomly generated and placed into the static database.

Why not eliminate the static database, and just have Moodle generate truly random, non-static wildcards into the actual question? I've seen other course management programs that do this, such as LON-CAPA from Michigan State University.

For example...

Q: Find the sum of {x} and {y}. To generate the wildcards, Moodle would randomly choose an "x" and "y" (eg. where {x|0<x<10, step .1} and {y|5<y<10, step 1}), and insert the values directly into the question/answer. The values of "x" and "y" would be randomly chosen each time, greatly improving the variation of question/answer possibilities. This would be an improvement over the current limited static database method.

A static database of randomly-generated numbers is NOT a random number generator. The same two "random" wildcard values get used over and over...and the variation of each question is determined by the number of static entries in the database.

Perhaps Moodle can already perform this action, and I simply haven't found the correct function or procedure. Any suggestions for accomplishing random numbers in calculated quizzes are welcome and appreciated. ____

SUGGESTED CORRECTION TO: (Chuck Friesen: chuckfriesen@gmail.com): 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).

CORRECTION: "... For example, if you want students to calculate the sum of the sine of one angle and the cosine of twice another angle, you would enter sin({a}) + cos({b}*2). " _____

## Datasets

I would like to see datasets in a bigger perspective. For example:

- same dataset over more then one quiz

- set a dataset for a group for the hole course

With the current version of Moodle I often create a quiz and questions for every group (same questions but different numeric result). Not a very nice solution, but the only one I could find.

Is anybody thinking the same?