Class: PartObject

Inherits:
Object
  • Object
show all
Includes:
DataFactory, Foundry, StringFactory, Workflows
Defined in:
lib/sambal-cle/data_objects/assessment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Workflows

menu_link, #open_my_site_by_name, #reset

Constructor Details

#initialize(browser, opts = {}) ⇒ PartObject

Returns a new instance of PartObject.



195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/sambal-cle/data_objects/assessment.rb', line 195

def initialize(browser, opts={})
  @browser = browser
  
  defaults = {
    :title=>random_alphanums,
    :information=>random_alphanums,
    :type=>:one_by_one,
    :question_ordering=>:order_as_listed
  }
  options = defaults.merge(opts)
  
  set_options(options)
  requires @assessment
end

Instance Attribute Details

#assessmentObject

Returns the value of attribute assessment.



193
194
195
# File 'lib/sambal-cle/data_objects/assessment.rb', line 193

def assessment
  @assessment
end

#informationObject

Returns the value of attribute information.



193
194
195
# File 'lib/sambal-cle/data_objects/assessment.rb', line 193

def information
  @information
end

#number_of_questionsObject

Returns the value of attribute number_of_questions.



193
194
195
# File 'lib/sambal-cle/data_objects/assessment.rb', line 193

def number_of_questions
  @number_of_questions
end

#part_numberObject

Returns the value of attribute part_number.



193
194
195
# File 'lib/sambal-cle/data_objects/assessment.rb', line 193

def part_number
  @part_number
end

#pool_nameObject

Returns the value of attribute pool_name.



193
194
195
# File 'lib/sambal-cle/data_objects/assessment.rb', line 193

def pool_name
  @pool_name
end

#question_orderingObject

Returns the value of attribute question_ordering.



193
194
195
# File 'lib/sambal-cle/data_objects/assessment.rb', line 193

def question_ordering
  @question_ordering
end

#titleObject

Returns the value of attribute title.



193
194
195
# File 'lib/sambal-cle/data_objects/assessment.rb', line 193

def title
  @title
end

#typeObject

Returns the value of attribute type.



193
194
195
# File 'lib/sambal-cle/data_objects/assessment.rb', line 193

def type
  @type
end

Instance Method Details

#createObject



210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/sambal-cle/data_objects/assessment.rb', line 210

def create
  on EditAssessment do |edit|
    edit.add_part
  end
  on AddEditAssessmentPart do |part|
    part.title.set @title
    part.information.set @information
    part.send(@type).set
    part.send(@question_ordering).set
    # TODO: more to add here
    part.save
  end
end

#deleteObject



233
234
235
# File 'lib/sambal-cle/data_objects/assessment.rb', line 233

def delete
  
end

#edit(opts = {}) ⇒ Object



224
225
226
227
# File 'lib/sambal-cle/data_objects/assessment.rb', line 224

def edit opts={}

  set_options(opts)
end

#viewObject



229
230
231
# File 'lib/sambal-cle/data_objects/assessment.rb', line 229

def view
  
end