|
@@ -28,6 +28,7 @@ const functionsChangeListeners = [];
|
|
let proc = null;
|
|
let proc = null;
|
|
let domConsole = null;
|
|
let domConsole = null;
|
|
let _testCases = [];
|
|
let _testCases = [];
|
|
|
|
+let _exerciseType = [];
|
|
let isRunning = false;
|
|
let isRunning = false;
|
|
window.studentGrade = null;
|
|
window.studentGrade = null;
|
|
window.LocalizedStrings = LocalizedStrings;
|
|
window.LocalizedStrings = LocalizedStrings;
|
|
@@ -875,12 +876,22 @@ export function setTestCases (testCases) {
|
|
_testCases = testCases;
|
|
_testCases = testCases;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+export function setExerciseType (exerciseType) {
|
|
|
|
+ _exerciseType = exerciseType;
|
|
|
|
+}
|
|
|
|
+
|
|
export function getTestCases () {
|
|
export function getTestCases () {
|
|
// Deep clone of test cases to avoid unauthorized modification
|
|
// Deep clone of test cases to avoid unauthorized modification
|
|
// TODO: It may be not possible to use this once custom test are fully implemented
|
|
// TODO: It may be not possible to use this once custom test are fully implemented
|
|
return JSON.parse(JSON.stringify(_testCases));
|
|
return JSON.parse(JSON.stringify(_testCases));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+export function getExerciseType () {
|
|
|
|
+ // Deep clone of exercise type to avoid unauthorized modification
|
|
|
|
+ // TODO: It may be not possible to use this once custom test are fully implemented
|
|
|
|
+ return _exerciseType;
|
|
|
|
+}
|
|
|
|
+
|
|
var is_iassign = false;
|
|
var is_iassign = false;
|
|
|
|
|
|
function updateSequenceParameters (oldIndex, newIndex, function_obj) {
|
|
function updateSequenceParameters (oldIndex, newIndex, function_obj) {
|
|
@@ -927,7 +938,7 @@ function runCodeAssessment () {
|
|
try {
|
|
try {
|
|
const data = SemanticAnalyser.analyseFromSource(strCode);
|
|
const data = SemanticAnalyser.analyseFromSource(strCode);
|
|
isRunning = true;
|
|
isRunning = true;
|
|
- const runner = new IVProgAssessment(data, _testCases, domConsole);
|
|
|
|
|
|
+ const runner = new IVProgAssessment(data, _exerciseType, _testCases, domConsole);
|
|
runner.runTest().then(grade => {
|
|
runner.runTest().then(grade => {
|
|
if (!is_iassign) {
|
|
if (!is_iassign) {
|
|
parent.getEvaluationCallback(grade);
|
|
parent.getEvaluationCallback(grade);
|