public String showCourseGrades() throws IOException {
        InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader keyboard = new BufferedReader(in);
        Mappers m = new Mappers();
        ArrayList<Student> students = new ArrayList<>();
        ArrayList<ArrayList<GradeItem>> studentItems = new ArrayList<>();
        ArrayList<GradeItem> items = new ArrayList<>();
        ArrayList<Integer> usedIds = new ArrayList<>();
        
        System.out.println("Course ID: ");
        int id = Integer.parseInt(keyboard.readLine());
        try { 
            ArrayList<GradeItem> itemArray = m.gradeItemsByCourse(id);
            //build student list
            for ( GradeItem item : itemArray) {
                Integer studentID = item.getStudent().getPersonID();
                if(!usedIds.contains(item.getStudent().getPersonID())) {
                    students.add(item.getStudent());
                    usedIds.add(studentID);
                }       
            }
            
            //build grade array for a student
            for ( int i = 0; i < students.size(); i++) {
                for (GradeItem item : itemArray) {   
                    if(item.getStudent().getPersonID() == students.get(i).getPersonID()) {
                        items.add(item); 
                    }
                }
                studentItems.add(new ArrayList<>(items));
                items.clear();
            }    
        }catch (Exception e) {
            return e.getMessage();
        }    
        printCourse(studentItems,students);        
     return "";   
    }