<commit_before>
module.exports.changeOfBaseQuestion = function(randomStream) {
	var number = randomStream.nextIntRange(240)+15;

	var baseArray = [ {base: "decimal", value: number.toString(10), radix: 10}, {base: "hexadecimal", value: number.toString(16), radix: 16}, {base: "binary", value: number.toString(2), radix: 2} ];

	randomStream.shuffle(baseArray);

	this.a = baseArray[0];
	this.b = baseArray[1];

	//Array of {String, bool} pairs: the string representation of a number in a particular base
	//and a flag indicating whether or not it is the correct answer.
	this.answerChoices = [ 
		{value: this.b.value, flag: true}, 
		{value: (randomStream.nextIntRange(240)+15).toString(this.b.radix), flag: false},
		{value: (randomStream.nextIntRange(240)+15).toString(this.b.radix), flag: false},
		{value: (randomStream.nextIntRange(240)+15).toString(this.b.radix), flag: false} 
	];

	randomStream.shuffle(this.answerChoices);

	//Find the correct answer
	this.answer = 0;
	for(var i=0; i<this.answerChoices.length; i++) {
		if(this.answerChoices[i].flag == true)
			this.answer = i;           
	}
	this.choices = this.answerChoices.map(function(c) {
		return c.value;
	});
	this.format = 'multiple-choice';
};


<commit_msg>Added question property to changeOfBase.<commit_after>
module.exports.changeOfBaseQuestion = function(randomStream) {
	var number = randomStream.nextIntRange(240)+15;

	var baseArray = [ {base: "decimal", value: number.toString(10), radix: 10}, {base: "hexadecimal", value: number.toString(16), radix: 16}, {base: "binary", value: number.toString(2), radix: 2} ];

	randomStream.shuffle(baseArray);

	this.a = baseArray[0];
	this.b = baseArray[1];

	//Array of {String, bool} pairs: the string representation of a number in a particular base
	//and a flag indicating whether or not it is the correct answer.
	this.answerChoices = [ 
		{value: this.b.value, flag: true}, 
		{value: (randomStream.nextIntRange(240)+15).toString(this.b.radix), flag: false},
		{value: (randomStream.nextIntRange(240)+15).toString(this.b.radix), flag: false},
		{value: (randomStream.nextIntRange(240)+15).toString(this.b.radix), flag: false} 
	];

	randomStream.shuffle(this.answerChoices);

	//Find the correct answer
	this.answer = 0;
	for(var i=0; i<this.answerChoices.length; i++) {
		if(this.answerChoices[i].flag == true)
			this.answer = i;           
	}
	this.choices = this.answerChoices.map(function(c) {
		return c.value;
	});
	this.format = 'multiple-choice';
	this.question = "Convert " + this.a.value + " from " + this.a.base + " to " + this.b.base + ".";
};



{'fraction_non_alphanumeric': 0.1620889748549323, 'fraction_numerical': 0.02630560928433269, 'mean_word_length': 4.537473233404711, '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': '3711721', 'n_tokens_mistral': 973, 'n_tokens_neox': 885, 'n_words': 203}