I worked on a grant looking at math skills and correlating with language, gender, age, and other factors amongst three population groups (white, hispanic, and navaho). We followed a group of third graders through the fifth grade, and a group of sixth graders through the eighth grade. Very interesting stuff, and at least in my corner of the US it was very obvious that as students moved on in school they liked math less, felt it had less value, and also performed worse on the tests. In the third grade group almost everyone believed that math was important, that they would use it in their jobs, and stated that they liked math. By the eighth grade only a few still felt this way, and of those almost all were boys. I was the programmer, created the test instruments, database for the results, etc, so I never saw the entire set of results, but heard that the young cohort pretty much proved that there was very little gender or cultural bias against math aside from poverty (which interestingly seemed to indicate a dislike of it).
I've noticed several design suggestions in your code.