Class: ProformaXML::Task

Inherits:
Base
  • Object
show all
Defined in:
lib/proformaxml/models/task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Task

Returns a new instance of Task.



14
15
16
17
18
19
20
# File 'lib/proformaxml/models/task.rb', line 14

def initialize(attributes = {})
  super
  self.files = [] if files.nil?
  self.tests = [] if tests.nil?
  self.model_solutions = [] if model_solutions.nil?
  self. = {} if .nil?
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



11
12
13
# File 'lib/proformaxml/models/task.rb', line 11

def description
  @description
end

#external_resourcesObject

Returns the value of attribute external_resources.



11
12
13
# File 'lib/proformaxml/models/task.rb', line 11

def external_resources
  @external_resources
end

#filesObject

Returns the value of attribute files.



11
12
13
# File 'lib/proformaxml/models/task.rb', line 11

def files
  @files
end

#grading_hintsObject

Returns the value of attribute grading_hints.



11
12
13
# File 'lib/proformaxml/models/task.rb', line 11

def grading_hints
  @grading_hints
end

#internal_descriptionObject

Returns the value of attribute internal_description.



11
12
13
# File 'lib/proformaxml/models/task.rb', line 11

def internal_description
  @internal_description
end

#languageObject

Returns the value of attribute language.



11
12
13
# File 'lib/proformaxml/models/task.rb', line 11

def language
  @language
end

#meta_dataObject

Returns the value of attribute meta_data.



11
12
13
# File 'lib/proformaxml/models/task.rb', line 11

def 
  @meta_data
end

#model_solutionsObject

Returns the value of attribute model_solutions.



11
12
13
# File 'lib/proformaxml/models/task.rb', line 11

def model_solutions
  @model_solutions
end

#parent_uuidObject

Returns the value of attribute parent_uuid.



11
12
13
# File 'lib/proformaxml/models/task.rb', line 11

def parent_uuid
  @parent_uuid
end

#proglangObject

Returns the value of attribute proglang.



11
12
13
# File 'lib/proformaxml/models/task.rb', line 11

def proglang
  @proglang
end

#submission_restrictionsObject

Returns the value of attribute submission_restrictions.



11
12
13
# File 'lib/proformaxml/models/task.rb', line 11

def submission_restrictions
  @submission_restrictions
end

#testsObject

Returns the value of attribute tests.



11
12
13
# File 'lib/proformaxml/models/task.rb', line 11

def tests
  @tests
end

#titleObject

Returns the value of attribute title.



11
12
13
# File 'lib/proformaxml/models/task.rb', line 11

def title
  @title
end

#uuidObject

Returns the value of attribute uuid.



11
12
13
# File 'lib/proformaxml/models/task.rb', line 11

def uuid
  @uuid
end

Instance Method Details

#all_filesObject



22
23
24
25
26
27
# File 'lib/proformaxml/models/task.rb', line 22

def all_files
  task_files = files
  model_solution_files = model_solutions.map(&:files).filter(&:present?)
  test_files = tests.map(&:files).filter(&:present?)
  (task_files + model_solution_files + test_files).flatten.uniq
end