<human>: There are any things that might be causing this behavior, I'll try to explain as best as I can.

My beagle had been limping about 2 weeks ago and he was diagnosed by the vet with a torn ligament. We had been treating the injury with hot packs and it was looking a little better. 

Yesterday, he dog suddenly bit me when I was trying to take him away from the kitchen and I scolded him rather harshly (he has never bit me in the past 5-6 years and I was taken aback, not from the pain but more from the shock). Moments later he peed on the floor. I looked this kind of behavior online and was informed that this meant that the dog was being submissive and it was his way of saying sorry. He was not scolded or punished for peeing. Yesterday night, he refused to go to bed in his usual place and just sat in the kitchen barking. The barking would start only if he was not paid any attention and if I sat in the kitchen with him he would lie down and go to sleep. I only got him to go to bed after I kept a small biscuit in his bed.

Today, his limping was rather bad and we even gave him a painkiller as we had not seen him limping this bad. Today as we were about to go to sleep, he peed on the same exact spot as he did yesterday. This is after i had tried to take him for a walk but he refused to go. I had even tried right before he peed. Tonight, he is still insisting to go to the kitchen and is not able to because the door is locked and I still had to give him a biscuit to get him out of the kitchen.

Is the reason he's peeing inside due to the fact that he's in pain and it's difficult for him to go for walks outside. Is the fact that he got scolded anything to with it? And what may explain his odd behavior of not going to sleep?

Give me a shortened version of the text
<bot>: Dog peeing on floor and refusing to go to sleep in usual place. He was scolded because he bit me. Dog also has a torn ligament.