How to show whether there is a difference in test scores between two groups as time progresses? The primary data I have are test scores. The test was given to the participants three times, with results ranging from 0 to 10. The participants were divided into two groups (A and B, simply; randomly assigned). I also have several variables about participants' socio-demographic information such as gender and age.
The primary hypothesis is that the mean test scores of participants in Group B improve over time (unlike those in Group A).
I believe I will eventually need to use a regression model, but I'm not sure which regression model I should use to show whether my hypothesis is correct. I think I should include the group variable as one of the independent variables, but I'm not sure how to define the dependent variable in this case. Or ... should I consider the repeated measures ANOVA?
Looking forward to hearing from you all.

You can try a repeated-measurements model, implemented using mixed models. Leaving out gender, age, ... (which you can add in) we start with
$$
   y_{it} = \mu + \theta B_i + \epsilon_i + \alpha B_i t +\epsilon_{it}
$$
where $i$ is subject, $t$ is time, $B_i$ is an indicator for belonging to group $B$, $\epsilon_i$ is a random effect for subject and $\epsilon_{it}$ an error term. This model enforces that the mean is constant with time for group $A$ (as stated), to avoid that include a fixed effect for time $t$.
This could be fitted in R with something like
lme4::lmer(Y ~ B + B:t + (1 | id), data=yourdata)

