There are at least three "surprise" tests we have seen Starfleet use for either cadet or command candidates. Any Trek fan is quite familiar with the Koyabashi Maru. In the Star Trek: The Next Generation episode Coming of Age, Wesley Crusher steps into a room for test, then hears an explosion and has to pick which of two people he will save. It turns out that decision was a test. In Thine Own Self, Counselor Troi is trying to become a bridge officer and goes through a holodeck simulation a number of times, each time with the Enterprise exploding until she finally gives the holographic Geordi an order to do something when she knows he won't survive.
In The Wrath of Khan, Saavik talks about how the Maru is a bad test of her command abilities. She seems to have gone into the test quite unaware of what it was about or that it was intended to be a no-win scenario. It would seem a large part of the goal of either test would be eroded if the candidate knew, ahead of time, what the test was about and what the goal was for those evaluating the test taker. If Wesley knew he was going to be tested on his worst fear, he could have prepared for it. If Troi knew what the goal was in her test, she could have easily passed it the first time she went through the simulation.
While many institutions have an honor code and expect people to not discuss tests they've taken until students in other classes have taken that same test, usually there's no need to specify, "Do not discuss this test with people who will be taking the course next year."
Is there any mention, anywhere in Trek, or any indication there is anything like a non-disclosure agreement for people who have taken these surprise tests? Or maybe an indication the content of the test is considered confidential or secure material not to be discussed with anyone who had not taken these or similar surprise tests?