District public school students in the eighth grade have scored above the national average in mathematics on comprehensive standardized tests for the first time, school officials announced yesterday.

Officials attributed the gain to a back-to-basics curriculum started in the city's schools in 1979, as well as improved attendance among students and increased motivation of teachers. Last year the eighth graders were two months behind their grade level in math. This year they were a month ahead.

The eighth graders, however, scored below their grade level on all other parts of the test, including reading and language skills.

Third and sixth graders continued to score above the national norms in math, language and reading, exceeding the national average by as much as nine months in language skills.

Academic trouble still remains at the ninth and 11th grade levels, where scores continued to be below the national level although this year's scores improved "substantially" from last year, officials said.

"We're proud of what the eighth graders accomplished this year," said James Guines, assistant superintendent of instruction. "These same students two years ago were the first sixth grade class to exceed the national norm," he said.

As sixth graders, they scored a month ahead of the national average in reading and five months ahead in math while their overall score on the tests exceeded the national norms by four months, Guines said.

The Comprehensive Tests of Basic Skills is given in the eighth month of each school year and the results are keyed to grade-level equivalents. For example, the national norm is 3.8 for the eighth month of the third grade and 6.8 for the eighth month of the sixth grade.

The examination is designed to test reading, mathematics, language, science, social studies and reference skills.

School officials attribute the continuing poor performance of older students to the fact that they began attending school at a time when students were passed on to higher grades without real regard to their understanding of basic skills such as reading and math.

In 1979 the school system began a curriculum to emphasize basic skills such as reading and math. Two years later, officials implemented a plan that required elementary students to meet certain educational goals each semester.

In 1982, the program, called "Competency Based Curriculum," was credited with pulling up the scores of third and sixth graders to the national norm for the first time and in subsequent years, as those students moved through the system they have continued to match or exceed their national counterparts on tests.

Better attendance among students and increased motivation of teachers also have improved test scores, D.C. Schools Superintendent Floretta McKenzie and school board president R. David Hall said at a news conference yesterday at school headquarters.

Hall and McKenzie emphasized that, as a result of a systematic campaign to convince teachers that previously low-achieving students "can indeed learn," more teachers are working harder to make sure that pupils achieve to their potential.

McKenzie also said that because of high unemployment among blacks, teachers at city public schools, where a majority of the students are poor and black, have a hard time convincing pupils to do their best. "Some students don't think it makes a whole lot of sense to study hard and stay in school. But we're trying to move them from hopelessness about jobs and about going to post-secondary education," she said.

Brookland Junior High School, on Michigan Avenue NE, showed the greatest improvement among all junior high schools in math. Last year eighth graders scored 7.8 on that test, while this year's scores were 8.9, a gain that brought them above the national norm by one month.

Some of the city's junior high schools, such as Hardy in upper Northwest, had eighth graders scoring at the 11th grade level in math, while across the city at Douglass Junior High School in Southeast eighth graders scored at the seventh grade level.

Anacostia High School, located in far Southeast, showed the greatest improvement in test scores among all high schools, according to officials. For example, last year, 11th graders at Anacostia scored 7.9 in math skills. This year's scores were 9.5, or a gain of more than a year, although the students are still below their grade level.

"We really needed improvement . . . . We didn't teach the test, but we analyzed it," Anacostia Principal Clyde Gray said in an interview yesterday. "We assigned days and worked at certain identified areas of efficiency. And we made sure that our teachers were teaching all the basic skills in all the classes. So in reading, every opportunity a teacher had, he or she would teach math skills as well as reading and so on."