MathDox in education

Hans Cuypers Jan Willem Knopper Rikko Verrijzer Department of Mathematics and Computer Science Eindhoven University of Technology [email protected]

ABSTRACT MathDox is a system for presenting highly interactive mathematical documents over the world wide web. It provides easy connections to Computer Algebra Systems, dynamic geometry systems and other mathematical services. MathDox shows its potential when demonstrating the workings of an algorithm or explaining new concepts with dynamic on-screen calculations. Moreover, within MathDox we have developed an exercise system providing parameterized exercises to students and offering intelligent feedback. We will describe the MathDox-system, its applications and use in concrete situations.

INTRODUCTION Recently developed E-learning tools like Learning Management Systems (LMS) are very well suited for distance education and for delivery of online educational materials to students. They also provide various new ways of communication. However, these systems only offer a good learning environment for eduction via the web. The success of good education is still very dependent on the learning material itself.

In the area of Mathematics we see that quite recently various new tools have been created that offer students a rich environment for practicing mathematics. These systems offer parameterized exercises with open questions that are automatically graded. Indeed, Maple TA (www.maplesoft.com), , Aleks (www.aleks.com), MyMathLab (www.mymathlab.com) en WebAssign (www.webassign.net) are commercial systems offering this type of facilities, while STACK (www.stack.bham.ac.uk), WIMS(wims.unice.fr) and WebWORK (webwork.math.rochester.edu) are some open source initiatives in this direction. The feedback that these systems provide, however, is usually very restricted. The DWO (www.fi.uu.nl/dwo) and the LeActiveMath system (www.leactivemath.org) are also two systems for mathematical exercises offering more intelligent feedback. Here we report on our own initiatives to create a system, called MathDox, offering highly interactive mathematical documents and exercises.

MathDox is a system serving dynamic and interactive web pages with high quality rendering of mathematics and easy access to mathematical services like computer algebra systems or dynamic geometry software. MathDox shows its potential when demonstrating the workings of an algorithm or explaining new concepts with dynamic on-screen calculations.

In this chapter we focus on some features of the MathDox system and in particular, we explain how these features have been used to create a rich environment for parameterized mathematical web pages and interactive exercises providing easy access to all kinds of mathematical (web)services, taking care of good presentation of mathematics, offering easy and natural input of mathematics and of facilities to provide meaningful feedback to users. The MathDox software is open source and can be found at www.mathdox.org.

INTERACTIVE MATHEMATICAL DOCUMENTS Many of today's web pages are dynamic and interactive in the sense that they adapt to the user and offer the user some control over the contents of the page. Examples of such web pages are e-Banking, auction, and e-Learning sites. The dynamics and interactivity of these sites are a real asset when information gathering is at stake at both the user and the server end. When the user consults his/her account at an e- Banking site, the pages presented to the users are based on their latest data and are able to execute money transfer orders. Without dynamic and interactive websites, e-Banking would not be possible. Web pages about mathematics are often static and do not invite the user to experiment with and experience the material. We see three main reasons for this. First of all, interactivity in mathematical content often requires non-trivial computations that are not easily performed without the assistance of specialized mathematical software, e.g. computer algebra systems. Second, displaying mathematics properly on a web page can be challenging. There are a number of methods to render mathematics on a web page, such as MathML, CSS, or by images. Unfortunately, all of these are not intuitive to write by an author. Moreover, MathML is not yet natively supported by all major browsers, CSS style sheets are not always accurate and uniform on different browsers, images are slow to create and cannot or are hard be generated on the run. Third, the input of mathematical expressions is difficult, both for the user as well as for the author. It is a lot of work for an author to enter complex or deeply nested formulas into a web page with the standard set of HTML elements. Without any aid --for instance of pallets with mathematical symbols-- it is nearly impossible for an user to enter a complex mathematical expressions. Web pages that do contain interactive mathematics, often include various applets, see for example www.cut-the-knot.org or www.fi.uu.nl/wisweb/en, or flash applications as demonstrated by web sites as www.intmath.com or www.aplusmath.com/flashcards/. The various applets and flash items tend to be and remain separate items and do not come together and from a consistent interactive mathematical document. They also tend to focus on graphical aspects of the mathematics involved. To address these issues the MathDox research group at TU/e has developed the MathDox system, see (Cuypers et al., 2009). It consists of the MathDox format and a set of tools including the MathDox Player. The MathDox format is an XML based language for interactive mathematical documents. As such MathDox documents can be interpreted and transformed into web pages by the MathDox Player, software designed for this sole purpose. These resulting web pages are dynamic and interactive, support rendering of mathematics, offer easy access to computer algebra systems, and are equipped with a convenient mathematical input system. MathDox shows its potential when demonstrating the workings of an algorithm, testing readers' skills with exercises, or explaining new concepts with dynamic on-screen calculations. However, it can also be used for publishing static mathematical documents on paper or on the web When developing MathDox we have the following requirements in mind. Interactivity. A user needs means to interact with the mathematical content of an interactive document. For example, answering a question or to supply data for an example and to study the effects. In short the user needs ways to change parameters and the format needs to be able to adjust to those parameters. Non mathematical interactive pages use techniques like JSP, PHP, and ASP to this purpose. Mathematical applets or flash applications are interactive but often lack the opportunity to communicate and cooperate and form a consistent page with the other elements. Usable in multiple formats. An interactive mathematical document is best served in an electronic environment, such as a web browser. However the need may arise to view such a document on different media, such as a mobile phone or more traditional on paper. We consider it important that such formats are supported from the same set of source files. Meaning no changes to the source code are required merely a change of the program responsible for the transformation, in favor of another that is capable of producing the desired presentation format. Being adaptable. Mathematics has a heterogeneous field of applications. The usability of the MathDox format is greatly enhanced if it allows for adaptations to the format and the MathDox Player that would extend the functionality and make them suitable for other applications of the MathDox system. Representation of mathematics. The representation of mathematics occurring in the document has to include sufficient semantic information, such that the mathematics can be translated into several different formats for use by mathematical back engines or various forms of rendering. Ease of usage. The success of a format is mostly given by the ratio of richness of the format and the ease of usage. A format that does not offer much but is still easy to use will not gain much of popularity. The same goes for a rich format that is not easy to use. The users involved here are both the authors and the readers of the documents. For instance, users should not have to install any extra programs or plugins in order to read mathematical documents. At the same time authors should not have to much difficulty creating the documents. Creating an interactive web page is a programming task that many authors have trouble with. Therefore an interactive mathematical format should be designed so as to make this task as easy as possible for authors. Use of open standards. By following existing standards, a format benefits from other tried and proven technologies. It also helps to lower the learning curve considerably as compared to a completely new format. Which again directly assists in the previously discussed ease of usage of the format. Also the format itself should be open, so that every author will have direct access to all the specifics of the format used and is free to make adaptations if necessary. This will further expand the opportunities the format offers.

THE MATHDOX FORMAT MathDox sources combine in a modular way various existing XML formats best suited for our purposes. Each format contributes a useful facet for interactive documents. The main XML formats used in MathDox are:

 DocBook, for structuring documents  OpenMath, for semantic encoding of mathematics.  Xforms  Jelly, a programming and scripting format.

These formats, their use and purpose, will be discussed. DocBook DocBook is a well-known documentation standard, see (Walsh, 2004). Its logical structure facilitates searching and parsing of specific elements, enabling easy translation into other formats including HTML and PDF. This makes DocBook suitable for our needs. We have extended DocBook with some structuring for mathematical statements such as assertions, proofs, examples and the like. Here an example of a simple MathDox document. This is an example of a MathDox document containing a theorem The theorem … … and its proof.

OpenMath Within MathDox mathematics appears in various forms: Mathematics as used in computations by software packages or mathematics solely meant for the user to read or sometimes for both the computer and the user. For each type of usage one wants mathematics to have specific properties. In general a user will be able to grasp the meaning behind a, possibly ambiguous, mathematical expression. Computer software, however, will need its mathematics to be completely unambiguous, since it cannot benefit from the in the way a mathematically skilled reader does in order to solve gaps caused by incompleteness and ambiguity. OpenMath, see (Buswell et al, 2004) has been chosen as the main format for mathematics within MathDox documents. It is well suited because it is semantically rich, unambiguous, XML-based and can easily be transformed into other formats, such as MathML and LaTeX, which are better suited for presentation. These transformations allow MathDox documents to use OpenMath where semantics are important and switch to MathML or LaTeX, when the mathematics need to be presented to the user either on screen or on paper. Below you find the OpenMath expression for (1+x)/(x+x2 ). 1 2

This expression consists of OpenMath applications , symbols , variables and integers .The semantic information is hidden in the attribute cd of the symbols. This attribute refers to an OpenMath Content Dictionary containing the semantic information on the symbol. (The OpenMath CD's can be found at www.openmath.org/cd.) This semantic information enables easy translations between OpenMath and application specific syntax. In this way, we control the rendering of mathematical expressions. This rendering can be adapted to the needs of the specific user. But we can also translate the expressions to the syntax of a particular mathematical service. At the moment MathDox supports interaction with the computer algebra systems Mathematica (http://www.wolfram.com/), Maple (http://www.maplesoft.com/), GAP (http://www.gap-system.org/), Maxima (http://maxima.sourceforge.net/), Wiris (http://www.mathsformore.com/), Magma (http://magma.maths.usyd.edu.au/) and Singular (http://www.singular.uni-kl.de/) and, to some extend with the dynamic geometry systems GeoGebra (http://www.geogebra.org/) and Cinderella (http://cinderella.de/). See also (Caprotti, Cohen, Cuypers, Riem & Sterk, 2000).

XForms XForms (http://www.w3.org/TR/xforms11/) in MathDox documents supplies a means of interaction with the reader of the MathDox document. It allows for many interaction (form) elements which can be used for user input, such as text fields (also formulas), radio buttons, and drop down menus. In MathDox the XForms elements are used to trigger interaction with mathematical services like computer algebra systems. XForms is a recommendation of W3C and a successor to HTML-Forms. XForms is included into the XHTML 2.0 draft specifications. At this moment XForms is not yet properly supported by browsers, but work in this direction is in progress. For now the XForms code in MathDox documents is translated automatically by the MathDox Player into HTML forms supplemented by JavaScript. This translation is done by Orbeon Forms (http://www.orbeon.com/). Jelly To specify and fine-tune reactions of a MathDox document to user input, an author needs programming constructs. For this purpose Jelly (http://commons.apache.org/jelly/) has been included in the MathDox format. Jelly is a JSP-like XML-language (http://java.sun.com/products/jsp/), and has been developed as part of the Apache project (http://www.apache.org/). Jelly can be used for conditional statements, loops, variables, calls to Java (http://java.sun.com/) objects and calls to web services. For example, the input of a user can be inspected with the use of the Jelly to see whether it has the needed structure, setting certain parameters to trigger specific reactions. The following snippet of Jelly code produces the starting part of the Fibonacci sequence as shown just below the code.

This code yields the Fibonacci numbers less than m=4835847

1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 2178309 3524578

MATHDOX SOFTWARE So far we only discussed the MathDox format and just briefly mentioned the server-side software responsible for processing of this format. In this section we discuss the MathDox software. The MathDox Player is the main component of our software. It is responsible for making MathDox documents accessible over the web. Its task can be compared with that of a web server, in the sense that both a web server and the MathDox Player offer stored documents from the server to the outside world. The main difference between a normal web server and the MathDox Player is that a web server offers ready-made HTML files, whereas the MathDox Player dynamically creates these HTML files. On request of the user the MathDox server collects data from the source document, the user and from mathematical back engines providing services and creates, by applying a number of XSL transformations on this input, a new view on the document. The MathDox Player is implemented in Orbeon Forms (http://www.orbeon.com/), a Java Servlet application (http://java.sun.com/) that runs in a Java Servlet container like Apache's Tomcat and JBoss.

The user interface to the MathDox player is a modern web browser, like FireFox 3.x, IE 8, or Google Chrome. Interaction of the user is realized by the various options that HTML offers. These include various types of buttons, check boxes. text areas and links. However, there is no standard way to communicate mathematics in a meaningful way. Especially since we want to enable the interaction with various mathematical services offered by the system, we require the user to provide semantically rich mathematical expressions. To this end we have developed a formula editor, see www.mathdox.org/formulaeditor/.

The MathDox formula editor features:  a two-dimensional WYSIWYM (what you see, is what you mean) interface.  semantic representation of the formulas in OpenMath. The editor is written in Javascript and can easily be integrated in MathDox and HTML web pages.

Illustration 1: The MathDox Formula Editor

THE MATHDOX EXERCISE SYSTEM One of the main applications of MathDox is the MathDox exercise system. The XML format LEAMEL (Cohen et al, 2004) has been implemented in MathDox. This makes it possible to create highly interactive exercises, which can be graded automatically, and provide users with (intelligent) feedback. Basically there are two types of exercises possible; 'multiple choice' (where the user has to choose his answer from a list of options) and 'open questions' (where the user has to enter his own answer) and all kinds of combinations thereof. Within MathDox it is possible, with the use of a computer algebra system (or any other mathematical back engine), to compare the answers given by the user to that of the author of the exercise. The computer algebra system will also eliminate the problem that mathematical expressions can be written in many different ways while the semantic meaning remains the same. This allows for more complex answers and variations of the same answer as entered by the author. For instance, if the answer given by the reader is (x+1)2 where the author's answer to the question had been x2+2x+1, the answer given by the reader will not be marked as incorrect. The computer algebra system will evaluate the specified answer of the author and the answer of the reader as equivalent. Another advantage of MathDox is the possibility of randomising values used in the question and expected answer. In this way it is possible to generate a near infinite amount of exercises. MathDox also supports multiple step exercises. These exercises can be designed to capture mistakes and address them or correct the understanding of the user. Feedback provided in the exercise may vary from a hint, a reference to the theory, or by simplifying the question. Of course, it is also possible to increase the difficulty of an exercise as long as the user's answers are correct. In this way exercises adapt to the skills of the user. A MathDox exercise can be considered to be an automaton. The various states of the automaton, called interactions, are presented by the MathDox player as separate web pages to the user. These interactions may contain the question of an exercise, the feedback on a correct or wrong answer, or some hints. The transitions from one state into another, called answer_map are ruled by the actions of the user, and the results of various queries to mathematical services available within the exercise. We explain this by way of the following example:

Illustration 2: Adding fractions

This is the question of an exercise, it is the first state of the automaton that the user will encounter when starting up the exercise. Now the user may provide an answer, correct or incorrect. For each of these two possibilities the exercise contains an interaction, that the user is redirected to after supplying his answer. The XML-encoding of this exercise is given below.

Determine 14 16 512 Well done! Sorry, that is wrong.

The question is posed in the top interaction with id equal to “question”. In that interaction one also finds a userinput-tag. This tag represents an input field for the user. Inside the web page presenting this interaction the userinput-tag is replaced by the MathDox-formula editor, see below. The answer that the user can submit via this formula-editor is set to a variable with name the “answer”. In the answer_map at the end of the interaction, a query (to, for example, a CAS) is defined that checks whether the answer is equal to 5/12. This answer_map redirects the user either to the interaction with id “correct” in case the query returns a “true”, or the interaction with id “incorrect” otherwise. The latter interaction offers the possibility to try the exercise again.

Of course, we can extend the exercise with many more interactions, offering a great freedom for an author to provide not only the default feedback of an answer to correct or incorrect, but also for specialised feedback on common mistakes. Indeed, if a student adds both the denominator and enumerator and provides the answer `2/10', then we can add the adequate feedback in a new interaction.

Besides the checks performed by a CAS comparing answers with predefined correct solutions or solutions by common `buggy rules', we also need checks on the syntax of an answer. For example, what to do when a student provides the answer 1/4+1/6? Here our Jelly tools in combination with the OpenMath encoding of the answer come to help. Using the Jelly tag one checks whether the answer contains a symbol with name equal to 'plus' and can then give the appropriate comment.

The use of Jelly to do surgery on the student's answer is a very powerful tool in our exercise system. One can easily do extensive checks on the answer, but also retrieve subexpressions or the like. For example, if a student answers `1/4+1/6=5/12', then a straightforward check by a CAS whether this answer equals 5/12 would result in `false'. However, after the following check on the answer, one extracts the right hand side of the equation to be the answer, which then can be checked by the CAS.

Indeed, if the answer contains the equality-symbol, then the answer is set the last argument of the equality-symbol. The combination of queries to a CAS and applications of our Jelly tools makes it possible to do the following operations on OpenMath expressions: • check expressions to be equal • check an expression to be semantically equivalent to a given one; • analyze the syntax of an expression; • extract subexpressions of an answer; • check an expression on the occurrence or absence of a symbol. Indeed, all the checks described by Sangwin (2007) can be easily implemented, as well as many more.

MATHDOX AT WORK The MathDox software offers various ways to interarct with mathematical documents. However, it is not an e-learning environment. To combine the strength of MathDox with the facilities of an e-learning environment, we extended the MathDox exercise system with a scoring mechanism compatible with the SCORM-standard. This makes it possible to include MathDox pages and exercises in SCORM-packages and upload them in e-learning environments like Blackboard or Moodle. At Eindhoven University of Technology we have set up various e-learning sites based on the MathDox software embedded in a Moodle e-learning environment:

• Wortel TU/e; this is the open mathematical e-learning site of the Eindhoven University of Technolgy. Here one finds course material for various (undergraduate) courses at first year university level and for high school students. The site can be found at wortel.tue.nl. • Telmme; for the past couple of years there is a substantial increase of the number of students entering a masters program at one of the three dutch universities of technology who obtained their bachelor degree at another university or in an other country. One of the effects is that the group of students entering a masters program is very diverse, not in th least with respect to their mathematical background. To give students the possibilities to test their mathematical knowledge and require the necessary mathematical skills, the three dutch universities of technology offer online study material on mathematics via the e-learning site www.telmme.nl. • WisTU/e; on entering the Eindhoven University of Technology, all new students do take a test on mathematics. To prepare them for this test, they can practice at www.wistue.nl.

Il lustration 3: The Telmme e-learning environment

FUTURE RESEARCH DIRECTIONS Although the MathDox sofware system has already proven its usuability in various projects as mentioned in in the previous sections, there are still various aspects that require special attention. We mention a few.

The performance of the current MathDox is not yet optimal. Although some performance improvements have already been made, the search for further improvements will continue.

Presentation mathematics is focused on how the mathematics should look like, while semantic mathematics often tends to be imprecise on how to present the mathematics. In the MathDox Player we have almost reached the ideal mixture of presentation and semantic mathematics. However rendering OpenMath in a page gives the user sometimes a mechanical impression. This is mainly caused by the lack of presentation information in the OpenMath format. Indeed, the OpenMath expression

1 2 is rendered as 1+(-2), while in most cases one would prefer 1-2. Work is done to solve this kind of problems, by adding extra attributes to the OpenMath elements.

At the moment the MathDox Player is without any notion of context. Adding a context to the MathDox system would extend the capabilities of MathDox considerably. It would then become possible to keep track of a users skill level, preferences, and history and adapt content, notations, and used software on a MathDox page accordingly. The communication of a larger set of MathDox pages could also be optimized to benefit the user. Investigations of adding context to the MathDox system are ongoing.

The creation of XML documents in the MathDox format can be quite cumbersome. Therefore we are developing some authoring tools. The two main tools are a web based editor and a LaTeX-style that can automatically be translated into MathDox sources for not only static documents but also interactive example pages or exercises. An experimental version can be viewed at http://dam02.win.tue.nl/mathadore/mathdox/latex/index.mathdox This MathDox Editor is a web based editor for creating MathDox source code. The editor uses similar techniques as in popular (X)HTML editors like tinyMCE (.moxiecode.com) or FCKeditor (ckeditor.com), or the editor WYMEditor (www.wymeditor.org), which is more oriented towards semantics. It is described in (Cuypers, 2009). An online version is available at www.mathdox.org/MathDoxEditor.

CONCLUSIONS In this chapter we have discussed the MathDox system for interactive mathematical documents. We discussed both the MathDox document format as well as the software used to play MathDox documents. Moreover, some examples on how MathDox is used in e-learning are discussed.

REFERENCES Buswell,S. Caprotti, O. Carlisle, D.P., Dewar, M.C., Gaëtano, M. and Kohlhase, M., The OpenMath standard, Version 2.0, (2004), http://www.openmath.org/standard/om20-2004-06-30/

Caprotti, O., Cohen, A.M., & Riem, M. , Java phrasebooks for Computer Algebra and Automated Deduction, Sigsam Bulletin (2000).

Caprotti, O., Cohen, A. M., Cuypers, H., Riem, M. N., & Sterk, H. (2000). Using OpenMath servers for distributing mathematical computations. In Wei Chi Yang, Sung-Chi Chu & Jen-Chung Chuan (Eds.), ATCM 2000: Proceedings of the Fifth Asian Technology Conference in Mathematics, 2000, Chiang-Mai, Thailand, 325--336.

Cohen, A. M., Cuypers, H., & Sterk, H. (1999). Algebra Interactive. Berlin: Springer.

Cohen, A.M. Cuypers, H., Jibetean, D. & Spanbroek,M., LeActiveMath Exercise Language, Deliverable 7, LeActivemath, http://www.leactivemath.org/publications1.html (2004).

Cohen, A. M., Cuypers, H., Poels, K., Spanbroek, M. & Verrijzer, R. (2006). WExEd : WebALT exercise editor for multilingual mathematical exercises. Proceedings of the First WebALT Conference and Exhibition (WebALT2006, Eindhoven, The Netherlands, January 5-6, 2006), Electronic Library of Mathematics EMS.

Cohen A.M., Cuypers, H., Barreiro, E.R., Sterk, H. (2003) Interactive Mathematical Documents on the Web, in Algebra, Geometry and Software Systems (eds M. Joswig and N. Takayama), Springer Verlag, 289-306.

Cohen, A.M., Cuypers, H., Barreiro, E (2006) MathDox: mathematical documents on the web. In M. Kohlhase (Ed.), OMDoc: An Open Markup Format for Mathematical Documents (pp. 262-265) Berlin: Springer-Verlag.

Cuypers, H., Knopper, J.W., Spanbroek, M.,Verrijzer, R. (2008), MathDox - A System for Interactive Mathematics in Proceedings of Ed-media 2008, 5177-5182.

Cuypers, H., Knoper, J.W., Brouwer, M. MathDox Editor, Electronic proceedings MathUI 2009 http://www.activemath.org/workshops/MathUI/09/

Goguadze, G., Palomo, A. G., Melis, E.(2005) Interactivity of Exercises in ActiveMath Towards Sustainable and Scalable Educational Innovations Informed by the Learning Sciences Sharing. Good Practices of Research Experimentation and Innovation, Volume 133, Edited by Chee-Kit Looi, David Jonassen, Mitsuru Ikeda. Melis, E & Siekmann, J. Activemath: An intelligent tutoring system for mathematics. Proceedings of the International Conference on Artificial Intelligence and Soft Computing, 91-101.

Sangwin,C. STACK: making many fine judgements rapidly (2007).

Walsh, N. DocBook: The Definitive Guide, O'Reilly & Associates, Inc. 1999.