Hello Susan,
I am quite sure that this kind of question is doable with the formulas question type.
I have seen your screenshot but I have trouble understanding the calculations between the variables #O, #S, #B, #C, #, #E and the answers #1, #2, #3
If you send me a private message with the relations between them, I can try to make a version of this question with the Formulas question type. It has both random and global variables (strings, numbers, list of strings and list of numbers) and answers can be drop down menus, multichoice or field
Formulas question type can be difficult to master at the beginning but it is very powerful.
The only condition to use it is to be able to install plugins on your Moodle website as Formulas and the associated adaptivemultipart behaviour (made by Tim Hunt) are not part of core Moodle. So it depends a lot on how your Moodle website is hosted.