Batch generation of calculation problems

learning box, SCORM, Multi-choice question (radio button), Admin Blog

Good morning, this is Nishimura from QuizGenerator.
In this case.Create calculation problems at once with QuizGeneratorMethods.

Let's make a question file for QuizGenerator.

SCORMI thought about writing an article about how to make teaching materials of SCORM format, but it is quite difficult to make SCORM format teaching materials from scratch. So, this time, I'd like to try to generate QuizGenerator question files automatically.(If I made it from scratch, it wouldn't be appropriate for an article on this site.)

Create with JavaScript

To make a problem file in one go, you can use Excel, PHP, Python, etc., but it's better to do it easily in a browser, so this time we'll try making it in JavaScript.

What is a calculation problem?

A calculation problem is one in which you are asked to answer the result of a mathematical equation, but we don't want to make it too complicated, so in this case we will use a problem in which two numbers are connected by one of the symbols +-✕. We will also adjust the difficulty level by specifying the range of the two numbers.

Create a function

Create a function that generates a calculation problem.

The function to make data for one question is called makeQuiz(min,max,op), and the function to make data for n questions is called makeQuizN(min,max,op,n).

The arguments of makeQuizN are as follows, respectively.

  • min: lower limit of values: specified as an integer
  • max: Upper limit of values: as an integer
  • op: type of operator: specified by one of "+", "*".
  • n: number of questions: specify a number greater than or equal to 1
  • The code is as follows

    Turn on the UI

    Vue and React are very popular these days, but let's try jQuery.

    It's done!

    Number of questions :
    Minimum :
    Max :

    Let's go public!

    You can use the created teaching material file in QuizGenerator'sconversion screenYou can upload and publish to

    Sign me up for the learningBOX!

    You can register QuizGenerator as a learning tool in your learningBOX, where you can assign it only to the learners you specify and keep a record of their learning.

    Next Article.

    This time, I made one specializing in addition and multiplication, but since it is more convenient to have subtraction and division, I will make it include all four arithmetic operations. Also, since it's a calculation problem, I'm planning to make it so that you can choose not only a choice, but also a descriptive question. After that, I plan to write an article that is a little more similar to SCORM.


    In this article, we created a question file for QuizGenerator using javaScript. quizGenerator can create questions as text files, so by using Excel or some other programming language, not only JavaScript The QuizGenerator can create questions in text files, so you can use not only JavaScript but also Excel or some other programming language to convert existing content into SCORM materials, or to generate a large number of questions based on certain rules. When you're creating something, you can get the most out of it with the least amount of effort by connecting it to existing systems, rather than having to create everything from scratch yourself. I hope we can reuse it!

    For the source code that we have created, please refer to the full version atGitHubPlease feel free to use it as it is open to the public.