Development:Calculated question type creation: Difference between revisions
From MoodleDocs
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
I will try to describe the PHP code princiapl processes of the calcualted question creation and see how it could be improved. | I will try to describe the PHP code princiapl processes of the calcualted question creation and see how it could be improved. | ||
Calculated question creation process | Calculated question creation process | ||
Calculated question is an extended numerical question where parameters of a mathematical problems are generated and used to calculate the answer using a mathematical formula. So the answer parameter of a numerical question is replaced by the mathematical formula using the same answer database structure that the numerical question. | Calculated question is an extended numerical question where parameters of a mathematical problems are generated and used to calculate the answer using a mathematical formula. | ||
The generated parameters are identified by a special format that is not used in mathematical PHP equation {param} where the param name begins by a letter and can include alphanumerics symbol a-z A-Z _ 0-9 ex. {ad} ,{a_2} {a4_r}. | So the answer parameter of a numerical question is replaced by the mathematical formula using the same answer database structure that the numerical question. | ||
These parameters are transform in datasets defined by a min,max,decimal and generation mode. Using these definitions a number of different values are generated (the datasetitems) and to generate different question instances in quizzes, lessons etc. Actually the creation of a calualted question is a three step process | The generated parameters are identified by a special format that is not used in mathematical PHP equation {param} where the param name begins by a letter and can include alphanumerics symbol a-z A-Z _ 0-9 | ||
ex. {ad} ,{a_2} {a4_r}. | |||
These parameters are transform in datasets defined by a min,max,decimal and generation mode. | |||
Using these definitions a number of different values are generated (the datasetitems) and to generate different question instances in quizzes, lessons etc. | |||
Actually the creation of a calualted question is a three step process | |||
[[Category:Developer]] | [[Category:Developer]] | ||
[[Category:Quiz]] | [[Category:Quiz]] |
Revision as of 05:37, 13 June 2006
Template:Questiontype developer docs Its a first try as you could see. I will try to describe the PHP code princiapl processes of the calcualted question creation and see how it could be improved.
Calculated question creation process Calculated question is an extended numerical question where parameters of a mathematical problems are generated and used to calculate the answer using a mathematical formula. So the answer parameter of a numerical question is replaced by the mathematical formula using the same answer database structure that the numerical question. The generated parameters are identified by a special format that is not used in mathematical PHP equation {param} where the param name begins by a letter and can include alphanumerics symbol a-z A-Z _ 0-9 ex. {ad} ,{a_2} {a4_r}. These parameters are transform in datasets defined by a min,max,decimal and generation mode. Using these definitions a number of different values are generated (the datasetitems) and to generate different question instances in quizzes, lessons etc. Actually the creation of a calualted question is a three step process