<commit_before>Db = require 'db'
Dom = require 'dom'
Modal = require 'modal'
Obs = require 'obs'
Plugin = require 'plugin'
Page = require 'page'
Server = require 'server'
Ui = require 'ui'
Icon = require 'icon'
Form = require 'form'
{tr} = require 'i18n'
Util = require 'util'

exports.render = ->
	# TODO: Remove this when done.
	Dom.h2 Page.state.get(0) + ': ' + Page.state.get(1) + ': ' + Page.state.get(2)
	if Page.state.get(0) is 'advanced'
		renderAdvanded()
	else if Page.state.get(0) is 'round'
		renderRound(Page.state.get(1))
	else
		renderRoundList()

getRoundList = ->
	round_list = []

	Db.shared.ref('rounds').observeEach (round) !->
		round_list.push round

	round_list

renderRound = (round_no) ->
	round = Db.shared.ref 'rounds', round_no

	Dom.div ->
		Dom.style fontSize: '300%', fontWeight: 'bold', textShadow: '0 1px 0 #fff', textAlign: 'center', padding: '4px 10px 10px 10px'
		Dom.text Util.stringToQuestion(round.get('question'))

	if round.get('finished')
		Ui.bigButton 'Go to advanced...', -> Page.nav ['advanced']
<commit_msg>Remove old debugging thingymagig<commit_after>Db = require 'db'
Dom = require 'dom'
Modal = require 'modal'
Obs = require 'obs'
Plugin = require 'plugin'
Page = require 'page'
Server = require 'server'
Ui = require 'ui'
Icon = require 'icon'
Form = require 'form'
{tr} = require 'i18n'
Util = require 'util'

exports.render = ->
	if Page.state.get(0) is 'advanced'
		renderAdvanded()
	else if Page.state.get(0) is 'round'
		renderRound(Page.state.get(1))
	else
		renderRoundList()

getRoundList = ->
	round_list = []

	Db.shared.ref('rounds').observeEach (round) !->
		round_list.push round

	round_list

renderRound = (round_no) ->
	round = Db.shared.ref 'rounds', round_no

	Dom.div ->
		Dom.style fontSize: '300%', fontWeight: 'bold', textShadow: '0 1px 0 #fff', textAlign: 'center', padding: '4px 10px 10px 10px'
		Dom.text Util.stringToQuestion(round.get('question'))

	if round.get('finished')
		Ui.bigButton 'Go to advanced...', -> Page.nav ['advanced']

{'fraction_non_alphanumeric': 0.1617866004962779, 'fraction_numerical': 0.019851116625310174, 'mean_word_length': 4.277486910994765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '564141', 'n_tokens_mistral': 776, 'n_tokens_neox': 716, 'n_words': 194}