Documentation / WirisQuizzes

  • Demos
  • Visit our website
  • Contact us
  • MathType

    • Wiris Quizzes

      • Learning Lemur

        • CalcMe

          • MathPlayer

            • Store FAQ

              • VPAT for the electronic documentation

                • MathFlow

                  • BF FAQ

                    • Miscellaneous

                      • Home
                      • Wiris Quizzes
                      • Validation Options
                      • Grading functions
                      • Grading functions

                      Basic grading function

                      Reading time: 1min

                      Let's suppose that we want to ask the question "Give a prime number". For this, we need to use a grading function.

                      First, let's create the grading function. This is done in the Define random variables and functions section. In this example, the grading function will be called gf. 

                      The function we've defined, gf(x), returns true if x is prime and false otherwise. Select Custom grading function in the Validation options section to use this as the validation method. Then, use the name of the grading function in the blank, in this case, "gf".
                      Caution
                      As you may notice, you can also define how the student's answer will be passed to the grading function. This is an advanced feature for which you can find more details in the two latest sections of this documentation page. Most user cases will require leaving the default value: Evaluated.

                      As for the Correct answer blank, anything will work. Since we've selected Custom grading function as the validation method, the output of the grading function is the only thing that determines correct answers. In this case, we could input a prime number, for example.

                       

                      Was this article helpful?

                      Yes
                      No
                      Give feedback about this article

                      Related Articles

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

                      Making people’s STEM work more meaningful

                      MathType

                      • MathType for Office Tools
                      • MathType for Mac
                      • MathType for Microsoft 365
                      • MathType for Google Workspace
                      • MathType for LMS
                      • MathType for XML Editors
                      • Arabic notation
                      • Our products accessibility
                      • MathType is online

                      WirisQuizzes

                      Learning Lemur

                      Solutions for Education

                      • Blackboard Learn
                      • Brightspace by D2L
                      • Canvas
                      • Google Classroom
                      • Moodle
                      • Schoology

                      Solutions for Publishing Houses

                      Solutions for Technical Writers

                      Solutions for Chemistry

                      Integrations

                      • HTML Editors
                      • MathType in WordPress

                      Pricing

                      Company

                      Careers

                      Blog

                      Contact Us

                      Buy Now

                      Plugin Downloads

                      © Wiris 2025

                      • Cookie Settings
                      • Cookie Policy
                      • Terms of Use
                      • Privacy Policy / GDPR
                      • Student Data Privacy
                      • Compliance
                      • Powered by Helpjuice
                      Expand