Class: AtomicAssessmentsImport::Questions::ClozeDropdown

Inherits:
Question
  • Object
show all
Defined in:
lib/atomic_assessments_import/questions/cloze_dropdown.rb

Constant Summary collapse

CHOICE_OF_PATTERN =
/\AChoice of:\s*(.+)/i

Instance Attribute Summary

Attributes inherited from Question

#reference

Instance Method Summary collapse

Methods inherited from Question

#initialize, load, #metadata, #points, #scoring_type, #to_learnosity

Constructor Details

This class inherits a constructor from AtomicAssessmentsImport::Questions::Question

Instance Method Details

#question_dataObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/atomic_assessments_import/questions/cloze_dropdown.rb', line 14

def question_data
  parsed = parse_dropdown_options
  super.merge(
    stimulus: "",
    template: build_template(parsed.size),
    possible_responses: parsed.map { |p| p[:choices] },
    validation: {
      scoring_type: scoring_type,
      valid_response: {
        score: points,
        value: parsed.map { |p| p[:correct] },
      },
    }
  )
end

#question_typeObject



10
11
12
# File 'lib/atomic_assessments_import/questions/cloze_dropdown.rb', line 10

def question_type
  "clozedropdown"
end