<commit_before># coding=utf-8
from app import mongo_utils
from bson import json_util
from flask import Blueprint, render_template, request, Response,session
import json
import time
from datetime import datetime

from operator import itemgetter
mod_main = Blueprint('main', __name__)

@mod_main.route('/', methods=['GET'])
def index():
    project_enabled = mongo_utils.get_enabled_project()
    for project in json.loads(json_util.dumps(project_enabled)):
        year=project['year']
        docs = mongo_utils.find_all(project['year'])
        count_questions = mongo_utils.get_nr_questions_front(project['year'])
        questions = mongo_utils.find_all_questions(project['year'])
        timestamp = int(time.mktime(datetime.now().timetuple()))
        session['user_id'] = timestamp
        user_id = session['user_id']
    date=datetime.utcnow()
    mongo_utils.insert_user_session(user_id,year,date)
    return render_template('mod_main/index.html', docs=json.loads(json_util.dumps(docs)),questions=json.loads(json_util.dumps(questions)), count_questions=count_questions,user_id=user_id)

@mod_main.route('/results/<int:user_id>', methods=['GET'])
def results(user_id):
    project_enabled = mongo_utils.get_enabled_project()
    for project in json.loads(json_util.dumps(project_enabled)):
        docs = mongo_utils.find_all(project['year'])
        results=mongo_utils.find_user_session_answers(project['year'],user_id)
<commit_msg>under constuction page<commit_after># coding=utf-8
from app import mongo_utils
from bson import json_util
from flask import Blueprint, render_template, request, Response,session
import json
import time
from datetime import datetime

from operator import itemgetter
mod_main = Blueprint('main', __name__)

@mod_main.route('/', methods=['GET'])
def index():
    project_enabled = mongo_utils.get_enabled_project()
    for project in json.loads(json_util.dumps(project_enabled)):
        year=project['year']
        docs = mongo_utils.find_all(project['year'])
        count_questions = mongo_utils.get_nr_questions_front(project['year'])
        questions = mongo_utils.find_all_questions(project['year'])
        timestamp = int(time.mktime(datetime.now().timetuple()))
        session['user_id'] = timestamp
        user_id = session['user_id']
    date=datetime.utcnow()
    mongo_utils.insert_user_session(user_id,year,date)
    return render_template('mod_main/under_construction.html', docs=json.loads(json_util.dumps(docs)),questions=json.loads(json_util.dumps(questions)), count_questions=count_questions,user_id=user_id)

@mod_main.route('/results/<int:user_id>', methods=['GET'])
def results(user_id):
    project_enabled = mongo_utils.get_enabled_project()
    for project in json.loads(json_util.dumps(project_enabled)):
        docs = mongo_utils.find_all(project['year'])
        results=mongo_utils.find_user_session_answers(project['year'],user_id)

{'fraction_non_alphanumeric': 0.12181693048864418, 'fraction_numerical': 0.0006882312456985547, 'mean_word_length': 5.713625866050808, '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': '2809298', 'n_tokens_mistral': 922, 'n_tokens_neox': 907, 'n_words': 150}