cgpa calculator in rails