Story in the middle of sprint
I have a question about what to do when one person was sick leave and was not present at the sprint planning and we did not know when she would return. When she came back we put one story in sprint so that she would have what to do, but in the end we didn't manage to do it and we gave it out. Is that okay or not? And what is being done in this case. This is written by someone who is new to this role and has homework to investigate this, so any comments will be helpful, thank you.
This sounds like you're planning on individuals and not the team.
When someone is going to be (possibly) absent for some or all of the Sprint, the team does need to consider the reduced capacity. Someone not being there reduces the knowledge and abilities of the team. Even if other people have overlapping knowledge and skills, there's a reduced capacity to get things done that need to be considered. In cases where the possible absence is known, I've found it helpful to consider them as being unavailable for the whole Sprint. It lets the team craft a Sprint Goal and select supporting Product Backlog Items while mitigating risks.
If the person does come back and become available mid-Sprint, there's no need to pull in additional work. The team, as a whole, is committed to the goal. The person returning can contribute to the team's work toward that goal. If the goal is met early, then the team can decide what to do with the remaining time. There are plenty of discussions around what to do when the team has achieved its goal and all of the selected Product Backlog Items are complete.
I have a question about what to do when one person was sick leave and was not present at the sprint planning and we did not know when she would return.
Were the Developers confident that they could meet their Sprint Goal commitment, even if she did not return?
When she came back we put one story in sprint so that she would have what to do,
She already did have work to do: helping her fellow Developers meet the Sprint Goal they had committed to in Sprint Planning.
If the Sprint Goal has already been met and a Done increment produced, the Developers can do pretty much whatever they want, because their commitments have been met.
In Scrum, the Sprint is not planned so that every Developer has something to work on. The plan is for all of the Developers to commit to delivering a usable increment of value to the stakeholders. The Scrum Team develops a Sprint Goal to communicate the reason that this Sprint is needed. By using the guidance of the Product Owner, the Developers will pull a subset of Product Backlog Items into the Sprint Backlog. They will develop a plan for doing the work needed to complete those items.
No where in the Sprint Guide does it state that every Developer should "have a story". Nor does it say that every Developer should be "fully utilized". And it definitely doesn't say that each Developer must work to max capacity.
In the case that you described, I can come up with a number of things that the Developer could have done. They could have spent some time refining items in the Product Backlog. They could have spent some time reviewing code that they have not worked on to become familiar with it. They could have paired with another Developer to finish some of the code in progress. They could have spent some time investigating new technologies that the team has interest in using. They could have spent some time buying down some technical debt. There are a number of things that they could have done that would help the Scrum Team improve their abilities to deliver a better Product.
Daily Standup is to discuss the progress and work on Impediments. I hope it was discussed during daily standup. It's a team work and other team members can always assist finishing the task. Pending task could be carried over to the next sprint after discussing with the whole team if there's time to deploy.