On the Sora R3000 (and many modern cranksets) the axle, right hand crank arm and chainring spider are all one piece. The left hand crank arm fits on the splines on the axle, and is held in place by two pinch bolts. The thread you see in the hollow axle is for a plastic cap that is finger tightened to provide slight pre-load of the bottom bracket bearings.
See this Park Tool webpage, section 3 'Two Piece Compression Slotted Cranks' Also, here's the R300 crank installation manual.
If the crank was loose, the pinch bolts must have loosened. It sounds like you lost the pre-load cap, but check that the pinch bolts are still there also.
Now the bad news. When aluminum cranks come loose on a steel axle, the large pedaling force can very quickly deform or wear the splines in the crank arm. Your left crank arm may be ruined. This seems likely as there are aluminum filings visible in your picture. You can try re-installing the crank arm, but it it likely to come loose again. There's a link to a video on the Park Tool page that shows you how to do that. Of source you can also take this to a reputable bike repair show and have them assess the state of the crank arm.
The bottom bracket is separate from the right hand crank arm and axle. It may seem one piece, but the axle is quite a tight fit in the bearing races. Normally the end of the axle needs to be hit with mallet to get it out.
If you end up having to replace the crankset, the specific model of crank your bike has is the FC-R3030 (three speed, without chain guards). You may be able to find a used replacement left arm, but I'd definitely have a bike repair shop check the axle if you go that route.