Class: FileUploadQuestion
- Inherits:
-
Object
- Object
- FileUploadQuestion
- 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.
-
#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.
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
- #edit(opts = {}) ⇒ Object
-
#initialize(browser, opts = {}) ⇒ FileUploadQuestion
constructor
A new instance of FileUploadQuestion.
- #view ⇒ Object
Methods included from Workflows
menu_link, #open_my_site_by_name, #reset
Constructor Details
#initialize(browser, opts = {}) ⇒ FileUploadQuestion
Returns a new instance of FileUploadQuestion.
526 527 528 529 530 531 532 533 534 535 536 537 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 526 def initialize(browser, opts={}) @browser = browser defaults = { :text=>random_alphanums, :point_value=>(rand(100)+1).to_s } = defaults.merge(opts) () requires @text end |
Instance Attribute Details
#feedback ⇒ Object
Returns the value of attribute feedback.
524 525 526 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 524 def feedback @feedback end |
#part ⇒ Object
Returns the value of attribute part.
524 525 526 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 524 def part @part end |
#point_value ⇒ Object
Returns the value of attribute point_value.
524 525 526 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 524 def point_value @point_value end |
#pool ⇒ Object
Returns the value of attribute pool.
524 525 526 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 524 def pool @pool end |
#text ⇒ Object
Returns the value of attribute text.
524 525 526 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 524 def text @text end |
Instance Method Details
#create ⇒ Object
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 539 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 "File Upload" end on FileUpload do |add| add.question_text.set @text add.answer_point_value.set @point_value add.assign_to_part.select /#{@part}/ add.assign_to_pool.fit @pool add.feedback.fit @feedback add.save end end |
#delete ⇒ Object
565 566 567 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 565 def delete end |
#edit(opts = {}) ⇒ Object
556 557 558 559 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 556 def edit opts={} (opts) end |
#view ⇒ Object
561 562 563 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 561 def view end |