Class: Course::Assessment::Submission::Log

Inherits:
ApplicationRecord show all
Defined in:
app/models/course/assessment/submission/log.rb

Instance Method Summary collapse

Instance Method Details

#ip_addressObject


8
9
10
# File 'app/models/course/assessment/submission/log.rb', line 8

def ip_address
  request['HTTP_X_FORWARDED_FOR']
end

#submission_session_idObject


20
21
22
# File 'app/models/course/assessment/submission/log.rb', line 20

def submission_session_id
  request['SUBMISSION_SESSION_ID']
end

#user_agentObject


12
13
14
# File 'app/models/course/assessment/submission/log.rb', line 12

def user_agent
  request['HTTP_USER_AGENT']
end

#user_session_idObject


16
17
18
# File 'app/models/course/assessment/submission/log.rb', line 16

def user_session_id
  request['USER_SESSION_ID']
end

#valid_attempt?Boolean

Returns:

  • (Boolean)

24
25
26
# File 'app/models/course/assessment/submission/log.rb', line 24

def valid_attempt?
  user_session_id == submission_session_id
end