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.
519 520 521 522 523 524 525 526 527 528 529 530 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 519 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.
517 518 519 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 517 def feedback @feedback end |
#part ⇒ Object
Returns the value of attribute part.
517 518 519 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 517 def part @part end |
#point_value ⇒ Object
Returns the value of attribute point_value.
517 518 519 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 517 def point_value @point_value end |
#pool ⇒ Object
Returns the value of attribute pool.
517 518 519 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 517 def pool @pool end |
#text ⇒ Object
Returns the value of attribute text.
517 518 519 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 517 def text @text end |
Instance Method Details
#create ⇒ Object
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 532 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
558 559 560 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 558 def delete end |
#edit(opts = {}) ⇒ Object
549 550 551 552 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 549 def edit opts={} (opts) end |
#view ⇒ Object
554 555 556 |
# File 'lib/sambal-cle/data_objects/questions.rb', line 554 def view end |