LOL. Jennifer's visual appraisal of what happened here is probably accurate. But I think the original poster learned some things he did not know before... And he seems to be a lesson that will stick...
@Muhammad Hassan A wrote:
What should I do now.Actually I was not solving his assignment but I was teaching him like a tutor.
I'm ok now but I just want to know how can I close this contract without hurting my jss.
As look as you were going to tutor this client, and NOT solve his assignment for him, then it is NOT a violation of Upworks TOS. The client may hurt themselves by how the job description was written. Because of that Upwork may close the job and suspend the client's account here. If that is the case, your connects will be returned to you and it will not affect your JSS.
If the job stays up, don't be so quick to close it. It's only been 2 days. Give it some time even though the deadline is approaching.