app/controllers/assignments_controller.rb
# check whether rubrics are set before save assignment
check whether rubrics are set before save assignment
check whether rubrics are set before save assignment
def empty_rubrics_list
    rubrics_list = %w(ReviewQuestionnaire
                      MetareviewQuestionnaire AuthorFeedbackQuestionnaire
                      TeammateReviewQuestionnaire BookmarkRatingQuestionnaire)
    @assignment_questionnaires.each do |aq|
      next if aq.questionnaire_id.nil?
      rubrics_list.reject! do |rubric|
        rubric == Questionnaire.where(id: aq.questionnaire_id).first.type.to_s
      end
    end
    if @assignment_form.assignment.max_team_size == 1
      rubrics_list.delete("TeammateReviewQuestionnaire")
    end
    rubrics_list.delete("MetareviewQuestionnaire") unless @metareview_allowed
    unless @assignment_form.assignment.use_bookmark
      rubrics_list.delete("BookmarkRatingQuestionnaire")
    end
    rubrics_list
  end
def empty_rubrics_list rubrics_list = %w( ReviewQuestionnaire MetareviewQuestionnaire AuthorFeedbackQuestionnaire TeammateReviewQuestionnaire BookmarkRatingQuestionnaire ) @assignment_questionnaires . each do | aq | next if aq . questionnaire_id . nil? rubrics_list . reject! do | rubric | rubric == Questionnaire . where ( id : aq . questionnaire_id ) . first . type . to_s end end if @assignment_form . assignment . max_team_size == 1 rubrics_list . delete ( "TeammateReviewQuestionnaire" ) end rubrics_list . delete ( "MetareviewQuestionnaire" ) unless @metareview_allowed unless @assignment_form . assignment . use_bookmark rubrics_list . delete ( "BookmarkRatingQuestionnaire" ) end rubrics_list end
check whether rubrics are set before save assignment
check whether rubrics are set before save assignment