To end sharing, click "End Sharing" next to the relevant document in an exercise. In the new pop-up window, you can end sharing immediately by clicking "Confirm", even before the set sharing period expires.
More information about the release of documents can be found
here.