How to mass create information WITH CODE for Collections?

Hi!

I’m creating a math program and I have a question on a very important thing. I’m creating over 2,000 questions in a question bank for my math program. How would I use code to create about 20 question per math skill, like this:

Let’s take a simple topic like multiplication. Instead of me manually opening up the collection and literally creating 20 items, each one having a question field, an answer field, and a question ID field (basically the number that the question was created in line, so the 50th question created by the code would have an ID of 50). How could I create that?


I made those items in the picture above manually, but how could I have a system do that automatically for me? So I’d end up with 2,000 different questions about plenty of math topics.

Add hook, and use eval() in JavaScript (convert to math calculation) . Your string only need the text before equal sign to pass to eval

The hook is beforeInsert or afterInsert

You only need the pass the question in this case

I appreciate it. The only thing is I have no experience with Javascript, so I’m not sure what I’d use for code. Could I have the code for this?

Alternatively, search if online have some “problems” generator

That’s hard to explain in a short time. If you want to learn coding, visit the Getting Started Tab of this forum.

If you just want to get it done for this project only, hire a professional on Wix Marketplace

To learn about programming with Velo, read the following articles that will help you start working with Velo: