function should run every time button is clicked

I have a form that, when submitted, the form should disappear and another button should show up. That button (multiStartBtn) disappears when click and a (1) a math problem shows up and (2) a form field and button should appear (button = multiAnsSubmitBtn)

Then, the user will put in a value in to the form field and submit. When they submit, a new math problem shows up in the question block.

This happens as expected the first time around. But after a new question shows up in the questionBlock, none of it works anymore.

I feel like I am making this more complicated than it needs to be, but I can't find the issue.

ChatGPT keeps telling me to add a flag, so I have done that, but somehow I feel like this isn't fully working properly either.

Does anybody have any ideas of what is going on and can send me in the right direction?

Thank you!

multiForm.addEventListener("submit", function (event) {
    event.preventDefault();
    // Get the min and max values from the form inputs
    multiMin = Number(document.getElementById("wsf-1-field-117").value);
    multiMax = Number(document.getElementById("wsf-1-field-113").value);
    multiTotalProblems = Number(
        document.getElementById("wsf-1-field-111").value
    );

    // Hide the form and show the answer, start and problem block
    multiFormWrapper.innerHTML = `<p>${multiTotalProblems} exercises. Lowest factor = ${multiMin}. 
            Highest factor = ${multiMax}</p>`;
    multiAnsForm.style.display = "block";
    questionBlock.style.display = "inline-block";
    multiStartBtn.style.display = "block";
});

function generateProblem() {
    multiNum1 = Math.floor(
        Math.random() * (multiMax - multiMin + 1) + multiMin
    );
    multiNum2 = Math.floor(
        Math.random() * (multiMax - multiMin + 1) + multiMin
    );
    multiQuestionBlock.textContent = `${multiNum1} X ${multiNum2} = `;
}

multiStartBtn.addEventListener("click", function () {
    answerForm.style.display = "block";
    generateProblem();
    multiStartBtn.style.display = "none";
    multiAnsSubmitBtn = document.getElementById("wsf-2-field-116");


if (!isListenerAdded && multiAnsSubmitBtn) {
    multiAnsSubmitBtn.addEventListener("click", function () {
        multiAns = document.getElementById("wsf-2-field-115").value;
        console.log("clicked");
        console.log(multiAns)
        generateProblem();
    });
    isListenerAdded = true;
    
}
    
});