Skip to content

Commit

Permalink
SAK-33857 Remove useless gradebook code (sakaiproject#5257)
Browse files Browse the repository at this point in the history
* SAK-33857 remove useless code in GradebookService

* SAk-33857 Remove more useless code and a bit of a refactor

* SAK-33857 Update gradebook classic for removed code. Migrated a few helpers that the UI used into the Gradebook itself.

* SAK-33857 wire up the services directly into gradebook

* SAK-33857 fix null pointer. if there are no enrolments, events will be null, not empty.

* Backout the change to this bean as the list is no longer null due to SAK-33868

* Codacy cleanup
  • Loading branch information
steveswinsburg authored Jul 10, 2018
1 parent 58382e9 commit 00c0d3a
Show file tree
Hide file tree
Showing 39 changed files with 5,786 additions and 7,267 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,31 +287,6 @@ public void setAssignmentScoreComment(String gradebookUid, Long assignmentId, St
public boolean isAssignmentDefined(String gradebookUid, String assignmentTitle)
throws GradebookNotFoundException;

/**
* Get an archivable definition of gradebook data suitable for migration between sites. Assignment definitions and the currently
* selected grading scale are included. Student view options and all information related to specific students or instructors (such as
* scores) are not.
*
* @param gradebookUid
* @return a versioned XML string
*
* @deprecated This is used by the old gradebook1 entityproducer and will soon be redundant
*/
@Deprecated
public String getGradebookDefinitionXml(String gradebookUid);

/**
* Attempt to transfer gradebook data with Category and weight and settings
*
* @param fromGradebookUid
* @param toGradebookUid
* @param fromGradebookXml
*
* @deprecated This is used by the old gradebook1 entityproducer and will soon be redundant
*/
@Deprecated
public void transferGradebookDefinitionXml(String fromGradebookUid, String toGradebookUid, String fromGradebookXml);

/**
* Transfer the gradebook information and assignments from one gradebook to another
*
Expand All @@ -331,23 +306,6 @@ public void transferGradebook(final GradebookInformation gradebookInformation, f
*/
public GradebookInformation getGradebookInformation(String gradebookUid);

/**
* Attempt to merge archived gradebook data (notably the assignnments) into a new gradebook.
*
* Assignment definitions whose names match assignments that are already in the targeted gradebook will be skipped.
*
* Imported assignments will not automatically be released to students, even if they were released in the original gradebook.
*
* Externally managed assessments will not be imported, since such imports should be handled by the external assessment engine.
*
* If possible, the targeted gradebook's selected grading scale will be set to match the archived grading scale. If there are any
* mismatches that make this impossible, the existing grading scale will be left alone, but assignment imports will still happen.
*
* @param toGradebookUid
* @param fromGradebookXml
*/
public void mergeGradebookDefinitionXml(String toGradebookUid, String fromGradebookXml);

/**
* Removes an assignment from a gradebook. The assignment should not be deleted, but the assignment and all grade records associated
* with the assignment should be ignored by the application. A removed assignment should not count toward the total number of points in
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -55,7 +56,7 @@ public GradeMapping(final GradingScale gradingScale) {
}

public String getName() {
return getGradingScale().getName();
return (getGradingScale() != null) ? getGradingScale().getName() : null;
}

/**
Expand Down Expand Up @@ -90,7 +91,7 @@ public Map<String, Double> getDefaultBottomPercents() {
* @return An (ordered) collection of the available grade values
*/
public Collection<String> getGrades() {
return getGradingScale().getGrades();
return (getGradingScale() != null) ? getGradingScale().getGrades() : Collections.emptyList();
}

/**
Expand Down
Loading

0 comments on commit 00c0d3a

Please sign in to comment.