<commit_before>'use strict';

/* Directives */


angular.module('learntoprogram.directives', ['learntoprogram.directivesCode'])
    .controller('Navigation', function ($scope,$http, $rootScope, $location) {


        $scope.isTeacher = function() {return $rootScope.loggedUser == 'teacher';};
        $scope.logout = function () {
            $rootScope.loggedUser = '';
            $location.path( "/login");


        };
        $http.get('json/lectures.json').then(function(lectureResponse) {
            $scope.lectures = lectureResponse.data;

        });

        })
.directive('navigationBar', function() {
        return {
            restrict: 'E',
            scope: {
                mode: '@mode',
                user: '@user'
            },
            templateUrl : 'partials/navigation.html'
        };
    })
    .controller('Workspace', function ($scope, $rootScope,$http, $location) {
        $scope.isSingle = function() {return $scope.mode == 'Single';};
        $scope.isMulti = function() {return $scope.mode == 'Multi';};
        $scope.isTeacher = function() {return $scope.mode == 'Teacher';};
        $scope.isStudent = function() {return $scope.mode != 'Teacher';};

        $http.get('json/lectures.json').then(function(lectureResponse) {
            $scope.lectures = lectureResponse.data;

        });

    })
    .directive('workspace', function() {
        return {
            restrict: 'E',
            scope: {
                mode: '@mode'
            },
            templateUrl : 'partials/workspace.html'
        };
    })
    .controller('Exercise',  function($scope,$http,$rootScope){
        $http.get('json/exercises.json').then(function(exerciseResponse) {
            $scope.exercises = exerciseResponse.data;
            $scope.eIndex = 0;

            $scope.next = function(){
                if($scope.eIndex <$scope.exercises.length-1)
                    $scope.eIndex++;
            };


            $scope.prev = function(){
                if($scope.eIndex >0)
                    $scope.eIndex--;
            };
        });;

    })
    .directive('exercise', function() {
        return {
            restrict: 'E',
            templateUrl : 'partials/exercise.html'
        };
    })
    .controller('Variables', function ($scope, $rootScope, $location) {

        $scope.varsToShow = [];

        $scope.originalVars = [];

        for(var key in window) {
            //here we read all the values from the window obj.
            $scope.originalVars.push(window[key]);
        }

        $rootScope.calculateNewVariables = function(){

            for(var key in window) {
            if ( $scope.originalVars.indexOf('Sam') == -1) {
                $scope.varsToShow.push(window[key]);<commit_msg>window.calculateNewVariables added<commit_after>'use strict';

/* Directives */


angular.module('learntoprogram.directives', ['learntoprogram.directivesCode'])
    .controller('Navigation', function ($scope,$http, $rootScope, $location) {


        $scope.isTeacher = function() {return $rootScope.loggedUser == 'teacher';};
        $scope.logout = function () {
            $rootScope.loggedUser = '';
            $location.path( "/login");


        };
        $http.get('json/lectures.json').then(function(lectureResponse) {
            $scope.lectures = lectureResponse.data;

        });

        })
.directive('navigationBar', function() {
        return {
            restrict: 'E',
            scope: {
                mode: '@mode',
                user: '@user'
            },
            templateUrl : 'partials/navigation.html'
        };
    })
    .controller('Workspace', function ($scope, $rootScope,$http, $location) {
        $scope.isSingle = function() {return $scope.mode == 'Single';};
        $scope.isMulti = function() {return $scope.mode == 'Multi';};
        $scope.isTeacher = function() {return $scope.mode == 'Teacher';};
        $scope.isStudent = function() {return $scope.mode != 'Teacher';};

        $http.get('json/lectures.json').then(function(lectureResponse) {
            $scope.lectures = lectureResponse.data;

        });

    })
    .directive('workspace', function() {
        return {
            restrict: 'E',
            scope: {
                mode: '@mode'
            },
            templateUrl : 'partials/workspace.html'
        };
    })
    .controller('Exercise',  function($scope,$http,$rootScope){
        $http.get('json/exercises.json').then(function(exerciseResponse) {
            $scope.exercises = exerciseResponse.data;
            $scope.eIndex = 0;

            $scope.next = function(){
                if($scope.eIndex <$scope.exercises.length-1)
                    $scope.eIndex++;
            };


            $scope.prev = function(){
                if($scope.eIndex >0)
                    $scope.eIndex--;
            };
        });;

    })
    .directive('exercise', function() {
        return {
            restrict: 'E',
            templateUrl : 'partials/exercise.html'
        };
    })
    .controller('Variables', function ($scope, $rootScope, $location) {

        $scope.varsToShow = [];

        $scope.originalVars = [];

        for(var key in window) {
            //here we read all the values from the window obj.
            $scope.originalVars.push(window[key]);
        }

        window.calculateNewVariables = function(){

            for(var key in window) {
            if ( $scope.originalVars.indexOf('Sam') == -1) {
                $scope.varsToShow.push(window[key]);
{'fraction_non_alphanumeric': 0.15651545273811676, 'fraction_numerical': 0.001445870233146575, 'mean_word_length': 1.8748051948051947, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4526689', 'n_tokens_mistral': 1591, 'n_tokens_neox': 1530, 'n_words': 258}