<commit_before>var data = require("../evals.json");
var questionData = require ("../questions.json");
var info = require('../logininfo.json');

exports.viewHistory = function(req, res) {

	var id = req.query.id;
	var pos;
	var curUserIdx = info['curUserIdx'];
	//console.log( "evalshistory= "+ curUserIdx);

	for( i = 0; i < data['answeredQuestion'].length; i++){
		var name = data['answeredQuestion'][i]['id'];
		if( name === id)
			pos = i;
	}
	var q = data['answeredQuestion'][pos]['question'];

	var lvl = parseInt(questionData['user'][curUserIdx]['level']);
	var lvlName = questionData['user'][curUserIdx]['levelNames'][lvl]['name'];

    res.render('evalshistory', {
    	"data" : questionData['user'][curUserIdx]['questionText'][0]['history'],
    	"levelName" : lvlName,
    	"question" : q
    });
};

<commit_msg>Evals hisotry<commit_after>var data = require("../evals.json");
var questionData = require ("../questions.json");
var info = require('../logininfo.json');

exports.viewHistory = function(req, res) {

	var id = req.query.id;
	var pos;
	var curUserIdx = info['curUserIdx'];

	for( i = 0; i < data['answeredQuestion'].length; i++){
		var name = data['answeredQuestion'][i]['id'];
		if( name === id)
			pos = i;
	}
	var q = data['answeredQuestion'][pos]['question'];

	var lvl = parseInt(questionData['user'][curUserIdx]['level']);
	var lvlName = questionData['user'][curUserIdx]['levelNames'][lvl]['name'];

    res.render('evalshistory', {
    	"data" : questionData['user'][curUserIdx]['questionText'][id]['history'],
    	"levelName" : lvlName,
    	"question" : q
    });
};


{'fraction_non_alphanumeric': 0.21375, 'fraction_numerical': 0.001875, 'mean_word_length': 4.758992805755396, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1742150', 'n_tokens_mistral': 565, 'n_tokens_neox': 543, 'n_words': 106}