Class: Qti::Models::AssessmentMeta

Inherits:
Base
  • Object
show all
Defined in:
lib/qti/models/assessment_meta.rb

Instance Attribute Summary

Attributes inherited from Base

#doc, #manifest, #package_root, #path, #resource

Instance Method Summary collapse

Methods inherited from Base

#css_with_single_check, from_path!, #initialize, #parse_html, #parse_xml, #preprocess_xml_doc, #raise_unsupported, #remap_href_path, #sanitize_content!, #xpath_with_single_check

Constructor Details

This class inherits a constructor from Qti::Models::Base

Instance Method Details

#access_codeObject



144
145
146
147
148
# File 'lib/qti/models/assessment_meta.rb', line 144

def access_code
  code = sanitize_content!(tag_under_quiz('access_code'))
  return nil if code.to_s.empty?
  code
end

#allowed_attemptsObject



68
69
70
# File 'lib/qti/models/assessment_meta.rb', line 68

def allowed_attempts
  allowed_attempts_raw.to_i
end

#allowed_attempts_rawObject



64
65
66
# File 'lib/qti/models/assessment_meta.rb', line 64

def allowed_attempts_raw
  tag_under_quiz('allowed_attempts')
end

#anonymous_submissionsObject



48
49
50
# File 'lib/qti/models/assessment_meta.rb', line 48

def anonymous_submissions
  tag_under_quiz('anonymous_submissions')
end

#anonymous_submissions?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/qti/models/assessment_meta.rb', line 52

def anonymous_submissions?
  string_true?(anonymous_submissions)
end

#availableObject



88
89
90
# File 'lib/qti/models/assessment_meta.rb', line 88

def available
  tag_under_quiz('available')
end

#available?Boolean

Returns:

  • (Boolean)


92
93
94
# File 'lib/qti/models/assessment_meta.rb', line 92

def available?
  string_true?(available)
end

#cant_go_backObject



80
81
82
# File 'lib/qti/models/assessment_meta.rb', line 80

def cant_go_back
  tag_under_quiz('cant_go_back')
end

#cant_go_back?Boolean

Returns:

  • (Boolean)


84
85
86
# File 'lib/qti/models/assessment_meta.rb', line 84

def cant_go_back?
  string_true?(cant_go_back)
end

#could_be_lockedObject



56
57
58
# File 'lib/qti/models/assessment_meta.rb', line 56

def could_be_locked
  tag_under_quiz('could_be_locked')
end

#could_be_locked?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/qti/models/assessment_meta.rb', line 60

def could_be_locked?
  string_true?(could_be_locked)
end

#descriptionObject



8
9
10
# File 'lib/qti/models/assessment_meta.rb', line 8

def description
  sanitize_content!(tag_under_quiz('description'))
end

#due_atObject



140
141
142
# File 'lib/qti/models/assessment_meta.rb', line 140

def due_at
  tag_under_quiz('due_at')
end

#hide_correct_answers_atObject



167
168
169
# File 'lib/qti/models/assessment_meta.rb', line 167

def hide_correct_answers_at
  tag_under_quiz('hide_correct_answers_at')
end

#hide_resultsObject



20
21
22
# File 'lib/qti/models/assessment_meta.rb', line 20

def hide_results
  tag_under_quiz('hide_results')
end

#ip_filterObject



150
151
152
# File 'lib/qti/models/assessment_meta.rb', line 150

def ip_filter
  tag_under_quiz('ip_filter')
end

#lock_atObject



132
133
134
# File 'lib/qti/models/assessment_meta.rb', line 132

def lock_at
  tag_under_quiz('lock_at')
end

#lockdown_browser_monitor_dataObject



195
196
197
# File 'lib/qti/models/assessment_meta.rb', line 195

def lockdown_browser_monitor_data
  tag_under_quiz('lockdown_browser_monitor_data')
end

#module_lockedObject



120
121
122
# File 'lib/qti/models/assessment_meta.rb', line 120

def module_locked
  tag_under_quiz('module_locked')
end

#module_locked?Boolean

Returns:

  • (Boolean)


124
125
126
# File 'lib/qti/models/assessment_meta.rb', line 124

def module_locked?
  string_true?(module_locked)
end

#one_question_at_a_timeObject



72
73
74
# File 'lib/qti/models/assessment_meta.rb', line 72

def one_question_at_a_time
  tag_under_quiz('one_question_at_a_time')
end

#one_question_at_a_time?Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/qti/models/assessment_meta.rb', line 76

def one_question_at_a_time?
  one_question_at_a_time == 'true'
end

#one_time_resultsObject



96
97
98
# File 'lib/qti/models/assessment_meta.rb', line 96

def one_time_results
  tag_under_quiz('one_time_results')
end

#one_time_results?Boolean

Returns:

  • (Boolean)


100
101
102
# File 'lib/qti/models/assessment_meta.rb', line 100

def one_time_results?
  string_true?(one_time_results)
end

#only_visible_to_overreidesObject



112
113
114
# File 'lib/qti/models/assessment_meta.rb', line 112

def only_visible_to_overreides
  tag_under_quiz('only_visible_to_overrides')
end

#only_visible_to_overrides?Boolean

Returns:

  • (Boolean)


116
117
118
# File 'lib/qti/models/assessment_meta.rb', line 116

def only_visible_to_overrides?
  string_true?(only_visible_to_overrides)
end

#points_possibleObject



36
37
38
# File 'lib/qti/models/assessment_meta.rb', line 36

def points_possible
  points_possible_raw.to_f
end

#points_possible_rawObject



32
33
34
# File 'lib/qti/models/assessment_meta.rb', line 32

def points_possible_raw
  tag_under_quiz('points_possible')
end

#quiz_identifierObject



128
129
130
# File 'lib/qti/models/assessment_meta.rb', line 128

def quiz_identifier
  @doc.xpath('//xmlns:quiz/xmlns:assignment/xmlns:quiz_identifierref')&.first&.content
end

#quiz_typeObject



28
29
30
# File 'lib/qti/models/assessment_meta.rb', line 28

def quiz_type
  tag_under_quiz('quiz_type')
end

#require_lockdown_browserObject



171
172
173
# File 'lib/qti/models/assessment_meta.rb', line 171

def require_lockdown_browser
  tag_under_quiz('require_lockdown_browser')
end

#require_lockdown_browser?Boolean

Returns:

  • (Boolean)


175
176
177
# File 'lib/qti/models/assessment_meta.rb', line 175

def require_lockdown_browser?
  string_true?(require_lockdown_browser)
end

#require_lockdown_browser_for_resultsObject



179
180
181
# File 'lib/qti/models/assessment_meta.rb', line 179

def require_lockdown_browser_for_results
  tag_under_quiz('require_lockdown_browser_for_results')
end

#require_lockdown_browser_for_results?Boolean

Returns:

  • (Boolean)


183
184
185
# File 'lib/qti/models/assessment_meta.rb', line 183

def require_lockdown_browser_for_results?
  string_true?(require_lockdown_browser_for_results)
end

#require_lockdown_browser_monitorObject



187
188
189
# File 'lib/qti/models/assessment_meta.rb', line 187

def require_lockdown_browser_monitor
  tag_under_quiz('require_lockdown_browser_monitor')
end

#require_lockdown_browser_monitor?Boolean

Returns:

  • (Boolean)


191
192
193
# File 'lib/qti/models/assessment_meta.rb', line 191

def require_lockdown_browser_monitor?
  string_true?(require_lockdown_browser_monitor)
end

#scoring_policyObject



24
25
26
# File 'lib/qti/models/assessment_meta.rb', line 24

def scoring_policy
  tag_under_quiz('scoring_policy')
end

#show_correct_answersObject



40
41
42
# File 'lib/qti/models/assessment_meta.rb', line 40

def show_correct_answers
  tag_under_quiz('show_correct_answers')
end

#show_correct_answers?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/qti/models/assessment_meta.rb', line 44

def show_correct_answers?
  string_true?(show_correct_answers)
end

#show_correct_answers_atObject



163
164
165
# File 'lib/qti/models/assessment_meta.rb', line 163

def show_correct_answers_at
  tag_under_quiz('show_correct_answers_at')
end

#show_correct_answers_last_attemptObject



104
105
106
# File 'lib/qti/models/assessment_meta.rb', line 104

def show_correct_answers_last_attempt
  tag_under_quiz('show_correct_answers_last_attempt')
end

#show_correct_answers_last_attempt?Boolean

Returns:

  • (Boolean)


108
109
110
# File 'lib/qti/models/assessment_meta.rb', line 108

def show_correct_answers_last_attempt?
  string_true?(show_correct_answers_last_attempt)
end

#shuffle_answersObject



12
13
14
# File 'lib/qti/models/assessment_meta.rb', line 12

def shuffle_answers
  tag_under_quiz('shuffle_answers')
end

#shuffle_answers?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/qti/models/assessment_meta.rb', line 16

def shuffle_answers?
  string_true?(shuffle_answers)
end

#time_limitObject



158
159
160
161
# File 'lib/qti/models/assessment_meta.rb', line 158

def time_limit
  return nil if time_limit_raw.nil?
  time_limit_raw.to_i
end

#time_limit_rawObject



154
155
156
# File 'lib/qti/models/assessment_meta.rb', line 154

def time_limit_raw
  tag_under_quiz('time_limit')
end

#titleObject



4
5
6
# File 'lib/qti/models/assessment_meta.rb', line 4

def title
  sanitize_content!(tag_under_quiz('title'))
end

#unlock_atObject



136
137
138
# File 'lib/qti/models/assessment_meta.rb', line 136

def unlock_at
  tag_under_quiz('unlock_at')
end