Class: AudioRecordingQuestion

Inherits:
Object
  • Object
show all
Includes:
DataFactory, Foundry, StringFactory, Workflows
Defined in:
lib/sambal-cle/data_objects/questions.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 = {}) ⇒ AudioRecordingQuestion

Returns a new instance of AudioRecordingQuestion.



461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/sambal-cle/data_objects/questions.rb', line 461

def initialize(browser, opts={})
  @browser = browser

  defaults = {
      :text=>random_alphanums,
      :point_value=>(rand(100)+1).to_s,
      :time_allowed=>(rand(600)+1).to_s,
      :number_of_attempts=>(rand(10)+1).to_s,
  }
  options = defaults.merge(opts)

  set_options(options)
  requires @text
end

Instance Attribute Details

#feedbackObject

Returns the value of attribute feedback.



459
460
461
# File 'lib/sambal-cle/data_objects/questions.rb', line 459

def feedback
  @feedback
end

#number_of_attemptsObject

Returns the value of attribute number_of_attempts.



459
460
461
# File 'lib/sambal-cle/data_objects/questions.rb', line 459

def number_of_attempts
  @number_of_attempts
end

#partObject

Returns the value of attribute part.



459
460
461
# File 'lib/sambal-cle/data_objects/questions.rb', line 459

def part
  @part
end

#point_valueObject

Returns the value of attribute point_value.



459
460
461
# File 'lib/sambal-cle/data_objects/questions.rb', line 459

def point_value
  @point_value
end

#poolObject

Returns the value of attribute pool.



459
460
461
# File 'lib/sambal-cle/data_objects/questions.rb', line 459

def pool
  @pool
end

#textObject

Returns the value of attribute text.



459
460
461
# File 'lib/sambal-cle/data_objects/questions.rb', line 459

def text
  @text
end

#time_allowedObject

Returns the value of attribute time_allowed.



459
460
461
# File 'lib/sambal-cle/data_objects/questions.rb', line 459

def time_allowed
  @time_allowed
end

Instance Method Details

#createObject



476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/sambal-cle/data_objects/questions.rb', line 476

def create
  # Note that this method presumes that it's being called from
  # within methods in the AssessmentObject class, not directly
  # in a test script, so no positioning navigation is set up.
  on EditAssessment do |edit|
    edit.question_type "Audio Recording"
  end
  on AudioRecording do |add|
    add.question_text.set @text
    add.answer_point_value.set @point_value
    add.time_allowed.set @time_allowed
    add.number_of_attempts.select @number_of_attempts
    add.assign_to_part.select /#{@part}/
    add.assign_to_pool.fit @pool
    add.feedback.fit @feedback
    add.save
  end
end

#deleteObject



504
505
506
# File 'lib/sambal-cle/data_objects/questions.rb', line 504

def delete

end

#edit(opts = {}) ⇒ Object



495
496
497
498
# File 'lib/sambal-cle/data_objects/questions.rb', line 495

def edit opts={}

  set_options(opts)
end

#viewObject



500
501
502
# File 'lib/sambal-cle/data_objects/questions.rb', line 500

def view

end