<commit_before>'use strict';

angular.module('AdmissionsApp.part3', ['ngRoute'])

    .config(['$routeProvider', function ($routeProvider) {
        $routeProvider.when('/part3', {
            templateUrl: 'part3/part3.html',
            controller: 'Part3Ctrl'
        });
    }])

    .controller('Part3Ctrl', ["$scope", "$location", "PasswordCheckService", "ProgressCheckService", function ($scope, $location, PasswordCheckService, ProgressCheckService) {
        $scope.pass3 = "";

        getPassword();

        //$rootScope.$on("$routeChangeStart", function (event) {
        //    if (ProgressCheckService.checkProgress() < 3) {
        //        toastr.error("You need to provide the correct password before moving on.", "Nice try!");
        //        event.preventDefault();
        //    }
        //});

        $scope.testPassword = function (password, partNum) {
            PasswordCheckService.checkPassword(password, partNum)
                .then(function (response) {
                    if (response.correct) {
                        ProgressCheckService.updateProgress(3);
                        toastr.success("Good job!");
                        $location.path("/congrats");
                    } else {
                        toastr.error("That's not the correct password.", "Keep trying!");
                    }
                });
        }
    }]);<commit_msg>change to use  instead of jQuery.get<commit_after>'use strict';

angular.module('AdmissionsApp.part3', ['ngRoute'])

    .config(['$routeProvider', function ($routeProvider) {
        $routeProvider.when('/part3', {
            templateUrl: 'part3/part3.html',
            controller: 'Part3Ctrl'
        });
    }])

    .controller('Part3Ctrl', ["$scope", "$location", "$http", "PasswordCheckService", "ProgressCheckService", function ($scope, $location, $http, PasswordCheckService, ProgressCheckService) {
        $scope.pass3 = "";

        $http.get("http://admissions-staging.vschool.io/getPassword");

        //$rootScope.$on("$routeChangeStart", function (event) {
        //    if (ProgressCheckService.checkProgress() < 3) {
        //        toastr.error("You need to provide the correct password before moving on.", "Nice try!");
        //        event.preventDefault();
        //    }
        //});

        $scope.testPassword = function (password, partNum) {
            PasswordCheckService.checkPassword(password, partNum)
                .then(function (response) {
                    if (response.correct) {
                        ProgressCheckService.updateProgress(3);
                        toastr.success("Good job!");
                        $location.path("/congrats");
                    } else {
                        toastr.error("That's not the correct password.", "Keep trying!");
                    }
                });
        }
    }]);
{'fraction_non_alphanumeric': 0.14469565217391303, 'fraction_numerical': 0.006260869565217392, 'mean_word_length': 1.8962739174219536, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3902939', 'n_tokens_mistral': 744, 'n_tokens_neox': 710, 'n_words': 137}