From Memory Alpha:
In March of 2285, Saavik was a Starfleet cadet and, while mentored by Spock at Starfleet Academy, she underwent the Kobayashi Maru scenario. Despite an in-depth awareness of Starfleet regulations, she chose – during the test – to violate the Neutral Zone Treaty by venturing across the Klingon Neutral Zone in an attempt to rescue the freighter Kobayashi Maru, an action that resulted in the simulated deaths of all other officers in the bridge simulator. Afterwards, Saavik related to Admiral Kirk that she doubted the non-winnable simulation had been a fair test of her command abilities, though Saavik also conceded that she had not considered how possible such a situation was in reality.
Saavik was thereafter assigned aboard the Enterprise as navigator under Admiral Kirk, firstly in a training cruise that was then prematurely terminated so that the ship and crew could respond to the Genesis crisis. During these missions, Saavik was the highest-ranking cadet from a training crew on board the vessel. As such, she occasionally occupied the ship's command chair and was even permitted to supervise the vessel's departure from spacedock, which she had never done before.
This suggests that she was still technically an ungraduated cadet during these events, and her position aboard the Enterprise was part of a command-track placement, starting after taking the Kobayashi Maru.
It's also worth noting that cadets may take the Kobayashi Maru simulation multiple times if they so choose to (or are required to by tutors), and we do not know if this was Saavik's first attempt, or a later one.
Speculation: As Saavik was mentored by Spock, who in turn respected James T. Kirk, it is possible that Spock would encourage Saavik to take the test multiple times and see if the Vulcan would come up with a similar solution.