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

    app.controller('programmingLandingCtrl', function ($scope, programmingLandingService, gymObj) {

        var pathwaysArr = [];
        for (var i = 0; i < gymObj.pathways.length; i++) {
            var pathwayInfo = {
                label: gymObj.pathways[i]["name"],
                value: gymObj.pathways[i]["_id"]
            };
            pathwaysArr.push(pathwayInfo);
        }
        $scope.pathwayOptions = pathwaysArr;
        $scope.pathwayID = "";

        $scope.onPathwaySelect = function () {
            var pathwaySpecificIds = {
                gymID: gymObj._id,
                pathwayID: $scope.pathwayID
            };
            (function getPathwayStages(id1) {
                programmingLandingService.getStages(id1).then(function (response) {
                    $scope.stageOptions = response;
                    $scope.stages = true;
                    $scope.stageID = "";
                    $scope.onStageSelect = function (name) {
                        var stageSpecificIds = {
                            name: name,
                            gymID: id1.gymID,
                            pathwayID: id1.pathwayID,
                            stageID: $scope.stageID
                        };
                        for (var i = 0; i < $scope.stageOptions.length; i++) {
                            if ($scope.stageOptions[i].value === stageSpecificIds.stageID) {
                                $scope.progressionShow = true;
                            } else {
                                $scope.progressionShow = false;
                            }
                        }
                        (function getStageEvals(id2) {
                            programmingLandingService.getEvals(id2).then(function (response) {
                                $scope.evaluationsList = response;
                                $scope.evaluations = true;
                                $scope.evalID = '';
                                //ADD EVALUATION
                                $scope.addEval = function () {
                                    $scope.addView = true;
                                    $scope.evaluations = false;
                                    $scope.addEvaluation = function (evalObj) {
                                        evalObj.gymID = id2.gymID;
                                        evalObj.pathwayID = id2.pathwayID;
                                        evalObj.stageID = id2.stageID;
                                        programmingLandingService.addEvalObj(evalObj).then(function (response) {
                                            $scope.addView = false;
                                            $scope.evaluations = true;
                                            getStageEvals(id2);
                                        });
                                    };
                                };
                                //EDIT EVALUATION
                                $scope.onEvalSelect = function (ID) {
                                    var evalSpecificsId = {
                                        gymID: id2.gymID,
                                        pathwayID: id2.pathwayID,
                                        stageID: id2.stageID,
                                        evalID: ID
                                    };
                                    (function getEvalInfo(id3) {
                                        programmingLandingService.getEvalDetails(id3).then(function (response) {
                                            $scope.evaluationObj = response;
                                            console.log($scope.evaluationObj);
                                            if ($scope.progressionShow === true) {
                                                $scope.evaluations = false;
                                                $scope.editView = false;
                                                $scope.editProgression = true;
                                            } else {
                                                $scope.evaluations = false;
                                                $scope.editProgression = false;
                                                $scope.editView = true;
                                            }
                                            $scope.addProgression = function (progression) {
                                                progression.gymID = id3.gymID;
                                                progression.pathwayID = id3.pathwayID;
                                                progression.stageID = id3.stageID;
                                                progression.evalID = id3.evalID;
                                                programmingLandingService.addProgression(progression).then(function (response) {
                                                    getEvalInfo(id3);
                                                });
                                            };
                                            $scope.editEval = function (editedEval) {
                                                editedEval.gymID = id3.gymID;
                                                editedEval.pathwayID = id3.pathwayID;
                                                editedEval.stageID = id3.stageID;
                                                editedEval.evalID = id3.evalID;
                                                editedEval.description = editedEval.content.explanation;
                                                editedEval.video = editedEval.content.video;
                                                programmingLandingService.editEvaluation(editedEval).then(function (response) {
                                                    $scope.editView = false;
                                                    $scope.evaluations = true;
                                                    getStageEvals(id2);
                                                });

                                            };
                                        });
                                    } (evalSpecificsId));
                                };
                                //DELETE EVALUATION
                                $scope.evalDelete = function (id4) {
                                    var evalSpecificsId = {
                                        gymID: id2.gymID,
                                        pathwayID: id2.pathwayID,
                                        stageID: id2.stageID,
                                        evalID: id4
                                    };
                                    programmingLandingService.deleteEval(evalSpecificsId).then(function (response) {
                                        console.log(response);
                                        getStageEvals(id2);
                                    });
                                };
                            });
                        } (stageSpecificIds));
                    };
                });
            } (pathwaySpecificIds));
        };
        $scope.cancel = function () {
            $scope.evaluations = true;
            $scope.editView = false;
            $scope.addView = false;
        };
    });
} ());<commit_msg>minor change to clear input text after submission<commit_after>(function () {
    'use strict';

    app.controller('programmingLandingCtrl', function ($scope, programmingLandingService, gymObj) {

        var pathwaysArr = [];
        for (var i = 0; i < gymObj.pathways.length; i++) {
            var pathwayInfo = {
                label: gymObj.pathways[i]["name"],
                value: gymObj.pathways[i]["_id"]
            };
            pathwaysArr.push(pathwayInfo);
        }
        $scope.pathwayOptions = pathwaysArr;
        $scope.pathwayID = "";

        $scope.onPathwaySelect = function () {
            var pathwaySpecificIds = {
                gymID: gymObj._id,
                pathwayID: $scope.pathwayID
            };
            (function getPathwayStages(id1) {
                programmingLandingService.getStages(id1).then(function (response) {
                    $scope.stageOptions = response;
                    $scope.stages = true;
                    $scope.stageID = "";
                    $scope.onStageSelect = function (name) {
                        var stageSpecificIds = {
                            name: name,
                            gymID: id1.gymID,
                            pathwayID: id1.pathwayID,
                            stageID: $scope.stageID
                        };
                        for (var i = 0; i < $scope.stageOptions.length; i++) {
                            if ($scope.stageOptions[i].value === stageSpecificIds.stageID) {
                                $scope.progressionShow = true;
                            } else {
                                $scope.progressionShow = false;
                            }
                        }
                        (function getStageEvals(id2) {
                            programmingLandingService.getEvals(id2).then(function (response) {
                                $scope.evaluationsList = response;
                                $scope.evaluations = true;
                                $scope.editView = false;
                                $scope.addView = false;
                                $scope.editProgression = false;
                                $scope.evalID = '';
                                //ADD EVALUATION
                                $scope.addEval = function () {
                                    $scope.addView = true;
                                    $scope.evaluations = false;
                                    $scope.addEvaluation = function (evalObj) {
                                        evalObj.gymID = id2.gymID;
                                        evalObj.pathwayID = id2.pathwayID;
                                        evalObj.stageID = id2.stageID;
                                        programmingLandingService.addEvalObj(evalObj).then(function (response) {
                                            $scope.addView = false;
                                            $scope.evaluations = true;
                                            getStageEvals(id2);
                                        });
                                    };
                                };
                                //EDIT EVALUATION
                                $scope.onEvalSelect = function (ID) {
                                    var evalSpecificsId = {
                                        gymID: id2.gymID,
                                        pathwayID: id2.pathwayID,
                                        stageID: id2.stageID,
                                        evalID: ID
                                    };
                                    (function getEvalInfo(id3) {
                                        programmingLandingService.getEvalDetails(id3).then(function (response) {
                                            $scope.evaluationObj = response;
                                            console.log($scope.evaluationObj);
                                            if ($scope.progressionShow === true) {
                                                $scope.evaluations = false;
                                                $scope.editView = false;
                                                $scope.editProgression = true;
                                            } else {
                                                $scope.evaluations = false;
                                                $scope.editProgression = false;
                                                $scope.editView = true;
                                            }
                                            //ADD PROGRESSION
                                            $scope.addProgression = function (progression) {
                                                progression.gymID = id3.gymID;
                                                progression.pathwayID = id3.pathwayID;
                                                progression.stageID = id3.stageID;
                                                progression.evalID = id3.evalID;
                                                programmingLandingService.addProgression(progression).then(function (response) {
                                                    $scope.newProgression.explanation = "";
                                                    getEvalInfo(id3);
                                                });
                                            };
                                            $scope.editEval = function (editedEval) {
                                                editedEval.gymID = id3.gymID;
                                                editedEval.pathwayID = id3.pathwayID;
                                                editedEval.stageID = id3.stageID;
                                                editedEval.evalID = id3.evalID;
                                                editedEval.description = editedEval.content.explanation;
                                                editedEval.video = editedEval.content.video;
                                                programmingLandingService.editEvaluation(editedEval).then(function (response) {
                                                    $scope.editView = false;
                                                    $scope.evaluations = true;
                                                    getStageEvals(id2);
                                                });

                                            };
                                        });
                                    } (evalSpecificsId));
                                };
                                //DELETE EVALUATION
                                $scope.evalDelete = function (id4) {
                                    var evalSpecificsId = {
                                        gymID: id2.gymID,
                                        pathwayID: id2.pathwayID,
                                        stageID: id2.stageID,
                                        evalID: id4
                                    };
                                    programmingLandingService.deleteEval(evalSpecificsId).then(function (response) {
                                        console.log(response);
                                        getStageEvals(id2);
                                    });
                                };
                            });
                        } (stageSpecificIds));
                    };
                });
            } (pathwaySpecificIds));
        };
        $scope.cancel = function () {
            $scope.evaluations = true;
            $scope.editView = false;
            $scope.addView = false;
            $scope.editProgression = false;
        };
    });
} ());
{'fraction_non_alphanumeric': 0.07082707748547555, 'fraction_numerical': 0.004308375220314642, 'mean_word_length': 0.6563952859768624, 'pattern_counts': {'":': 0, '<': 7, '<?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': 206, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '421502', 'n_tokens_mistral': 2827, 'n_tokens_neox': 2674, 'n_words': 436}