Skip to content

Commit

Permalink
[+] Find numeric grade
Browse files Browse the repository at this point in the history
  • Loading branch information
hykilpikonna committed Sep 7, 2019
1 parent 45f517e commit 90bf0b2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static java.lang.Double.parseDouble;

/**
* This class contains utility methods that parse the html pages on
* Veracross into more useful information.
Expand Down Expand Up @@ -63,11 +65,11 @@ public static List<VeracrossCourse> parseCourses(String mainPageHtml)
// Find assignments info link, and find the assignment id in it.
builder.assignmentsId(findNumberInUrl(courseElement.selectFirst(".view-assignments").attr("href")));


// Find grades
if (courseElement.select(".calculated-grade").size() != 0)
{
builder.letterGrade(courseElement.selectFirst(".letter-grade").html());
builder.numericGrade(parseDouble(courseElement.selectFirst(".numeric-grade").html().replace("%", "")));
}

// Add to result
Expand Down

0 comments on commit 90bf0b2

Please sign in to comment.