Thanks for asking.
Based on your query, my opinion is as follows.
1. Sharp pains during passage of stools and later cramps feeling, feels like an ulcer in rectum
2. Due to passage of hard stools in previous days, mucosal damage might have occurred leading to ulcer.
3. Mild blood will also be present. Usage of local lignocaine, or Vaseline will help. Take soft foods for a week. Meet a surgeon, if pain persists.
Hope it helps.
Any further queries, happy to help again.