<commit_before>require('app/styles/editor/verifier/verifier-view.sass')
async = require('vendor/scripts/async.js')
utils = require 'core/utils'
aetherUtils = require 'lib/aether_utils'

RootView = require 'views/core/RootView'
template = require 'templates/editor/verifier/verifier-view'
VerifierTest = require './VerifierTest'
SuperModel = require 'models/SuperModel'
Campaigns = require 'collections/Campaigns'
Level = require 'models/Level'

module.exports = class VerifierView extends RootView
  className: 'style-flat'
  template: template
  id: 'verifier-view'

  events:
    'click #go-button': 'onClickGoButton'

  constructor: (options, @levelID) ->
    super options
    # TODO: sort tests by unexpected result first
    @passed = 0
    @failed = 0
    @problem = 0
    @testCount = 0

    if utils.getQueryVariable('dev')
      @supermodel.shouldSaveBackups = (model) ->  # Make sure to load possibly changed things from localStorage.
        model.constructor.className in ['Level', 'LevelComponent', 'LevelSystem', 'ThangType']

    @cores = window.navigator.hardwareConcurrency or 4
    @careAboutFrames = true

    if @levelID
      @levelIDs = [@levelID]
      @testLanguages = ['python', 'javascript', 'java', 'cpp', 'lua', 'coffeescript']
      @cores = 1
      @startTestingLevels()
    else
      @campaigns = new Campaigns()
      @supermodel.trackRequest @campaigns.fetch(data: {project: 'slug,type,levels'})
      @campaigns.comparator = (m) ->
        ['intro', 'course-2', 'course-3', 'course-4', 'course-5', 'course-6', 'course-8',<commit_msg>Fix individual level verifier test view<commit_after>require('app/styles/editor/verifier/verifier-view.sass')
async = require('vendor/scripts/async.js')
utils = require 'core/utils'
aetherUtils = require 'lib/aether_utils'

RootView = require 'views/core/RootView'
template = require 'templates/editor/verifier/verifier-view'
VerifierTest = require './VerifierTest'
SuperModel = require 'models/SuperModel'
Campaigns = require 'collections/Campaigns'
Level = require 'models/Level'

module.exports = class VerifierView extends RootView
  className: 'style-flat'
  template: template
  id: 'verifier-view'

  events:
    'click #go-button': 'onClickGoButton'

  constructor: (options, @levelID) ->
    super options
    # TODO: sort tests by unexpected result first
    @passed = 0
    @failed = 0
    @problem = 0
    @testCount = 0

    if utils.getQueryVariable('dev')
      @supermodel.shouldSaveBackups = (model) ->  # Make sure to load possibly changed things from localStorage.
        model.constructor.className in ['Level', 'LevelComponent', 'LevelSystem', 'ThangType']

    @cores = window.navigator.hardwareConcurrency or 4
    @careAboutFrames = true

    if @levelID
      @levelIDs = [@levelID]
      @testLanguages = ['python', 'javascript', 'java', 'cpp', 'lua', 'coffeescript']
      @codeLanguages = ({id: c, checked: true} for c in @testLanguages)
      @cores = 1
      @startTestingLevels()
    else
      @campaigns = new Campaigns()
      @supermodel.trackRequest @campaigns.fetch(data: {project: 'slug,type,levels'})
      @campaigns.comparator = (m) ->
        ['intro', 'course-2', 'course-3', 'course-4', 'course-5', 'course-6', 'course-8',
{'fraction_non_alphanumeric': 0.13535228677379482, 'fraction_numerical': 0.007416563658838072, 'mean_word_length': 3.9045454545454548, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4220247', 'n_tokens_mistral': 1037, 'n_tokens_neox': 996, 'n_words': 249}