Browse Source

Fix a bug that prevented the output matching assessment to produce diff when the expected output is not a string

Fix i18n ui file not providing the correct text for boolean values

Update project dependencies
Lucas de Souza 4 years ago
parent
commit
556a2df7a3
4 changed files with 1909 additions and 1369 deletions
  1. 2 2
      i18n/ui.csv
  2. 5 3
      js/assessment/output_matching/output_matching.js
  3. 1882 1344
      package-lock.json
  4. 20 20
      package.json

+ 2 - 2
i18n/ui.csv

@@ -20,8 +20,8 @@ program,programa,program,
 type_text,cadeia,string,
 textvar_default_value,texto,text,
 type_boolean,logico,bool,
-logic_value_true,1,1,
-logic_value_false,0,0,
+logic_value_true,verdadeiro,true,
+logic_value_false,falso,false,
 variable,Variável,Variable,
 command,Comando,Command,
 new_parameter,parametro,parameter,

+ 5 - 3
js/assessment/output_matching/output_matching.js

@@ -82,14 +82,14 @@ export class OutputMatching {
   outputMatch (g_output, e_output) {
     if(OutputMatching.NUM_REGEX.test(e_output)) {
       if(!OutputMatching.NUM_REGEX.test(g_output)) {
-        return OutputResult.createNumberResult(e_output, g_output, 0);
+        return this.checkStrings(g_output, e_output);
       }
       const g_num = new Decimal(g_output);
       const e_num = new Decimal(e_output);
       return this.checkNumbers(g_num, e_num);
     } else if (OutputMatching.BOOLEAN_REGEX.test(e_output)) {
       if (!OutputMatching.BOOLEAN_REGEX.test(g_output)) {
-        return OutputResult.createBoolResult(e_output, g_output, 0);
+        return this.checkStrings(g_output, e_output)
       }
       const g_bool = TypeParser.toBool(g_output);
       const e_bool = TypeParser.toBool(e_output);
@@ -162,7 +162,9 @@ export class OutputMatching {
       assessmentList.push(boolGrade);
     }
     const dist = levenshteinDistance(g_output_clean, e_output_clean);
-    const gradeDiff = Math.max(0, e_output_clean.length - dist)/e_output_clean.length;
+    console.log(dist,g_output_clean,e_output_clean);
+    let gradeDiff = Math.max(0, e_output_clean.length - dist)/e_output_clean.length;
+    gradeDiff = Number.isNaN(gradeDiff) ? 0 : gradeDiff;
     const assessment_size = assessmentList.length + 1;
     const gradeAcc = assessmentList.reduce((prev, val) => prev + val/assessment_size, 0);
     const finalGrade = 1 * (gradeDiff/assessment_size + gradeAcc);

File diff suppressed because it is too large
+ 1882 - 1344
package-lock.json


+ 20 - 20
package.json

@@ -26,35 +26,35 @@
   },
   "homepage": "https://git.lcalion.com/ivprog#readme",
   "devDependencies": {
-    "@babel/core": "^7.4.3",
-    "@babel/preset-env": "^7.4.3",
-    "@typescript-eslint/eslint-plugin": "^2.0.0",
-    "@typescript-eslint/parser": "^2.0.0",
+    "@babel/core": "^7.6.2",
+    "@babel/preset-env": "^7.6.2",
+    "@typescript-eslint/eslint-plugin": "^2.3.2",
+    "@typescript-eslint/parser": "^2.3.2",
     "antlr4-webpack-loader": "^0.1.1",
-    "babel-loader": "^8.0.5",
-    "clean-webpack-plugin": "^2.0.1",
-    "copy-webpack-plugin": "^5.0.2",
-    "eslint": "^6.1.0",
-    "html-webpack-plugin": "^4.0.0-beta.5",
-    "jasmine-core": "^3.4.0",
-    "karma": "^4.1.0",
+    "babel-loader": "^8.0.6",
+    "clean-webpack-plugin": "^2.0.2",
+    "copy-webpack-plugin": "^5.0.4",
+    "eslint": "^6.5.1",
+    "html-webpack-plugin": "^4.0.0-beta.8",
+    "jasmine-core": "^3.5.0",
+    "karma": "^4.3.0",
     "karma-chrome-launcher": "^2.2.0",
     "karma-jasmine": "^2.0.1",
     "karma-mocha-reporter": "^2.2.5",
     "karma-webpack": "^3.0.5",
-    "puppeteer-core": "^1.7.0",
-    "ts-loader": "^5.4.3",
-    "typescript": "^3.4.5",
-    "webpack": "^4.30.0",
-    "webpack-cli": "^3.3.1"
+    "puppeteer-core": "^1.20.0",
+    "ts-loader": "^5.4.5",
+    "typescript": "^3.6.3",
+    "webpack": "^4.41.0",
+    "webpack-cli": "^3.3.9"
   },
   "dependencies": {
     "antlr4": "^4.7.2",
-    "codemirror": "^5.48.0",
-    "csv-parser": "^2.3.0",
-    "decimal.js": "^10.1.1",
+    "codemirror": "^5.49.0",
+    "csv-parser": "^2.3.1",
+    "decimal.js": "^10.2.0",
     "line-i18n": "git+http://200.144.254.107/git/LInE/line-i18n.git",
     "melanke-watchjs": "^1.5.0",
-    "server": "^1.0.18"
+    "server": "^1.0.19"
   }
 }