<commit_before>'use strict';

var mongoose = require('mongoose');
var TeachingAdvising = mongoose.model('TeachingAdvising');

var modelClass = require('../modelClass');
var renderModel = new modelClass.RenderModel( TeachingAdvising, 'teachingAdvising/teachingAdvising.tex', 'teachingAdvising/na.tex');

/*
will explicitly populate the report with
the data you provide
*/
renderModel.setDebugPopulate( false, {
	info: 'My teaching philosophy is...and I taught the following courses: '
});

/*
will explicitely print the N/A latex
to the screen for debugging purposes
*/
renderModel.isDebugNull = false;

/*
render function that finds the obj in the database
and converts it into latex.
*/
module.exports.render = function(req, callback) {
	renderModel.render(req, callback);
};

/*
Gets the data from the frontend and
saves it in the database.
*/
module.exports.submit = function(req, callback) {
	var teachingAdvising = new TeachingAdvising({
		info: req.body.teachingAdvising.advising,
		user: req.user
	});

	teachingAdvising.save(function(err) {
		callback(err, teachingAdvising);
	});
};



/*'use strict';

var renderModel = require('../../../app/templates/renderModel');
var mongoose = require('mongoose');

// Compile Schema into Model here
var TeachingAdvising = mongoose.model('TeachingAdvising');

/*<commit_msg>more stuff<commit_after>'use strict';

var mongoose = require('mongoose');
var TeachingAdvising = mongoose.model('TeachingAdvising');

var modelClass = require('../modelClass');
var renderModel = new modelClass.RenderModel( TeachingAdvising, 'teachingAdvising/teachingAdvising.tex', 'teachingAdvising/na.tex');

/*
will explicitly populate the report with
the data you provide
*/
renderModel.setDebugPopulate( false, {
	info: 'My teaching philosophy is...and I taught the following courses: '
});

/*
will explicitely print the N/A latex
to the screen for debugging purposes
*/
renderModel.isDebugNull = false;

/*
render function that finds the obj in the database
and converts it into latex.
*/
module.exports.render = function(req, callback) {
	renderModel.render(req, callback);
};

/*
Gets the data from the frontend and
saves it in the database.
*/
module.exports.submit = function(req, callback) {
	if (!req.body.teachingAdvising)
		return;


	var teachingAdvising = new TeachingAdvising({
		info: req.body.teachingAdvising.advising,
		user: req.user
	});

	teachingAdvising.save(function(err) {
		callback(err, teachingAdvising);
	});
};



/*'use strict';

var renderModel = require('../../../app/templates/renderModel');
var mongoose = require('mongoose');

// Compile Schema into Model here
var TeachingAdvising = mongoose.model('TeachingAdvising');

/*
{'fraction_non_alphanumeric': 0.12583767684288905, 'fraction_numerical': 0.0, 'mean_word_length': 4.918502202643172, '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': '4889169', 'n_tokens_mistral': 826, 'n_tokens_neox': 800, 'n_words': 234}