<commit_before>(function (module) {
    'use strict';

    module.controller('loginController', function ($scope, fbRef) {

        var date = new Date();
        $scope.dateStr = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate();

        $scope.isTeacher = false;

        $scope.isLogIn = function () {
            return $scope.authData !== null;
        };

        function authDataCallback(authData) {
            $scope.authData = authData;
            //console.log("authDataCallback() is called", $scope.authData);
            if (authData) {
                $scope.loginStatusMessage = "ログインしています！ uid is " + authData.uid + "";
                loadClassData(authData);
            } else {
                $scope.loginStatusMessage = "ログインしていません";
                loadClassData(null);

            }
            console.log($scope.loginStatusMessage);

            //isTeacherLogIn();

        }

        $scope.logOut = function () {
            fbRef.unauth();
        };

        $scope.logIn = function () {
            //console.log($scope.loginInfo);
            //var error;
            //var authData;
            fbRef.authWithPassword($scope.loginInfo, function (error, authData) {
                if (error) {
                    console.log("Login Failed!", error);
                } else {
                    console.log("Authenticated successfully with payload:", authData);
                    window.setTimeout(fbRef.onAuth(authDataCallback), 200);
                    location.href = 'user-setting.html';
                }

            })
        };

        $scope.studentLogIn = function () {
            var uid = $scope.studentLoginInfo.uid;
            var password = $<PASSWORD>;
            var email = $scope.usersData[uid]["email"];
            var loginInfo = {email: email, password: password};

            fbRef.authWithPassword(loginInfo, function (error, authData) {
                if (error) {
                    console.log("Login Failed!", error);
                } else {
                    console.log("Authenticated successfully with payload:", authData);
                    window.setTimeout(fbRef.onAuth(authDataCallback), 2000)
                    location.href = 'login-sample.html';
                }

            })
        };

        var getParam = getUrlVars();
        if (getParam.class !== null) {
            $scope.classUid = getParam.class;
            console.log("$scope.classUid", $scope.classUid);
        }

        //ユーザ認証した後に各種データを読み込む関数
        var loadClassData = function (authData) {

            var loadClassDataInner = function () {
                var fbClasses = fbRef.child("classes");
                console.log("hogehoge", $scope.classUid);
                if ($scope.classUid) {
                    fbClasses.once("value", function (data) {
                        $scope.classHash = data.val();
                        $scope.classUids = Object.keys($scope.classHash);
                        console.log("hogehoge2", $scope.classUid);
                        $scope.currentClassName = $scope.classHash[$scope.classUid]["name"];
                        //console.log("keys: ", Object.keys($scope.classHash));
                        //$scope.classKeys = data.val();
                        console.log(data.val());<commit_msg>不要なデバッグメッセージを削除<commit_after>(function (module) {
    'use strict';

    module.controller('loginController', function ($scope, fbRef) {

        var date = new Date();
        $scope.dateStr = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate();

        $scope.isTeacher = false;

        $scope.isLogIn = function () {
            return $scope.authData !== null;
        };

        function authDataCallback(authData) {
            $scope.authData = authData;
            if (authData) {
                $scope.loginStatusMessage = "ログインしています！ uid is " + authData.uid + "";
                loadClassData(authData);
            } else {
                $scope.loginStatusMessage = "ログインしていません";
                loadClassData(null);

            }
            console.log($scope.loginStatusMessage);

            //isTeacherLogIn();

        }

        $scope.logOut = function () {
            fbRef.unauth();
        };

        $scope.logIn = function () {
            //console.log($scope.loginInfo);
            //var error;
            //var authData;
            fbRef.authWithPassword($scope.loginInfo, function (error, authData) {
                if (error) {
                    console.log("Login Failed!", error);
                } else {
                    console.log("Authenticated successfully with payload:", authData);
                    window.setTimeout(fbRef.onAuth(authDataCallback), 200);
                    location.href = 'user-setting.html';
                }

            })
        };

        $scope.studentLogIn = function () {
            var uid = $scope.studentLoginInfo.uid;
            var password = $scope.studentLoginInfo.password;
            var email = $scope.usersData[uid]["email"];
            var loginInfo = {email: email, password: password};

            fbRef.authWithPassword(loginInfo, function (error, authData) {
                if (error) {
                    console.log("Login Failed!", error);
                } else {
                    console.log("Authenticated successfully with payload:", authData);
                    window.setTimeout(fbRef.onAuth(authDataCallback), 2000)
                    location.href = 'login-sample.html';
                }

            })
        };

        var getParam = getUrlVars();
        if (getParam.class !== null) {
            $scope.classUid = getParam.class;
            console.log("$scope.classUid", $scope.classUid);
        }

        //ユーザ認証した後に各種データを読み込む関数
        var loadClassData = function (authData) {

            var loadClassDataInner = function () {
                var fbClasses = fbRef.child("classes");
                if ($scope.classUid) {
                    fbClasses.once("value", function (data) {
                        $scope.classHash = data.val();
                        $scope.classUids = Object.keys($scope.classHash);
                        $scope.currentClassName = $scope.classHash[$scope.classUid]["name"];
                        //console.log("keys: ", Object.keys($scope.classHash));
                        //$scope.classKeys = data.val();
                        console.log(data.val());
{'fraction_non_alphanumeric': 0.12654130702836006, 'fraction_numerical': 0.002311960542540074, 'mean_word_length': 1.5278535255161667, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '880046', 'n_tokens_mistral': 1826, 'n_tokens_neox': 1698, 'n_words': 293}