Wiris

Documentation / WirisQuizzes

  • Demos
  • Visit our website
  • Contact us
  • MathType

    • WirisQuizzes

      • Nubric

        • CalcMe

          • MathPlayer

            • Store FAQ

              • MathFlow

                • BF FAQ

                  • Miscellaneous

                    • Wiris Integrations

                      • Home
                      • WirisQuizzes
                      • Advanced Validation Features
                      • Basic use of random variables

                      Example: Volume of a cylinder

                      Reading time: 1min

                      Let us create an essential question asking to calculate a cylinder's volume given its base's radius and height.

                      volume_cylinder_preview_moodle.png

                      The Basic Mode allows us to retrieve a random integer number in a given interval. We need two random numbers: on for the base's radius and one for the cylinder's height, which we will call r, and h (the name of the variables is essential, as we will see later on). We need to click on the Add variable button to add them.

                      volume_cylinder_variables_definition.png

                      Now, we need to define the correct answer in the corresponding input field, considering that it's not a number. As you may see, the evaluate() command will be automatically displayed there to be used if we want our solution to be computed.

                      volume_cylinder_correct_answer.png

                      If we directly write the correct answer without the evaluate() command, the result showed to the student as the expected answer will appear without any performed calculus. Both options are valid, but we prefer to display the final fraction when the students answer the question in this example. Conversely, that's what it would be displayed.

                      volume_cylinder_not_evaluated.png

                      Finally, we can test the question's behaviour in the Test the question section. There, we can try some possible answers and check everything works as expected.

                      volume_cylinder_preview_quizzes.png

                       

                      Was this article helpful?

                      Give feedback about this article

                      Related Articles

                      • Basic use of random variables
                      • Declaring variables
                      • Inserting variables
                      • Variables evaluation
                      • Transferring variables to CalcMe

                      Empowering STEM education

                      MathType

                      • Office Tools
                      • LMS
                      • XML
                      • HTML

                      WirisQuizzes

                      Nubric

                      Integrations

                      Solutions

                      • Education
                      • Publishing houses – platforms and interactive
                      • Publishing houses – Print and digital
                      • Technical writers

                      Pricing

                      Downloads

                      Blog

                      • Success stories

                      About us

                      • Careers
                      • Partnership

                      Contact Us

                      Contact Sales

                      European union (European Regional Development Fund) and 1EdTech (TrustEd Apps Certified)
                      • Cookie Policy
                      • Terms of Use
                      • Privacy Policy / GDPR
                      • Student Data Privacy
                      • Compliance
                      • Cookie Settings

                      © Wiris 2026

                      Expand