key: cord-0047265-05iojrar authors: Hamada, Tatsuyoshi; Nakagawa, Yoshiyuki; Tamura, Makoto title: Method to Create Multiple Choice Exercises for Computer Algebra System date: 2020-06-06 journal: Mathematical Software - ICMS 2020 DOI: 10.1007/978-3-030-52200-1_41 sha: 1540d0a59ec2fc32f272a7d2edc5696359fc0e06 doc_id: 47265 cord_uid: 05iojrar When studying mathematics, it is important to solve exercises of an appropriate level. Recently, web-based assessment systems with a computer algebra system (CAS), e.g., Moodle with Stack and the Möbius platform with Maple, have become popular. Such web-based systems are convenient; however, they have some problems relative to inputting and evaluating mathematical formulas. In addition, when considering and solving mathematical problems, handwriting mathematics is important. We want management system of paper-oriented exercises. Auto multiple choice (AMC), which was developed by Alexis Bienvenüe, is open source software for creating and managing multiple choice questionnaires with automated marking. [Image: see text] is the native AMC language for questionnaire descriptions. We propose to combine AMC and CAS using Lua [Image: see text] , which is a [Image: see text] -based computer typesetting system with an embedded Lua scripting engine. We can embed CAS scripts into Lua [Image: see text] source, and, by creating exercises with CAS, we can generate various problems with random coefficients or terms. By providing various patterns of practice problems and facilitating discussions with each student, we expect sufficient educational benefits of providing opportunities to communicate about mathematical concepts and algorithms among students. Exercises are important when learning mathematics, especially if we really want to understand something. We can find many exercises of various levels in textbooks. However, solving exercises in textbooks can be difficult for some students who are not good at calculations. Teachers must prepare and mark various levels of exercises for students. Feedback to students after evaluation should be given quickly; however, for many students, evaluation is very hard work for teachers. Recently, web-based assessment systems that use a computer algebra system (CAS), e.g., Moodle with Stack [1], which uses the Maxima [2] open source computer algebra system, and the Möbius platform [3] with Maple [4], have become popular. Creating exercises for web-based educational system has been investigated by Yoshitomi [5] , where he attempted to generate question data for linear algebra. However, with web-based systems, there are problems related to inputting and evaluating mathematical formulas. Some studies have investigated mathematical input methods, e.g., [6] [7] [8] [9] . However, there is no standard method for typical usage. In addition, handwritten work is important when considering and solving mathematical problems. We would like to exploit the power of CAS to create mathematical exercises with auto multiple choice (AMC), which was developed by Alexis Bienvenüe [10] . AMC is open source software for creating and managing multiple choice questionnaires with automated marking. L A T E X is the native AMC language for questionnaire descriptions. The potential of AMC has been examined by many researchers and educators, e.g., [11] and [12] . Milana Lima dos Santos et al. presented results from the application of examination papers for engineering courses developed using Matlab/Octave scripts and the AMC, [13] . The first and second author presented the applications of AMC at the workshop in Japan, [19] . We use LuaT E X [14] for AMC. LuaT E X is an extended version of pdfT E X that uses Lua as an embedded scripting language. Lua [15] is a powerful and lightweight scripting language, that supports procedural programming and data descriptions. Using Lua's "table" data structure, we can implement arrays, records, lists, queues and sets efficiently. In addition, we can embed Maxima scripts into LuaT E X source. Maxima is the most famous general purpose open source computer algebra system (cf. [16] ). By creating exercises using Maxima, we can generate various calculus problems with random coefficients or terms. By offering various practice problem pattern and facilitating discussions for each student, we expect sufficient educational effects of providing opportunities to communicate about mathematical concepts and algorithms among students. AMC is a set of utilities that use of multiple choice questionnaires written in plain text or L A T E X, as well automated correction and grading from scans of answer sheets using optical mark recognition. The following software packages are required to use AMC: L A T E X, the ImageMagick image processing libraries, OpenCV, and Perl with Gtk2-Perl and Glade::XML for the graphical user interface. AMC has effective documentation, the developers of AMC operate a community support website and French and English user forums. For users who are not ready to use L A T E X, AMC includes a filter to process simple plain text files in AMC-TXT format, which is a type of markdown script. However, we embed CAS script in L A T E X code (we do not use AMC-TXT). AMC can create questions and answers in random order for each sheet, and we can distribute unique exercises for each student. Mathematical questions with randomized statements are supported by the original AMC with the fp L A T E X package or LuaT E X. However, these are for random coefficients of fixed or floating point numbers, (not rational numbers), and they do not support mathematical symbolic formulations. Thus we must create naturally symbolic formulated exercises with rational numbers. Initially, it may a little time to create problems, because of the incomprehensible error messages of L A T E X and CAS. However, we can recycle sets of questions easily. Using automated grading and creating answers, teacher's time is much saved. We found that students are less likely to give up when using the proposed approach, in fact, even after the lecture, many students didn't give up for solving problems. In the following, we describe a simple example. In this source code, we changed the mark box to an oval using the \AMCboxDimensions L A T E X command, and the script of code acquisition was omitted. Code acquisition can be performed easily using the \AMCcodeGridInt[options]{key}{n} L A T E X command, e.g., to allow each student to enter her/his student id on an answer sheet. The \onecopy L A T E X command produces as many distinct realizations of the test as desired (10 in We used Maxima in LuaT E X to create exercises. LuaT E X supports Lua as embedded scripting. The io.popen() function of Lua is used to execute command line arguments. Note that this function is system dependent and is not available on all platforms. We used MathLibre [17] or the Debian GNU/Linux 10.3 "buster" release. One of the authors (Y. Nakagawa) is currently checking Lua scripting under Microsoft Windows (with some modifications). LuaT E X supports the \directlua command, which can sometimes be tricky. When executing Lua code within T E X using the \directlua command, there is no easy way to use the percent character, and counting backslashes can be difficult. We used luacode environments and the \luaexec command from the luacode package [18] . We set the default L A T E X engine using "lualatex --shell-escape" in AMC preferences to execute CAS script 1 . First, we call the environment luacode in our T E X source code. ¦ ¥ To fix the random seed to obtain the same results across different typesetting, we must set random seed after the egin{document}. § ¤ \ luaexec { math . randomseed (20200713)} ¦ ¥ We define the new execMaxima() function in luacode*. In this script, cmd is the argument for an arbitrary Maxima script. § ¤ \ begin { luacode *} function execMaxima ( cmd ) local texcmd =" echo ' tex1 (".. cmd .."); '| maxima --very -quiet " local hdl = io . popen ( texcmd , "r ") local content = string . gsub ( hdl : read ("* all ") , "\ n", "") hdl : close () return content end \ end { luacode *} ¦ ¥ We used Maxima in the article. However many of CASs support L A T E X formatting conventions; thus you can use your preferred CAS, e.g., Sage, Maple, or Mathematica. § ¤ The following example is a partial differentiation exercise. Here, coefficients a, b, s, t in this script are random numbers created using the Lua math.random() function. The string concatenation operator in Lua is denoted by two dots ('..'), the exp function represents an exponential function and diff(expr, x ) returns the derivative of expr relative to variable x in Maxima. § ¤ \ begin { question }{ pdiff01 } \ luaexec { a= math . random (2 , 9) ; b= math . random (2 , 9) ; s =( -1)^( math . random (0 , 1)); t =( -1)^( math . random (0 , 1)); g=s*a .. '* (Fig. 1) . This paper has proposed an automated approach to create several patterns of calculus exercises for different students at the undergraduate level. The primary advantages of the proposed approach are summarized as follows: -Initially, it may take a little time to create problems using this system. However with random coefficients and the CAS, we can recycle sets of questions, easily. -The proposed approach provides different types of problems for different student. -The proposed approach facilitates discussions about different problems for each student, and it provides opportunities to communicate about mathematical concepts and algorithms. -We found that students are less likely to give up when using the proposed approach. We believe that automatically creating mathematical exercises at appropriate levels is significant challenge in mathematical software research. The Scripts demonstrated in this paper are available at the GitHub public repository [20] . Generation of abundant multi-choice or STACK type questions using CAS for random assignments Intelligent editor for authoring educational materials in mathematics e-learning systems An implementation method of a CAS with a handwriting interface on tablet devices A touch-based mathematical expression editor Teaching of mathematics thanks to multiple choice questionnaires Exploring the possibilities of automated feedback for third level students/Esplorare le possibilita di feedback automatizzato per gli studenti universitari Automated design for engineering student examinations using Matlab/Octave scripts and the auto multiple choice package OSCAS: maxima An application of CAS for creating multiple choice exercises mc-calculus