Class: Moodle2CC::CC::Question
- Inherits:
-
Object
- Object
- Moodle2CC::CC::Question
- Includes:
- CCHelper
- Defined in:
- lib/moodle2cc/cc/question.rb
Direct Known Subclasses
Constant Summary
Constants included from CCHelper
CCHelper::ASSESSMENT_CC_QTI, CCHelper::ASSESSMENT_META, CCHelper::ASSESSMENT_NON_CC_FOLDER, CCHelper::ASSESSMENT_TYPE, CCHelper::ASSIGNMENT_GROUPS, CCHelper::ASSIGNMENT_SETTINGS, CCHelper::BASIC_LTI, CCHelper::BLTI_NAMESPACE, CCHelper::CANVAS_NAMESPACE, CCHelper::CANVAS_PLATFORM, CCHelper::CC_ASSIGNMENT_FOLDER, CCHelper::CC_EXTENSION, CCHelper::CC_WIKI_FOLDER, CCHelper::COURSE_SETTINGS, CCHelper::COURSE_SETTINGS_DIR, CCHelper::COURSE_TOKEN, CCHelper::DISCUSSION_TOPIC, CCHelper::EVENTS, CCHelper::EXTERNAL_FEEDS, CCHelper::EXTERNAL_TOOLS, CCHelper::FILES_META, CCHelper::GRADING_STANDARDS, CCHelper::IMS_DATE, CCHelper::IMS_DATETIME, CCHelper::LEARNING_OUTCOMES, CCHelper::LOR, CCHelper::MANIFEST, CCHelper::MEDIA_OBJECTS_FOLDER, CCHelper::MODULE_META, CCHelper::MOODLE_FILEBASE_TOKEN, CCHelper::MOODLE_SLASH_TOKEN, CCHelper::OBJECT_TOKEN, CCHelper::QTI_ASSESSMENT_TYPE, CCHelper::QTI_EXTENSION, CCHelper::QUESTION_BANK, CCHelper::RUBRICS, CCHelper::SYLLABUS, CCHelper::WEBCONTENT, CCHelper::WEB_CONTENT_TOKEN, CCHelper::WEB_LINK, CCHelper::WEB_RESOURCES_FOLDER, CCHelper::WIKI_FOLDER, CCHelper::WIKI_TOKEN, CCHelper::XSD_URI
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #create_item_xml(section_node) ⇒ Object
-
#initialize(question, assessment = nil) ⇒ Question
constructor
A new instance of Question.
Methods included from CCHelper
#convert_file_path_tokens, convert_file_path_tokens, #create_key, create_key, create_mod_key, #create_mod_key, #create_resource_key, create_resource_key, file_query_string, #file_slug, file_slug, #get_html_title_and_body, #get_html_title_and_body_and_id, #get_html_title_and_body_and_meta_fields, ims_date, #ims_date, ims_datetime, #ims_datetime, media_object_info
Constructor Details
#initialize(question, assessment = nil) ⇒ Question
Returns a new instance of Question.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/moodle2cc/cc/question.rb', line 7 def initialize(question, assessment=nil) @id = question.id @title = CGI.unescapeHTML((question.name || '').gsub('$@NULL@$', '')) @identifier_prefix = "#{assessment.mod.mod_type}_" if assessment if question.instance_id @identifier = create_key(question.instance_id, "#{@identifier_prefix}question_instance_") else @identifier = create_key(question.id, "#{@identifier_prefix}question_") end end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/moodle2cc/cc/question.rb', line 5 def id @id end |
#identifier ⇒ Object
Returns the value of attribute identifier.
5 6 7 |
# File 'lib/moodle2cc/cc/question.rb', line 5 def identifier @identifier end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/moodle2cc/cc/question.rb', line 5 def title @title end |
Instance Method Details
#create_item_xml(section_node) ⇒ Object
19 20 |
# File 'lib/moodle2cc/cc/question.rb', line 19 def create_item_xml(section_node) end |