import * as LocalizedStringsService from "../services/localizedStringsService"; import { Config } from "../util/config"; const LocalizedStrings = LocalizedStringsService.getInstance(); const AssessmentConfig = { max_instruction_count: 350250, suspend_threshold: 200, }; export class Assessment { constructor (ast_code, testCases, domConsole) { this.ast_code = ast_code; this.testCases = testCases; this.domConsole = domConsole; this.old_config = JSON.parse(JSON.stringify(Config)); Config.setConfig(AssessmentConfig); } runTest () { // abstract } showErrorMessage (errorID, ...args) { this.domConsole.err(LocalizedStrings.getError(errorID, args)); } showInfoMessage (msgID, ...args) { this.domConsole.info(LocalizedStrings.getMessage(msgID, args)); } writeToConsole (channel, msgType, msgID, ...args) { let msg = LocalizedStrings.getString(msgID, msgType); msg = LocalizedStrings.processString(msg, args); this.domConsole.writeRawHTML(msg, channel); } }