Wiris

Documentation / WirisQuizzes

  • Demos
  • Visit our website
  • Contact us
  • MathType

    • WirisQuizzes

      • LearningLemur

        • CalcMe

          • MathPlayer

            • Store FAQ

              • MathFlow

                • BF FAQ

                  • Miscellaneous

                    • Wiris Integrations

                      • Home
                      • WirisQuizzes
                      • Validation Options
                      • Grading functions
                      • Grading functions

                      Basic grading function

                      Reading time: 1min

                      Let’s suppose we want to ask the question: “Give a prime number.” For this, we need to use a grading function.

                      First, create the grading function in the Define random variables and functions section. In this example, the grading function will be called gf.

                      The function gf(x) returns true if x is prime and false otherwise. To use this function as the validation method, select Custom grading function in the Validation options section and enter the name of the grading function in the input field—gf, in this case.

                      Caution
                      You can also define how the student’s answer is passed to the grading function. This is an advanced feature, described in the final sections of this documentation. In most cases, the default value, Evaluated, should be used.

                      As for the Correct answer field, any value will work. Since the Custom grading function is used, it is the function’s output that determines whether the answer is correct. In this case, you can simply input any prime number.

                       

                      Was this article helpful?

                      Give feedback about this article

                      Related Articles

                      • MathML and HTML5
                      • Math-to-speech technology
                      • Content MathML
                      • Compound answers

                      Empowering STEM education

                      MathType

                      • Office Tools
                      • LMS
                      • XML
                      • HTML

                      WirisQuizzes

                      Learning Lemur

                      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