added logic to calculate rounds played in view

Moved where session[:user_id] was defined too