Class: AudioRecordingQuestion
- Inherits:
-
Object
- Object
- AudioRecordingQuestion
- Includes:
- DataFactory, Foundry, StringFactory, Workflows
- Defined in:
- lib/sambal-cle/data_objects/questions.rb
Instance Attribute Summary collapse
-
#feedback ⇒ Object
Returns the value of attribute feedback.
-
#number_of_attempts ⇒ Object
Returns the value of attribute number_of_attempts.
-
#part ⇒ Object
Returns the value of attribute part.
-
#point_value ⇒ Object
Returns the value of attribute point_value.
-
#pool ⇒ Object
Returns the value of attribute pool.
-
#text ⇒ Object
Returns the value of attribute text.
-
#time_allowed ⇒ Object
Returns the value of attribute time_allowed.
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
- #edit(opts = {}) ⇒ Object
-
#initialize(browser, opts = {}) ⇒ AudioRecordingQuestion
constructor
A new instance of AudioRecordingQuestion.
- #view ⇒ Object
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, } = defaults.merge(opts) () requires @text end |
Instance Attribute Details
#feedback ⇒ Object
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_attempts ⇒ Object
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 |
#part ⇒ Object
Returns the value of attribute part.
466 467 468 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 466 def part @part end |
#point_value ⇒ Object
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 |
#pool ⇒ Object
Returns the value of attribute pool.
466 467 468 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 466 def pool @pool end |
#text ⇒ Object
Returns the value of attribute text.
466 467 468 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 466 def text @text end |
#time_allowed ⇒ Object
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
#create ⇒ Object
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 |
#delete ⇒ Object
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={} (opts) end |
#view ⇒ Object
507 508 509 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 507 def view end |