-
Notifications
You must be signed in to change notification settings - Fork 1
/
final.js
47 lines (44 loc) · 1.83 KB
/
final.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright(c), 2016-2017, Andrew Ferlitsch, All Rights Reserved
technical.controller( 'finalCtrl', function( $scope, $rootScope, $location, $anchorScroll ) {
$scope.title = "Final Score";
$scope.show = true;
$scope.totalQuestions = 0;
$scope.totalCorrect = 0;
$scope.percentCorrect = "";
$scope.timeSpent = "";
$scope.cat = "";
$scope.$on('category', function(event, args) {
$scope.cat = args;
})
// Reset the Scoring
$scope.Reset = function() {
$rootScope.$broadcast( 'reset', $scope.cat );
}
$scope.showBadges = false;
})
.directive( "final", function() {
return {
restrict: 'A',
template: "<hr/>" +
"<a id='final'/>" +
"<br/>" +
"<div class='w3-container w3-green'><p>Score</p></div>" +
"<div ng-show='show'>" +
" <p><span class='final'>Number of Questions</span>: <span id='totalQuestions' class='w3-badge'>{{totalQuestions}}</span></p>" +
" <p><span class='final'>Total Correct</span>: <span id='totalCorrect' class='w3-badge w3-green'>{{totalCorrect}}</span></p>" +
" <p><span class='final'>Percent Correct</span>: <span id='percentCorrect' class='w3-badge w3-green'>{{percentCorrect}}</span></p>" +
" <p><span class='final'>Time Spent (secs) </span>: <span id='timeSpent'>{{timeSpent}}</span></p>" +
" <p ng-show='showBadges'><span class='final'>Badges</span>: <span style='font-weight:bold'>{{badgeType}}</span> {{badgePercent}} {{badgeTime}}</p>" +
" <button class='w3-btn w3-red w3-small' ng-click='Reset()'>Reset</button>" +
"</div>"
}
})
.directive( "bottomInterview", function() {
return {
restrict: 'A',
template: "<div class='w3-container'>" +
" <h3>Preparing for a Technical Interview</h3>" +
" <p style='color: orange; cursor: pointer' ng-click='showPage( \"About\" );'>⏵ Instructions - See About</p>" +
"</div>"
}
});