Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def other_correct_rate
- if school.present?
- general_answer_count = general_statistics.answers_count
- general_correct_count = general_statistics.correct_count
- other_answer_count = general_answer_count - answers_count
- other_correct_count = general_correct_count - correct_count
- (other_correct_count/other_answer_count.to_f)*100
- else
- nil
- end
- end
- def general_statistics
- self.class.where(mock_id: mock_id, mock_question_id: mock_question_id, school_id: nil).first
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement