1234567891011121314151617181920212223242526272829303132333435363738 |
- 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, exerciseType, testCases, domConsole) {
- this.ast_code = ast_code;
- this.exerciseType = exerciseType;
- 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);
- }
- }
|