Skip to content

Commit

Permalink
Implemented feature to have exception rules for the exclude list. Add…
Browse files Browse the repository at this point in the history
…ed 'Research Internship.*' to exclude exceptions. Fixes #1
  • Loading branch information
AgamAgarwal committed Jul 18, 2016
1 parent 18f466d commit cffe7a8
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions gpameter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ var exclude_list = [
'FCC',
'Additional Course'
];
var exclude_exceptions = [
new RegExp('Research Internship.*')
];
var grade_values = {
'A+': 10,
'A': 10,
Expand All @@ -35,8 +38,20 @@ show_total_gpa = function () {
entry = json[i];
type = entry['courseElectiveTypeDesc'];
if (exclude_list.indexOf(type) > - 1) {
console.log('Skipping : ' + entry['courseName']);
continue;

// check if this course is an exception
var is_exception = false;
for (var j in exclude_exceptions) {
if (exclude_exceptions[j].test(entry['courseName'])) {
is_exception = true;
break;
}
}

if (!is_exception) {
console.log('Skipping : ' + entry['courseName']);
continue;
}
}
grade = entry['gradeDesc'];
if (grade == '') {
Expand Down

0 comments on commit cffe7a8

Please sign in to comment.