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



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

def self.primary_key
  'id'
end

Instance Method Details

#_read_attribute(key) ⇒ Object



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

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

#any_granted_rolesObject



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

def any_granted_roles
  []
end

#build_assignment(exercise, organization) ⇒ Object



112
113
114
# File 'lib/mumuki/domain/incognito.rb', line 112

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

#can_access_teacher_info_in?Boolean

Returns:

  • (Boolean)


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

def can_access_teacher_info_in?(*)
  false
end

#can_discuss_here?Boolean

Returns:

  • (Boolean)


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

def can_discuss_here?
  false
end

#can_discuss_in?Boolean

Returns:

  • (Boolean)


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

def can_discuss_in?(*)
  false
end

#current_immersive_context_and_content_at(_) ⇒ Object



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

def current_immersive_context_and_content_at(_)
  [nil, nil]
end

#current_immersive_context_at(_) ⇒ Object



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

def current_immersive_context_at(_)
  nil
end

#currently_in_exam?Boolean

Returns:

  • (Boolean)


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

def currently_in_exam?
  false
end

#ensure_enabled!Object

Permissions



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

def ensure_enabled!
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)


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

def has_accepted?(term)
  false
end

#has_role_terms_to_accept?Boolean

It avoids role terms acceptance redirections

Returns:

  • (Boolean)


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

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



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

def id
  '<incognito>'
end

#immersive_organizations_at(_, _ = nil) ⇒ Object



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

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

#immersive_organizations_with_content_at(_, _ = nil) ⇒ Object



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

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



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

def interpolations
  []
end

#is_a?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#moderator_here?Boolean

Returns:

  • (Boolean)


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

def moderator_here?
  false
end

#new_record?Boolean

Returns:

  • (Boolean)


137
138
139
# File 'lib/mumuki/domain/incognito.rb', line 137

def new_record?
  false
end

#next_exercise_at(guide) ⇒ Object

Progress



100
101
102
# File 'lib/mumuki/domain/incognito.rb', line 100

def next_exercise_at(guide)
  guide.exercises.first
end

#pending_siblings_at(content) ⇒ Object



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

def pending_siblings_at(content)
  []
end

#profile_completed?Boolean

Returns:

  • (Boolean)


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

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



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

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

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



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

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

#teacher_here?Boolean

Returns:

  • (Boolean)


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

def teacher_here?
  false
end

#teacher_of?Boolean

Returns:

  • (Boolean)


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

def teacher_of?(*)
  false
end

#visit!Object

Visiting



90
91
# File 'lib/mumuki/domain/incognito.rb', line 90

def visit!(*)
end

#writer?Boolean

Returns:

  • (Boolean)


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

def writer?
  false
end