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.



468
469
470
471
472
473
474
475
476
477
478
479
480
481
# File 'lib/sambal-cle/data_objects/questions.rb', line 468

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.



466
467
468
# File 'lib/sambal-cle/data_objects/questions.rb', line 466

def feedback
  @feedback
end

#number_of_attemptsObject

Returns the value of attribute number_of_attempts.



466
467
468
# File 'lib/sambal-cle/data_objects/questions.rb', line 466

def number_of_attempts
  @number_of_attempts
end

#partObject

Returns the value of attribute part.



466
467
468
# File 'lib/sambal-cle/data_objects/questions.rb', line 466

def part
  @part
end

#point_valueObject

Returns the value of attribute point_value.



466
467
468
# File 'lib/sambal-cle/data_objects/questions.rb', line 466

def point_value
  @point_value
end

#poolObject

Returns the value of attribute pool.



466
467
468
# File 'lib/sambal-cle/data_objects/questions.rb', line 466

def pool
  @pool
end

#textObject

Returns the value of attribute text.



466
467
468
# File 'lib/sambal-cle/data_objects/questions.rb', line 466

def text
  @text
end

#time_allowedObject

Returns the value of attribute time_allowed.



466
467
468
# File 'lib/sambal-cle/data_objects/questions.rb', line 466

def time_allowed
  @time_allowed
end

Instance Method Details

#createObject



483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
# File 'lib/sambal-cle/data_objects/questions.rb', line 483

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



511
512
513
# File 'lib/sambal-cle/data_objects/questions.rb', line 511

def delete

end

#edit(opts = {}) ⇒ Object



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

def edit opts={}

  set_options(opts)
end

#viewObject



507
508
509
# File 'lib/sambal-cle/data_objects/questions.rb', line 507

def view

end