Master Aqua knew that Sora and Riku were helping King Mickey to shut down Kingdom Hearts by Sora using the key of light from the realm of light and Riku closing it from the realm of darkness by Mickey's key of darkness. However, when Ansem was telling her that someone was saving the worlds from darkness and seeing the good before the bad, she thought that maybe it could've been Ventus awakening from his sleep or Terra making it out to the realm of light safely, especially since she was told by King Mickey in 0.2 that he couldn't find neither of them.
However, when she knew that it was Sora, she cried because of mix feelings between the fact that she misses her friends so badly that she was hoping that "the boy" could've been one of them and between the fact that she realized that the same boy who helped King Mickey to shut down Kingdom Hearts is still saving worlds out there. She felt that there is hope in this world even when neither her nor the other pupils of Master Eraqus were there to save the day.
So basically when she asked Ansem if the worlds were in danger, she was referring to KHII events since she already knew that King Mickey and the two kids have already saved the day during the events of KHI. And she asked about the boy's name because she didn't know that Sora was the one saving the worlds by that time, because she only knew that he was there to lock the door from his side.
but in 0.2 she knows Terra has been taken over by Xehanort, AND that he's searching for Ventus