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

                      • Wiris Integrations

                        • Home
                        • Wiris Quizzes
                        • 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?

                        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