Module: Course::Assessment::SubmissionQuestionAbility

Included in:
AssessmentAbility
Defined in:
app/models/course/assessment/submission_question_ability.rb

Instance Method Summary collapse

Instance Method Details

#allow_staff_view_past_answers_submission_questionsObject


16
17
18
# File 'app/models/course/assessment/submission_question_ability.rb', line 16

def allow_staff_view_past_answers_submission_questions
  can :past_answers, Course::Assessment::SubmissionQuestion, discussion_topic: course_staff_hash
end

#allow_students_view_past_answers_submission_questionObject


12
13
14
# File 'app/models/course/assessment/submission_question_ability.rb', line 12

def allow_students_view_past_answers_submission_question
  can :past_answers, Course::Assessment::SubmissionQuestion, submission: { creator_id: user.id }
end

#define_permissionsObject


3
4
5
6
7
8
9
10
# File 'app/models/course/assessment/submission_question_ability.rb', line 3

def define_permissions
  if user
    allow_students_view_past_answers_submission_question
    allow_staff_view_past_answers_submission_questions
  end

  super
end