Formulas question type in inorganic nomenclature

Formulas question type in inorganic nomenclature

by Agustín Sánchiz -
Number of replies: 8

Hello,

I am a chemistry teacher at a high school, and I am thinking about the possibility of using question type to elaborate chemical nomenclature questions. 

I want to summarize in a single question all the possible binary compounds that the elements with oxidation state +1 can form with oxygen, and thus save a lot of time and effort, as it would be able to summarize seven possible issues in one. Then I could repeat the process for the chemical elements with oxidation state +2, +3, etc.

First, I have created a random variable like this: 

U = {"lithium", "sodium", "potassium", "rubidium", "cesium", "silver", "gold"};

In the statement I have put the following:

Name the following compound: di{U} monoxide.

In this way I got a random statement that encompasses all possible names. 

I have the problem when I want to create a group of variables for the answers. 

I've thought of a variable like that:

V=["Li","Na","K","Rb","Cs","Ag","Au"]

In this way the possible correct answers correspond to the general formula: V₂O.

But unfortunately my knowledge on this type of issue is so basic that I can't find a way to relate both groups of variables. 

For example, if the program randomly chooses " lithium", how can we associate to that first variable ("lithium") the other variable of the second set ( the symbol "Li")?

And there I am, stranded like a ship. If you could help me I would be very grateful.

Regards

Average of ratings: -
In reply to Agustín Sánchiz

Re: Formulas question type in inorganic nomenclature

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

Hello Agustín,

Define a random index in Random variables: (indexes start at 0 and the last one is not included)

i = {0:7};

Define the lists of names and symbols. Pick one name and corresponding symbol with the same random index i:

name = ["lithium", "sodium", "potassium", "rubidium", "cesium", "silver", "gold"];
symbol = ["Li","Na","K","Rb","Cs","Ag","Au"];
U = name[i];
V = symbol[i];
Average of ratings: Useful (1)
In reply to Dominique Bauer

Re: Formulas question type in inorganic nomenclature

by Agustín Sánchiz -
Thank you very much for your help. It will be very useful to me !!
Regards!
In reply to Dominique Bauer

Re: Formulas question type in inorganic nomenclature

by Agustín Sánchiz -
Hi Dominic,
I have followed the steps you have indicated, but I'm sure I'm not doing something right. The program gives me an error message in the response type.
I give you screenshots.
a) What i have put in variables:










b) And the error message in the response type. I don't know exactly which option to choose. I have tried to put quotes, brackets, etc.

Thank you very much for your help.
Average of ratings: Useful (1)
In reply to Agustín Sánchiz

Re: Formulas question type in inorganic nomenclature

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

Hello Agustín,

The Formulas question does not have a string answer type per se. However, the algebraic formula answer type requires a string as the answer. A workaround can therefore be used.

Formatting of the answer boxes is necessary to get a good appearance.

The two points above make the preparation of the question a bit laborious. Maybe you could consider some chemistry plugins.

Anyway, you will find the following example at https://moodleformulas.org/course/view.php?id=78&section=11 ↗.

Formulas_20201007_2329.png

In reply to Dominique Bauer

Re: Formulas question type in inorganic nomenclature

by Agustín Sánchiz -

Hi Dominique,

I will study the example carefully and try to apply it to the problem at hand.

I'll tell you the result.

Thank you very much for everything.

In reply to Dominique Bauer

Re: Formulas question type in inorganic nomenclature

by Agustín Sánchiz -

Hello Dominique,

I have modified the question you posted. I have increased the number of possible compounds to formulate, including binary compounds of O, S, Te and Se.

The problem is that in my language, the elements O and Te originate compounds whose name cannot be included in global variables, because the program fails.

For example, oxygen compounds in my language are called "òxid", with a tilde. The tellurium compounds in my language are called "tel·lulur", with "l·l". 

Is there a way for Moodle to accept special characters like "´" "`"  or  "l·l" in a global variables? Otherwise the question statement appears with misspellings.

I post the question in case you want to see it.

Thank you!!

In reply to Agustín Sánchiz

Re: Formulas question type in inorganic nomenclature

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Agustín,

Unfortunately, this workaround uses the name of variables, which must be made up of only aphanumeric characters (a-z, A-Z, 0-9 and _). A response type with strings would be a useful addition to the Formulas question, but it has not yet been developed.

I think the STACK question allows entry of strings, but you'll have to check.