It is well-established that both hot and cold temperatures can affect cognitive performance negatively. See for example these meta-analyses
- Falla et al., "The Effect of Cold Exposure on Cognitive Performance in Healthy Adults: A Systematic Review". Int. J. Environ. Res. Public Health. 18, 9725 (2021). https://doi.org/10.3390%2Fijerph18189725
The main findings of the current systematic review are that in most of
the experimental settings (either cold air or cold water) cold
exposure induced an impairment of CP [cognitive performance] even in healthy participants and
before accidental hypothermia was established. The majority of the
studies show that a single acute exposure to cold may impair
attention, speed of processing, memory and executive function and
these effects might depend on individual physiological responses to
cold as well as the extent of the exposure in terms of duration and
temperature reached. Despite the fact that data are scarce, males and
females seem to have a different response to cold exposure even in CP.
Repeated exposure and possible acclimation effect seems also to have
an impact on CP, but further studies are needed to confirm such
preliminary findings.
The current results indicate that both hot and cold temperature exposure had a negative effect on performance in a variety of different types of tasks. As expected, the greatest detriment in performance occurred under the coldest conditions (<55°F [10°C]) and the hottest conditions (>90°F [32.22°C] WBGT [Wet Bulb Globe Temperature]) - a 13.91% and a 14.88% average decrement, respectively. The Cold1 (50 - 64.9°F [10 - 18.28°C]) and Hot2 (80 - 89.9°F [26.67 - 32.17°C] WBGT) temperature conditions resulted in a smaller decrement in performance, whereas the Hot1 (70 - 79.9°F [21.11 - 26.62°C] WBGT) temperature condition had little effect on performance.
Furthermore, the effects of temperature exposure on performance varied by the type of task. Cold exposure (<65°F [18.33°C]) resulted in a large negative effect on performance on reasoning, learning, and memory tasks whereas exposure to hot environments of 80°F (26.67°C) WBGT or above on average resulted in a small improvement in performance on these types of tasks. In contrast, attentional and perceptual tasks were more negatively affected by hot exposure (>80°F [26.67°C] WBGT) than by cold exposure. Similarly, performance on mathematical tasks and
on reaction time tasks was negatively affected by hot exposure (>80°F [26.67°C] WBGT) but not by cold exposure. Although these data may seem confusing when attempting to break them down as was done in tables 4 and 5, figure 1 provides an easy way to estimate the effect of temperature exposure on performance. This inverted-U shaped function may be especially useful when examining a typical work environment where the employee may be involved in a variety of tasks and a variety of environmental conditions, such as length of task duration or length of temperature exposure, simultaneously. In this type of real world setting, figure 1
provides the best estimate of the effect of temperature exposure on performance.

I have to confess I don't understand how mathematical tasks are defined in order to be so disjoint from reasoning tasks...
I would also note that test taking often involves fine motor skills such as handwriting, drawing etc. that are harder to perform in cold temperatures. My impression is that the meta-analyses tried to focus mainly on cognitive effects. Thus the above effect sizes may underestimate the impacts on exam performance. In addition, the stress of suddenly finding out one needs to take a test in adverse conditions may well affect one's performance too. Thus, especially in light of the individual and gender-based differences in physiological responses highlighted by Falla et al., a simple scaling of exam results seems unlikely to recover the expected scores had the exam been held under normal conditions, even if we assume no students were affected by hypothermia or preexisting medical conditions.