Academic performance Is there any literature suggesting a relationship between academic performance and cognitive function?

I'm trying to find something that suggests which cognitive functions/domains are typically utilized when taking school exams. Obviously this will depend heavily on the nature of the exam, but are there any studies that have looked at this generally?

For example, do people that perform better on exams also perform better on computer based tasks assessing working memory, or ignoring visual distractors etc? Hence allowing you to narrow down the specific set of cognitive functions associated with taking an exam?

EDIT: by cognitive function, I'm referring to things like working memory, sustained attention, executive function, spatial processing. Not so much IQ or any measures of intelligence
If by cognitive function you mean IQ, then that's most of the focus of the intelligence research, as in the main motivation to study IQ. In one large UK study of children the correlation was 0.81.
But there are personality factors influencing academic performance as well. Even with respect to IQ [as measured in pracice], it is suspected that it is influenced in part by motivation, which itself may be an interaction between personality and the context/environment. And to the extent that self-discipline is different than [short-term] motivation, some research suggest it may matter even more for academic performance.