<commit_before>/* Add modules */
var config = require("../config/config"),
	db = require("../config/database"),
	auth = require("../config/authentication");

/* Homepage */
exports.index = function(req, res) {
	db.User.find(function (err, users) {
		if (err) console.log("ERROR", "fetching all users:", err);
		res.render('index', { user: req.user, users: users, errors: req.flash('error') });
	});
};

/* Study section */
exports.study = function(req, res) {
	if (!req.user) {
		req.session.passport.user = auth.generateGuest();
		req.user = req.session.passport.user;
	}
	res.render('study', { user: req.user });
}

/* Coding section */
exports.coding = function(req, res) {
	if (!req.user) {
		req.session.passport.user = auth.generateGuest();
		req.user = req.session.passport.user;
	}
	res.render('coding', { user: req.user });
};

/* Sumorobot programming section */
exports.sumorobot = function(req, res) {
	if (!req.user) {
		req.session.passport.user = auth.generateGuest();
		req.user = req.session.passport.user;
	}
	res.render('sumorobot', { user: req.user });
};<commit_msg>auth to utils<commit_after>/* Add modules */
var db = require('../config/database'),
	utils = require('../config/utils'),
	config = require('../config/config');

/* Homepage */
exports.index = function(req, res) {
	db.User.find(function (err, users) {
		if (err) console.log("ERROR", "fetching all users:", err);
		res.render('index', { user: req.user, users: users, errors: req.flash('error') });
	});
};

/* Study section */
exports.study = function(req, res) {
	if (!req.user) {
		req.session.passport.user = utils.generateGuest();
		req.user = req.session.passport.user;
	}
	res.render('study', { user: req.user });
}

/* Coding section */
exports.coding = function(req, res) {
	if (!req.user) {
		req.session.passport.user = utils.generateGuest();
		req.user = req.session.passport.user;
	}
	res.render('coding', { user: req.user });
};

/* Sumorobot programming section */
exports.sumorobot = function(req, res) {
	if (!req.user) {
		req.session.passport.user = utils.generateGuest();
		req.user = req.session.passport.user;
	}
	res.render('sumorobot', { user: req.user });
};
{'fraction_non_alphanumeric': 0.2028584601198709, 'fraction_numerical': 0.0, 'mean_word_length': 3.965675057208238, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2045170', 'n_tokens_mistral': 786, 'n_tokens_neox': 759, 'n_words': 150}