Feature Creep 2026, 03 - A Mental Math Trainer - Timer and Server

I'm planning to make some webapps that live... here, eventually, if I can get around a commercial website builder. The easiest of these is probably this: A mental math training application. It's basically a glorified latex generator and eval function caller. Still, I would like to use the opportunity to try out some frameworks, as long as these projects don't need to be at all scalable.

So first of all, I need to write the eval function. In its most basic form, the application will basically end up randomly generating an equation, and checking its own conclusion against user input. We take user input as a string, so machine output will also be converted to a string, and we can get to filter user input, relatively easily. The checking function will look a little like this:

boolean compare_eval(String: correct_result) {
  String user_result = get_user_input();
  if (user_result == correct_result) {
    return true;
  }
  return false;
}

Not sure what language I'm going to do this in yet, so a java-esque syntax probably won't hurt anyone. I would love a fully python backend, so I can use all the scipy-stuff, but perhaps there's a javascripty solution to this problem. Even though I'm likely only testing it with very easy equations at first, I might as well try to do the LaTeX from the very beginning. I'm using mathjax, in conjunction with what's basically the String.eval() function. These, I gather, are standard tools, so I'd do well to learn how they work. I would love to place the eval function on the server, so it can't be messed with, but I'm primarily concerned with a fast and convenient to carry webapp that doesn't do as many server requests as I can.

I'm honestly a little out of practice on starting a new project. I have that thing that people profess to having when they look at a blank sheet of paper, but apparently only for empty repositories. I decided on going with an express.js server,

const express = require("express")
const app = express();

app.use("/", (req, res, nex) => {
    res.send("Express server response");
})

app.get("/result", (req, res, nex) => {
    res.send("result received");
})

app.listen((3000), () => {
    console.log("Server is Running");
})

and then coded a quick timer class. I want the app to measure the time the user needed for this session, but also know how many problems were solved. I'm not sure on how I'm deciding which problems the user should be expected to solve without taking notes, but the point should be to solve the problem without a calculator.

class Timer {
    constructor() {
        this.start = -1;
        this.arrays = []
    }

    trigger() {
        note = Date.now();
        this.arrays.push( note - this.start );
        this.start = note
    }

    double get_total() {
        sum = 0;
        for (i in this.arrays) {
            sum += i;
        }
        return sum;
    }
    
}