diff --git a/src/main/resources/public/assets/js/pulse/_pulse.scss b/src/main/resources/public/assets/js/pulse/_pulse.scss index bb37c0d..b8724ca 100644 --- a/src/main/resources/public/assets/js/pulse/_pulse.scss +++ b/src/main/resources/public/assets/js/pulse/_pulse.scss @@ -156,6 +156,29 @@ body.application { visibility: hidden; } } + td { + &.high-risk { + background-color: rgba(234, 14, 14, 1)!important; + color: #fff; + text-shadow: 1px 1px 1px rgba(0,0,0,0.5); + } + &.medium-risk { + background-color: rgba(246, 178, 8, 1)!important; + color: #fff; + text-shadow: 1px 1px 1px rgba(0,0,0,0.5); + } + &.low-risk { + background-color: rgba(212, 208, 2, 1)!important; + color: #fff; + text-shadow: 1px 1px 1px rgba(0,0,0,0.5); + } + &.no-risk { + background-color: rgba(127, 191, 63, 1)!important; + color: #fff; + text-shadow: 1px 1px 1px rgba(0,0,0,0.5); + } + + } } // classes diff --git a/src/main/resources/public/assets/js/pulse/pulse.html b/src/main/resources/public/assets/js/pulse/pulse.html index 9cac234..77a36b6 100644 --- a/src/main/resources/public/assets/js/pulse/pulse.html +++ b/src/main/resources/public/assets/js/pulse/pulse.html @@ -78,6 +78,12 @@ + + + + @@ -191,7 +197,7 @@ - + Risk @@ -237,7 +243,7 @@ {{item.lastName}} - + {{item.risk}} diff --git a/src/main/resources/public/assets/js/pulse/pulse.js b/src/main/resources/public/assets/js/pulse/pulse.js index 53db83f..15fe962 100644 --- a/src/main/resources/public/assets/js/pulse/pulse.js +++ b/src/main/resources/public/assets/js/pulse/pulse.js @@ -48,9 +48,35 @@ $scope.gradeFilter = false; $scope.gradeFilterScore = 25; $scope.submissionFilterScore = 6; + + $scope.appHasRiskData = false; + $scope.riskOverlay = true; + var riskColorClasses = [ + 'no-risk', + 'low-risk', + 'medium-risk', + 'high-risk', + ]; $scope.emailList = []; + $scope.colorCodeRisk = function(risk){ + if ($scope.riskOverlay) { + var colorclass; + // var riskDivided = 100/riskColorClasses.length; + // console.log(Math.round(riskDivided/(riskDivided+))); + _.each(riskColorClasses, function(r, i){ + console.log('between: ' + 100/riskColorClasses.length*(i) + " & " + 100/riskColorClasses.length*(i+1)); + if (risk >= 100/riskColorClasses.length*(i) && risk <= 100/riskColorClasses.length*(i+1)) { + colorclass = riskColorClasses[i]; + } + }); + return colorclass; + } else { + return ""; + } + } + function filterByGrade(nv){ if ($scope.currentCourse) { if ($scope.gradeFilter) { @@ -133,6 +159,8 @@ $scope.classes = $scope.processedClasses; $scope.currentCourse = course; + $scope.appHasRiskData = $scope.currentCourse.students[0].risk ? true : false; + $scope.maxEvents = course.studentEventMax; runFilters(); }