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

#allowed_attemptsObject



66
67
68
# File 'lib/qti/models/assessment_meta.rb', line 66

def allowed_attempts
  allowed_attempts_raw.to_i
end

#allowed_attempts_rawObject



62
63
64
# File 'lib/qti/models/assessment_meta.rb', line 62

def allowed_attempts_raw
  tag_under_quiz('allowed_attempts')
end

#anonymous_submissionsObject



46
47
48
# File 'lib/qti/models/assessment_meta.rb', line 46

def anonymous_submissions
  tag_under_quiz('anonymous_submissions')
end

#anonymous_submissions?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/qti/models/assessment_meta.rb', line 50

def anonymous_submissions?
  string_true?(anonymous_submissions)
end

#availableObject



86
87
88
# File 'lib/qti/models/assessment_meta.rb', line 86

def available
  tag_under_quiz('available')
end

#available?Boolean

Returns:

  • (Boolean)


90
91
92
# File 'lib/qti/models/assessment_meta.rb', line 90

def available?
  string_true?(available)
end

#cant_go_backObject



78
79
80
# File 'lib/qti/models/assessment_meta.rb', line 78

def cant_go_back
  tag_under_quiz('cant_go_back')
end

#cant_go_back?Boolean

Returns:

  • (Boolean)


82
83
84
# File 'lib/qti/models/assessment_meta.rb', line 82

def cant_go_back?
  string_true?(cant_go_back)
end

#could_be_lockedObject



54
55
56
# File 'lib/qti/models/assessment_meta.rb', line 54

def could_be_locked
  tag_under_quiz('could_be_locked')
end

#could_be_locked?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/qti/models/assessment_meta.rb', line 58

def could_be_locked?
  string_true?(could_be_locked)
end

#descriptionObject



10
11
12
# File 'lib/qti/models/assessment_meta.rb', line 10

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

#hide_resultsObject



22
23
24
# File 'lib/qti/models/assessment_meta.rb', line 22

def hide_results
  tag_under_quiz('hide_results')
end

#module_lockedObject



118
119
120
# File 'lib/qti/models/assessment_meta.rb', line 118

def module_locked
  tag_under_quiz('module_locked')
end

#module_locked?Boolean

Returns:

  • (Boolean)


122
123
124
# File 'lib/qti/models/assessment_meta.rb', line 122

def module_locked?
  string_true?(module_locked)
end

#one_question_at_a_timeObject



70
71
72
# File 'lib/qti/models/assessment_meta.rb', line 70

def one_question_at_a_time
  tag_under_quiz('one_question_at_a_time')
end

#one_question_at_a_time?Boolean

Returns:

  • (Boolean)


74
75
76
# File 'lib/qti/models/assessment_meta.rb', line 74

def one_question_at_a_time?
  one_question_at_a_time == 'true'
end

#one_time_resultsObject



94
95
96
# File 'lib/qti/models/assessment_meta.rb', line 94

def one_time_results
  tag_under_quiz('one_time_results')
end

#one_time_results?Boolean

Returns:

  • (Boolean)


98
99
100
# File 'lib/qti/models/assessment_meta.rb', line 98

def one_time_results?
  string_true?(one_time_results)
end

#only_visible_to_overreidesObject



110
111
112
# File 'lib/qti/models/assessment_meta.rb', line 110

def only_visible_to_overreides
  tag_under_quiz('only_visible_to_overrides')
end

#only_visible_to_overrides?Boolean

Returns:

  • (Boolean)


114
115
116
# File 'lib/qti/models/assessment_meta.rb', line 114

def only_visible_to_overrides?
  string_true?(only_visible_to_overrides)
end

#points_possibleObject



38
39
40
# File 'lib/qti/models/assessment_meta.rb', line 38

def points_possible
  points_possible_raw.to_f
end

#points_possible_rawObject



34
35
36
# File 'lib/qti/models/assessment_meta.rb', line 34

def points_possible_raw
  tag_under_quiz('points_possible')
end

#quiz_identifierObject



126
127
128
# File 'lib/qti/models/assessment_meta.rb', line 126

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

#quiz_typeObject



30
31
32
# File 'lib/qti/models/assessment_meta.rb', line 30

def quiz_type
  tag_under_quiz('quiz_type')
end

#scoring_policyObject



26
27
28
# File 'lib/qti/models/assessment_meta.rb', line 26

def scoring_policy
  tag_under_quiz('scoring_policy')
end

#show_correct_answers_last_attemptObject



102
103
104
# File 'lib/qti/models/assessment_meta.rb', line 102

def show_correct_answers_last_attempt
  tag_under_quiz('show_correct_answers_last_attempt')
end

#show_correct_answers_last_attempt?Boolean

Returns:

  • (Boolean)


106
107
108
# File 'lib/qti/models/assessment_meta.rb', line 106

def show_correct_answers_last_attempt?
  string_true?(show_correct_answers_last_attempt)
end

#show_correct_anwersObject



42
43
44
# File 'lib/qti/models/assessment_meta.rb', line 42

def show_correct_anwers
  tag_under_quiz('show_correct_answers')
end

#shuffle_answersObject



14
15
16
# File 'lib/qti/models/assessment_meta.rb', line 14

def shuffle_answers
  tag_under_quiz('shuffle_answers')
end

#shuffle_answers?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/qti/models/assessment_meta.rb', line 18

def shuffle_answers?
  string_true?(shuffle_answers)
end

#titleObject



6
7
8
# File 'lib/qti/models/assessment_meta.rb', line 6

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