Cloze Question mit Variablen

Cloze Question mit Variablen

by céline keller -
Number of replies: 19
Wie lassen sich Variablen (Ersatzzeichen, Datensätze) in Cloze Question verwenden? 
Ich stelle mir etwas in diese Richtung vor (siehe Anhang).
Attachment Cloze_mit_Variablen.PNG
Average of ratings: -
In reply to céline keller

Re: Cloze Question mit Variablen

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
English please...
In reply to Emma Richardson

Re: Cloze Question mit Variablen

by céline keller -

How can variables (substitute characters, data sets) be used in Cloze Question? 

I imagine something along these lines (see attachment).

Attachment Cloze_mit_Variablen.PNG
In reply to céline keller

Re: Cloze Question mit Variablen

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You can't.

For what you are trying to do, I recommend looking at additional question types like qtype_formulas and qtype_stack.
In reply to céline keller

Re: Cloze Question mit Variablen

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello céline,

With the Formulas question, it's very simple and you can do a lot more.

You can try this question at https://moodleformulas.org/course/view.php?id=77&section=97 ↗.

MoodleForum_20220812_0319.png?time=1660291148656

Global variables

H = 30 ;
d = 1.2 ;
Qa = 2.3 ;
Qb = Qa ;
lambda = 0.03 ;
L = (d/0.03)*(((9.81*30*pi()**2*d**4)/(8*Qa))-1);
Ldisplay = sigfig(L,4);

Question text

<p>
    The pipe friction coefficient of the pipe is \(\lambda\).
</p>
<p>
    Inlet losses at the beginning of the pipe are neglected.
</p>
<p>
    Given: \(H={H}\ \rm m\),   \(d={d}\ \rm m\),   \(r=10^3\ \rm{kg/m^3}\),   \(Q_a={Qa}\ \rm{m^3/s}\),   \(Q_b={Qb}\ \rm{m^3/s}\),   \(\lambda={lambda}\)
</p>
<p>
    (In this case, the shut-off device is fully open and contributes nothing to the loss.)
</p>
<p>
    The pipe length \(\ell\) is \({=Ldisplay}\).
</p>
<br>
<ol type="a"  style="margin-left:-20px !important;">
    <li>
        What is the pipe length \(\ell\) at the volume flow \(Q_a\)?
    </li>
</ol>
<hr>

<p>
    Die Rohrreibungszahl des Rohres ist \(\lambda\).
</p>
<p>
    Einlaufverluste am Rohranfang werden vernachlässigt.
</p>
<p>
    Gegeben:  \(H={H}\ \rm m\),   \(d={d}\ \rm m\),   \(r=10^3\ \rm{kg/m^3}\),   \(Q_a={Qa}\ \rm{m^3/s}\),   \(Q_b={Qb}\ \rm{m^3/s}\),   \(\lambda={lambda}\)
</p>
<p>
    (Hierbei ist das Absperrorgan ganz geöffnet und trägt nichts zum Verlust bei.)
</p>
<p>
    Die Rohrlänge \(\ell\) ist \({=Ldisplay}\).
</p>
<br>
<ol type="a"  style="margin-left:-20px !important;">
    <li>
        Wie gross ist die Rohrlänge \(\ell\) biem Volumenstrom \(Q_a\)?
    </li>
</ol>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
    // FORMAT TEXT
    $("input.formulas_number ").css("width","120px");
});
</script>

Answer

L

Download this question in Moodle XML format:

Average of ratings: Useful (1)
In reply to Dominique Bauer

Re: Cloze Question mit Variablen

by céline keller -

Thank you very much for your quick reply.

Do I understand correctly that I have to install a plugin so that I can use the question type 'formulas'?

In reply to céline keller

Re: Cloze Question mit Variablen

by Milagros Huerta Gómez de Merodio -
Picture of Plugin developers
Indeed, to use "formula" questions, you must install the corresponding plugin.
If you can't install it, and you have Microsoft Excel, I invite you to try FastTest PlugIn, you just have to download it and use it on your PC. You can see it in German (although the translation should be improved, since it is with the Google translator).

As Tim says, CLOZE questions can't be done with "variables", if you do it directly from Moodle. But with FastTest PlugIn, using Excel formulas, you can create many of the same questions, with variable data, with a single click. You save them all in a "subcategory" and in the test you put a random question out of that subcategory.
I send you the XML that I have made with your problem, with "random values" and 50 differents questions.

  
In description cell put the formula ="Die Rohrreibungszahl des Rohres ist  \(\lambda\) . <br>Einlaufverluste am Rohranfang werden vernachässigt  <br> <br>"&"Gegeben: \(H="&Dato_01&"\ m\),   \(d="&Dato_02&" \ m\),   \(r=10^3\ kg/m^3\),   \(Q_a="&Dato_03&" \ m^3/s\)\(Q_b="&Dato_04& "\ m^3/s\)\(\lambda="&Dato_05&"\)<br>"&"(a) Wie gross ist die Rohrlänge \(l\) beim Volumenstrom \(Q_a\) ?  <br>(Hierbei ist das Absperrorgan ganz geöffnet und trägt nichts zum Verlust bei).  <br>Die Rohrlänge \(l\) ist {1:NM:~%100%"&Dato_06&":5#Richtig!!} m"

In the cells on the right (1 to 5) you can put the random data that you want each value Dato_01 = H [=RANDBETWEEN(25;35)]  ; Dato_02 = d  [=RANDBETWEEN(10;15)/10]  ; Dato_03 = Qa  [=RANDBETWEEN(20;25)/10] , Dato_04 = Qb , Dato_05 = 0,03 and in the cell Dato_06 put the length formula: =ROUND((Dato_02/Dato_05)*(((9.81*Dato_01*PI()^2*Dato_02^4 )/(8*Dato_03))-1);2) 

P.S.: In the plugin I have included a script that Dominique developed, in which the box with the width of the answer is the "minimum", and as the answer is written, the size of the box increases. Thus, the student is not given clues about the answer.
Average of ratings: Useful (2)
In reply to Milagros Huerta Gómez de Merodio

Re: Cloze Question mit Variablen

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Milagros,

... a script that Dominique developed...

For the record, Marc Bernat Martínez had the original idea and developed a first version of the script. I modified it to take into account the exact width of the input, whatever its length, font size and family used. See MoodleDocs - Can I resize the answer boxes while the user is typing? ↗.

Average of ratings: Useful (2)
In reply to Milagros Huerta Gómez de Merodio

Re: Cloze Question mit Variablen

by céline keller -

Thank you very much for your help.

Is it also possible to generate only one question (with variables) and an attached record? I have attached an example of an xml file as I imagine it, but for a calculated question.

In reply to céline keller

Re: Cloze Question mit Variablen

by Milagros Huerta Gómez de Merodio -
Picture of Plugin developers
Dear Céline, with the Formulas plugin, as Dominigue says, only one question is necessary.
If you mean FastTest PlugIn, it's not a single question (but you can have them all in one file and import them at once). The trick I use is to import all those questions into the same subcategory and, when generating the test, prepare it so that a random question comes out of the subcategory where all the generated questions are with the same statement, but different data.

At the end of the following video I explain how it can be done.

It would be much better to be able to use the plugins developed for this, but those of us who are not lucky enough to have them installed in our university's Moodle can "get by" with this "trick". This is how I did it when in online exams (during COVID) and my students had different data in their problems.

Although I don't think it is necessary to have all the possible combinations (11*6*6 = 396), I have generated an XML with all of them. I have generated the name of the question (automatically) with the data that varies, so you can check that none is repeated.


Regards
Average of ratings: Useful (1)
In reply to céline keller

Re: Cloze Question mit Variablen

by Milagros Huerta Gómez de Merodio -
Picture of Plugin developers
In the following file I have prepared the questions with the data you put in your example. In some cases, the length is negative (which I understand it can't be). I don't know if the formula is wrong or it is. Just in case, in the name of the question, I have put (automatically with Excel) that if the value of l is negative, start the question with "NEG", so you can sort them by name and delete those whose result is not a possible value.

Hope this can help you.

Regards
Average of ratings: Useful (1)
In reply to Milagros Huerta Gómez de Merodio

Re: Cloze Question mit Variablen

by céline keller -

Thank you very much for your help!!


In reply to céline keller

Re: Cloze Question mit Variablen

by Milagros Huerta Gómez de Merodio -
Picture of Plugin developers
You're welcome!!

I forgot to tell you that if you want to enter formulas on the same line you should put /( FORMULA /) instead of $$ FORMULA $$. If you use the latter, each formula puts it on a new line and centered in the text.

Regards
In reply to céline keller

Re: Cloze Question mit Variablen

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello céline,

Yes, you need to install the Formulas question type plugin, available at https://moodle.org/plugins/qtype_formulas ↗. The Formulas question type is a third-party question type.

Moodle comes with 16 standard question types for which you don't need to install anything else (see MoodleDocs - Question types ↗). You can also install third-party question types (see MoodleDocs - Third-party question types ↗). In total, about 80 third-party question types are available at Moodle - Plugins ↗ (click 'Show more' at the bottom of that page). Some are very useful and widely used.

Don't hesitate to ask your system administrator to install the Formulas question type plugin. This type of question is easy to learn, has many other powerful features and is very useful in many problems in science, technology, engineering and mathematics (STEM), as well as in other areas where you need to perform calculations, for example in accounting, etc.

Average of ratings: Useful (1)
In reply to Dominique Bauer

Re: Cloze Question mit Variablen

by Milagros Huerta Gómez de Merodio -
Picture of Plugin developers
It's a shame we have to rely on administrators to be able to use all those plugins, they are all very good and I would love to be able to use them.

In my university's Moodle, the only one we have "extra" is STACK. Although we ask them to install the others, they ignore us. That is why I have been implementing new functions to FastTest PlugIn, to be able to ask questions with formulas (in addition to the fact that it is faster than writing the questions one by one in Moodle, because in a single interface you have all the data that you have to fill in for the questions "standard"), and not having to depend on an external plugin to be installed to ask certain types of questions...

Although it is true that FastTest PlugIn has the drawback of being in Excel, in Spain almost all universities have a Microsoft license. But VBA is the programming language I know...
Average of ratings: Useful (2)
In reply to Milagros Huerta Gómez de Merodio

Re: Cloze Question mit Variablen

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Milagros,

Your FastTest plugin is definitely a useful option in many situations, for many users that are certainly grateful to you. The number of downloads surely confirms that this is a great contribution.

Having created such a plugin and making it known is a very commendable job. ¡olé!

smile
Average of ratings: Useful (1)
In reply to Dominique Bauer

Re: Cloze Question mit Variablen

by Milagros Huerta Gómez de Merodio -
Picture of Plugin developers

Thank you very much, Dominique, for your words!!

I love to help and, since I'm very good with Excel and VBA, it didn't cost me much to do it... well, a little time yes, but it's not difficult.

Also, I have implemented (and intend to continue implementing) several of your scripts... 🙂

In reply to céline keller

Re: Cloze Question mit Variablen

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello céline,

To randomize the data, just define random variables, e.g. as follows:

Random variables

H = {25:36} ;
d = {1.0:1.6:0.1} ;
Qa = {2.0:2.6:0.1} ;

Global variables

Qb = Qa ;
lambda = 0.03 ;
L = (d/0.03)*(((9.81*30*pi()**2*d**4)/(8*Qa))-1);
Ldisplay = sigfig(L,4);

H = {25:36} means that \(H\) will be chosen randomly in the interval from 25 to 35 (the last value, here 36, is not counted), ie \(H\) will be chosen among 11 different values. \(d\) and \(Q_a\) will each be chosen from 6 different values. So there is a total of 11 x 6 x 6 = 396 possible permutations of the same question. All of these permutations are generated automatically with only three short statements in a single question. Any of the 396 permutations will be submitted to each student.

I recommend using the Formulas question for this kind of problem because it is easy to learn, designed for computational problems in STEM, and has many great features which may not be available in other question types.

Average of ratings: Useful (2)