How to get the score of the "Total" grade center column through API?
How to get the score of the "Total" grade center column through API?
Hello,
something like this must work:
ContextManager contextManager = ContextManagerFactory.getInstance(); Context ctx = contextManager.getContext(); Course curso = ctx.getCourse(); GradebookManager gm = GradebookManagerFactory.getInstanceWithoutSecurityCheck(); BookData bookData = gm.getBookData(new BookDataRequest(curso.getId())); //it is necessary to execute these two methods to obtain calculated scores and extended grade data bookData.addParentReferences(); bookData.runCumulativeGrading(); Map<Id, GradeWithAttemptScore> grades = bookData.getByStudent(courseUserId); for(Id id:grades.keySet()) { if(grades.get(id).getGradableItem().getDisplayColumnName().equalsIgnoreCase("Total")) { return grades.get(id).getScoreValue(); } }
Hope this helps
Hi Alberto Ruiz
It's working fine using the lines above, i can access the grades wonderfully.
You know if grades.get(id).getGradeNotes() will return the "Quick Comment" that a instructor can do inside a gradebook? Trying to reach that with no luck.
Thanks!
HiAlberto Ruiz! good post!
What is the "courseUserId", how can I get it?
Thanks in advance
Ivan Carlucci
Hello,
something like this must work:
Hope this helps