-
Notifications
You must be signed in to change notification settings - Fork 3
Randomized texts
mkraska edited this page Jul 1, 2022
·
2 revisions
Sometimes you don't want to specify numbers but want to describe the task using text.
This can be randomized using a random index for access to a template list. The list contains factors and textual descriptions of these factors.
template: [
[ 2, "auf das Doppelte erhöht" ],
[ 1.1, "um 10% erhöht" ],
[ 1.5, "um 50% erhöht" ],
[ 0.5, "auf die Hälfte vermindert" ],
[ 0.9, "um 10% vermindert" ]
];
Let's say you have a quantity L.
-
Li
is the random list index. -
Ltext
is the text to be used in the question text. -
Lfactor
is the factor represented by the text.
Now assume that the result is proportional to the square root of L.
-
Lauf
is to how many % the result changes. -
Lum
is by how many % the result changes.
It is not recommended to randomize also the question of 'to' or 'by', because this might get complicated with feedback.
Lexp: -0.5;
Li: rand(length(template))+1;
Ltext: template[Li][2];
Lfactor: template[Li][1];
Lauf: Lfactor^Lexp*100;
Lum: (Lfactor^Lexp-1)*100;
<p>Um wieviel % (mit Vorzeichen) ändert sich die Eigenfrequenz eines mathematischen Pendels,</p>
<p>a), wenn die Länge {@Ltext@} wird? [[input:ans1]]% [[validation:ans1]] [[feedback:prt1]]</p>
Use Lauf
or Lum
as model solution and teacher's answer, depending on what your actual question was.
In order to try code snippets in jsfiddle,
- copy the code from the wiki page to the clipboard
- follow the link for the JSXGraph version you want to try
- Replace the code in the HTML section (contents of
<p hidden id="init">
) with the content of the clipboard