Class: Mumuki::Domain::IncognitoClass

Inherits:
Object
  • Object
show all
Defined in:
lib/mumuki/domain/incognito.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.primary_keyObject



157
158
159
# File 'lib/mumuki/domain/incognito.rb', line 157

def self.primary_key
  'id'
end

Instance Method Details

#_read_attribute(key) ⇒ Object



148
149
150
151
# File 'lib/mumuki/domain/incognito.rb', line 148

def _read_attribute(key)
  return id if key == 'id'
  raise "unknown attribute #{key}"
end

#any_granted_rolesObject



83
84
85
# File 'lib/mumuki/domain/incognito.rb', line 83

def any_granted_roles
  []
end

#build_assignment(exercise, organization) ⇒ Object



128
129
130
# File 'lib/mumuki/domain/incognito.rb', line 128

def build_assignment(exercise, organization)
  Assignment.build_for(self, exercise, organization)
end

#can_access_teacher_info_in?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/mumuki/domain/incognito.rb', line 63

def can_access_teacher_info_in?(*)
  false
end

#can_discuss_here?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/mumuki/domain/incognito.rb', line 55

def can_discuss_here?
  false
end

#can_discuss_in?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/mumuki/domain/incognito.rb', line 59

def can_discuss_in?(*)
  false
end

#current_immersive_context_and_content_at(_) ⇒ Object



71
72
73
# File 'lib/mumuki/domain/incognito.rb', line 71

def current_immersive_context_and_content_at(_)
  [nil, nil]
end

#current_immersive_context_at(_) ⇒ Object



67
68
69
# File 'lib/mumuki/domain/incognito.rb', line 67

def current_immersive_context_at(_)
  nil
end

#currently_in_exam?Boolean

Returns:

  • (Boolean)


109
110
111
# File 'lib/mumuki/domain/incognito.rb', line 109

def currently_in_exam?
  false
end

#ensure_enabled!Object

Permissions



12
13
# File 'lib/mumuki/domain/incognito.rb', line 12

def ensure_enabled!
end

#ex_student_here?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/mumuki/domain/incognito.rb', line 23

def ex_student_here?
  false
end

#ex_student_of?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/mumuki/domain/incognito.rb', line 19

def ex_student_of?(*)
  false
end

#has_accepted?(term) ⇒ Boolean

It makes terms UI to be shown as if no terms were accepted It does not force any term to be accepted though

Returns:

  • (Boolean)


98
99
100
# File 'lib/mumuki/domain/incognito.rb', line 98

def has_accepted?(term)
  false
end

#has_role_terms_to_accept?Boolean

It avoids role terms acceptance redirections

Returns:

  • (Boolean)


92
93
94
# File 'lib/mumuki/domain/incognito.rb', line 92

def has_role_terms_to_accept?
  false
end

#has_student_granted_organizations?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/mumuki/domain/incognito.rb', line 15

def has_student_granted_organizations?
  false
end

#idObject

ActiveRecord



140
141
142
# File 'lib/mumuki/domain/incognito.rb', line 140

def id
  '<incognito>'
end

#immersive_organizations_at(_, _ = nil) ⇒ Object



79
80
81
# File 'lib/mumuki/domain/incognito.rb', line 79

def immersive_organizations_at(_, _ = nil)
  []
end

#immersive_organizations_with_content_at(_, _ = nil) ⇒ Object



75
76
77
# File 'lib/mumuki/domain/incognito.rb', line 75

def immersive_organizations_with_content_at(_, _ = nil)
  []
end

#incognito?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/mumuki/domain/incognito.rb', line 4

def incognito?
  true
end

#interpolationsObject

Evaluation



165
166
167
# File 'lib/mumuki/domain/incognito.rb', line 165

def interpolations
  []
end

#is_a?(other) ⇒ Boolean

Returns:

  • (Boolean)


144
145
146
# File 'lib/mumuki/domain/incognito.rb', line 144

def is_a?(other)
  other.is_a?(Class) && other.name == 'User' || super
end

#moderator_here?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/mumuki/domain/incognito.rb', line 51

def moderator_here?
  false
end

#new_record?Boolean

Returns:

  • (Boolean)


153
154
155
# File 'lib/mumuki/domain/incognito.rb', line 153

def new_record?
  false
end

#next_exercise_at(guide) ⇒ Object

Progress



116
117
118
# File 'lib/mumuki/domain/incognito.rb', line 116

def next_exercise_at(guide)
  guide.exercises.first
end

#pending_siblings_at(content) ⇒ Object



132
133
134
# File 'lib/mumuki/domain/incognito.rb', line 132

def pending_siblings_at(content)
  []
end

#profile_completed?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/mumuki/domain/incognito.rb', line 43

def profile_completed?
  true
end

#progress_at(content, organization) ⇒ Object

def completed_containers_with_lookahead(*)

raise 'Unsupported operation. Userless mode and progressive display modes are incompatible'

end



124
125
126
# File 'lib/mumuki/domain/incognito.rb', line 124

def progress_at(content, organization)
  Indicator.new content: content, organization: organization
end

#run_submission!(submission, assignment, evaluation) ⇒ Object



169
170
171
172
173
# File 'lib/mumuki/domain/incognito.rb', line 169

def run_submission!(submission, assignment, evaluation)
  results = submission.dry_run! assignment, evaluation
  assignment.assign_attributes results
  results
end

#student_here?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/mumuki/domain/incognito.rb', line 31

def student_here?
  false
end

#student_of?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/mumuki/domain/incognito.rb', line 27

def student_of?(*)
  false
end

#teacher_here?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/mumuki/domain/incognito.rb', line 35

def teacher_here?
  false
end

#teacher_of?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/mumuki/domain/incognito.rb', line 39

def teacher_of?(*)
  false
end

#visit!Object

Visiting



106
107
# File 'lib/mumuki/domain/incognito.rb', line 106

def visit!(*)
end

#writer?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/mumuki/domain/incognito.rb', line 47

def writer?
  false
end