Class: AssessmentObject
- Inherits:
-
Object
- Object
- AssessmentObject
- Includes:
- DataFactory, DateFactory, Foundry, StringFactory, Workflows
- Defined in:
- lib/sambal-cle/data_objects/assessment.rb
Instance Attribute Summary collapse
-
#allowed_ips ⇒ Object
Returns the value of attribute allowed_ips.
-
#available_date ⇒ Object
Returns the value of attribute available_date.
-
#due_date ⇒ Object
Returns the value of attribute due_date.
-
#feedback_authoring ⇒ Object
Returns the value of attribute feedback_authoring.
-
#feedback_date ⇒ Object
Returns the value of attribute feedback_date.
-
#feedback_delivery ⇒ Object
Returns the value of attribute feedback_delivery.
-
#final_page_url ⇒ Object
Returns the value of attribute final_page_url.
-
#gradebook_options ⇒ Object
Returns the value of attribute gradebook_options.
-
#late_handling ⇒ Object
Returns the value of attribute late_handling.
-
#navigation ⇒ Object
Returns the value of attribute navigation.
-
#num_submissions ⇒ Object
Returns the value of attribute num_submissions.
-
#numbering ⇒ Object
Returns the value of attribute numbering.
-
#parts ⇒ Object
Returns the value of attribute parts.
-
#question_layout ⇒ Object
Returns the value of attribute question_layout.
-
#questions ⇒ Object
Returns the value of attribute questions.
-
#recorded_score ⇒ Object
Returns the value of attribute recorded_score.
-
#release ⇒ Object
Returns the value of attribute release.
-
#release_options ⇒ Object
Returns the value of attribute release_options.
-
#release_to ⇒ Object
Returns the value of attribute release_to.
-
#retract_date ⇒ Object
Returns the value of attribute retract_date.
-
#secondary_id ⇒ Object
Returns the value of attribute secondary_id.
-
#secondary_password ⇒ Object
Returns the value of attribute secondary_password.
-
#site ⇒ Object
Returns the value of attribute site.
-
#status ⇒ Object
Returns the value of attribute status.
-
#student_ids ⇒ Object
Returns the value of attribute student_ids.
-
#submission_message ⇒ Object
Returns the value of attribute submission_message.
-
#submissions ⇒ Object
Returns the value of attribute submissions.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #add_part(opts = {}) ⇒ Object
- #add_question(opts = {}) ⇒ Object
- #create ⇒ Object
-
#initialize(browser, opts = {}) ⇒ AssessmentObject
constructor
A new instance of AssessmentObject.
- #publish ⇒ Object
- #question_types ⇒ Object
- #update_settings(opts = {}) ⇒ Object
Methods included from Workflows
menu_link, #open_my_site_by_name, #reset
Constructor Details
#initialize(browser, opts = {}) ⇒ AssessmentObject
Returns a new instance of AssessmentObject.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 31 def initialize(browser, opts={}) @browser = browser defaults = { :title=>random_alphanums, :authors=>random_alphanums, :description=>random_alphanums, :parts=>[], :questions=>[], :available_date=>right_now, :due_date=>tomorrow, :retract_date=>next_week, :feedback_authoring=>:question_level_feedback, :feedback_delivery=>:no_feedback, :release=>:release_questions_and, :release_options=>[], :released_to=>:released_to_site, :navigation=>:linear_access, :submissions=>:unlimited_submissions, :late_handling=>:late_submissions_not_accepted, :submission_message=>random_alphanums, :final_page_url=>"http://www.rsmart.com", :student_ids=>:student_ids_seen # TODO: More to add } = defaults.merge(opts) () requires @site default_part = make PartObject, :title=>"Default", :assessment=>@title, :part_number=>1, :information=>"" @parts << default_part end |
Instance Attribute Details
#allowed_ips ⇒ Object
Returns the value of attribute allowed_ips.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def allowed_ips @allowed_ips end |
#available_date ⇒ Object
Returns the value of attribute available_date.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def available_date @available_date end |
#due_date ⇒ Object
Returns the value of attribute due_date.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def due_date @due_date end |
#feedback_authoring ⇒ Object
Returns the value of attribute feedback_authoring.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def @feedback_authoring end |
#feedback_date ⇒ Object
Returns the value of attribute feedback_date.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def feedback_date @feedback_date end |
#feedback_delivery ⇒ Object
Returns the value of attribute feedback_delivery.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def feedback_delivery @feedback_delivery end |
#final_page_url ⇒ Object
Returns the value of attribute final_page_url.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def final_page_url @final_page_url end |
#gradebook_options ⇒ Object
Returns the value of attribute gradebook_options.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def @gradebook_options end |
#late_handling ⇒ Object
Returns the value of attribute late_handling.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def late_handling @late_handling end |
#navigation ⇒ Object
Returns the value of attribute navigation.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def @navigation end |
#num_submissions ⇒ Object
Returns the value of attribute num_submissions.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def num_submissions @num_submissions end |
#numbering ⇒ Object
Returns the value of attribute numbering.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def numbering @numbering end |
#parts ⇒ Object
Returns the value of attribute parts.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def parts @parts end |
#question_layout ⇒ Object
Returns the value of attribute question_layout.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def question_layout @question_layout end |
#questions ⇒ Object
Returns the value of attribute questions.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def questions @questions end |
#recorded_score ⇒ Object
Returns the value of attribute recorded_score.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def recorded_score @recorded_score end |
#release ⇒ Object
Returns the value of attribute release.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def release @release end |
#release_options ⇒ Object
Returns the value of attribute release_options.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def @release_options end |
#release_to ⇒ Object
Returns the value of attribute release_to.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def release_to @release_to end |
#retract_date ⇒ Object
Returns the value of attribute retract_date.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def retract_date @retract_date end |
#secondary_id ⇒ Object
Returns the value of attribute secondary_id.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def secondary_id @secondary_id end |
#secondary_password ⇒ Object
Returns the value of attribute secondary_password.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def secondary_password @secondary_password end |
#site ⇒ Object
Returns the value of attribute site.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def site @site end |
#status ⇒ Object
Returns the value of attribute status.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def status @status end |
#student_ids ⇒ Object
Returns the value of attribute student_ids.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def student_ids @student_ids end |
#submission_message ⇒ Object
Returns the value of attribute submission_message.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def @submission_message end |
#submissions ⇒ Object
Returns the value of attribute submissions.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def submissions @submissions end |
#title ⇒ Object
Returns the value of attribute title.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
24 25 26 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 24 def type @type end |
Instance Method Details
#add_part(opts = {}) ⇒ Object
146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 146 def add_part opts={} position defaults = { :assessment=>@title, :part_number=>@parts.length+1 } = defaults.merge(opts) part = make PartObject, part.create @parts << part end |
#add_question(opts = {}) ⇒ Object
158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 158 def add_question opts={} position defaults = { :assessment=>@title, :part=>@parts[rand(@parts.length)].title, :type=>question_types.keys.shuffle[0] } = defaults.merge(opts) question = make question_types[[:type].to_sym], question.create @questions << question end |
#create ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 64 def create open_my_site_by_name @site tests_and_quizzes reset on_page AssessmentsList do |page| page.title.set @title page.type.select @type unless @type==nil page.create end on EditAssessment do |assessment| assessment.settings end on AssessmentSettings do |settings| settings.open # Introduction settings..set @authors settings.description.set @description # Delivery Dates settings.available_date.set @available_date[:samigo] settings.due_date.set @due_date[:samigo] settings.retract_date.set @retract_date[:samigo] # Assessment Released To settings.send(@released_to).set # High Security settings.allow_specified_ips.set @allowed_ips settings.secondary_id.set @secondary_id settings.secondary_pw.set @secondary_password # Assessment Organization settings.send(@navigation).set if @navigation==:random_access settings.send(@question_layout).set settings.send(@numbering).set # Mark for Review settings.send(@mark_for_review) end # Submissions settings.send(@submissions).set if @submissions==:only_x_submissions settings.allowed_submissions.set @num_submissions end settings.send(@late_handling).set # Submission Message settings..set @submission_message settings.final_page_url.set @final_page_url # Feedback settings.send(@feedback_authoring).set settings.send(@feedback_delivery).set settings.send(@release).set @release_options.each do |option| settings.send(option).set end if @feedback_delivery==:feedback_on_date settings.feedback_date.set @feedback_date end # Grading # TODO: More to add here # Graphics # Metadata settings.save end end |
#publish ⇒ Object
134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 134 def publish open_my_site_by_name @site tests_and_quizzes reset on AssessmentsList do |list| list.publish @title end on PublishAssessment do |assessment| assessment.publish end end |
#question_types ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 9 def question_types { :"Multiple Choice"=>MultipleChoiceQuestion, :Survey=>SurveyQuestion, :"Short Answer/Essay"=>ShortAnswerQuestion, :"Fill in the Blank"=>FillInBlankQuestion, :"Numeric Response"=>NumericResponseQuestion, :Matching=>MatchingQuestion, :"True False"=>TrueFalseQuestion, :"Audio Recording"=>AudioRecordingQuestion, :"File Upload"=>FileUploadQuestion, :"Calculated Question"=>CalculatedQuestion } end |
#update_settings(opts = {}) ⇒ Object
129 130 131 132 |
# File 'lib/sambal-cle/data_objects/assessment.rb', line 129 def update_settings opts={} (opts) end |