I have one quiz in a course. and user can attempt quiz once. I want when i un-enroll user from course and re enrol into course then user should have option to attempt that quiz again but his previous attempt record should be there
When you go to enrol them, expand 'enrollment options' and uncheck 'Recover user's old grades if possible'
I think you'd need to set up an override for that student; recovering grades when re-enroling would mean the quiz has already been attempted.
Is this for annual compliance training or similar by any chance?