Browse Source

Merge branch 'improve-assessment' of LInE/ivprog into master

Lucas de Souza 5 years ago
parent
commit
f28fff3bd5
3 changed files with 23 additions and 12 deletions
  1. 14 4
      css/ivprog-term.css
  2. 2 1
      i18n/pt/ui.json
  3. 7 7
      js/assessment/ivprogAssessment.js

+ 14 - 4
css/ivprog-term.css

@@ -10,15 +10,15 @@
 }
 
 .ivprog-term-userText, .ivprog-term-userInput {
-  color: white;
+  color: #f2d6d6;
 }
 
 .ivprog-term-info {
-  color: green;
+  color: #28a628;
 }
 
 .ivprog-term-error {
-  color: red;
+  color: #df4242;
 }
 
 .ivprog-term-input {
@@ -108,7 +108,7 @@
 .bash-body {
   /* margin: 0;
   padding: 5px; */
-  background: #141414;
+  background: #111010;
   /* list-style: none; */
   color: #F8F8FF;
   
@@ -175,4 +175,14 @@
   width: 0;
   height: 0;
   opacity: 0;
+}
+
+.ivprog-term-error > span > ul {
+  margin:0 !important;
+}
+
+.ivprog-term-error > span > ul > li {
+  padding: 0;
+  margin: 0;
+  line-height: 1rem;
 }

+ 2 - 1
i18n/pt/ui.json

@@ -115,5 +115,6 @@
   "text_ivprog_version":"Versão",
   "text_teacher_filter": "Filtro",
   "text_teacher_filter_active": "Ativado",
-  "text_teacher_filter_help": "Ao ativar o filtro, as modificações do iVProg estarão bloqueadas."
+  "text_teacher_filter_help": "Ao ativar o filtro, as modificações do iVProg estarão bloqueadas.",
+  "text_join_assessment_outputs": " ; "
 }

+ 7 - 7
js/assessment/ivprogAssessment.js

@@ -10,6 +10,7 @@ import { Config } from "../util/config";
 
 
 const LocalizedStrings = LocalizedStringsService.getInstance();
+const list_joiner = LocalizedStrings.getUI("text_join_assessment_outputs");
 
 const StringTypes = line_i18n.StringTypes;
 
@@ -33,7 +34,7 @@ export class IVProgAssessment {
       return testResult.then(function (total) {
         const grade = total / outerRef.testCases.length;
         const channel = grade == 1 ? DOMConsole.INFO : DOMConsole.ERR;
-        outerRef.writeToConsole(channel, StringTypes.MESSAGE, "test_suite_grade", grade * 100);
+        outerRef.writeToConsole(channel, StringTypes.MESSAGE, "test_suite_grade", (grade * 100).toFixed(2));
         return Promise.resolve(grade)
       }).catch(err => {
         outerRef.domConsole.err("Erro inesperado durante o cálculo da nota.");// try and show error messages through domconsole
@@ -59,10 +60,10 @@ export class IVProgAssessment {
       if (input.inputList.length !== input.index) {
         outerThis.showErrorMessage('test_case_few_reads', name+1);
         outerThis.showInfoMessage('test_case_duration', millis);
-        return Promise.resolve(accumulator + (input.index/inputList.length));
+        return Promise.resolve(accumulator);
       } else if (output.list.length != expectedOutputs.length) {
-        outerThis.showErrorMessage('test_case_failed', name + 1, inputList.join(','),
-          expectedOutputs.join(','), output.list.join(','));
+        outerThis.showErrorMessage('test_case_failed', name + 1, inputList.join(list_joiner),
+          expectedOutputs.join(list_joiner), output.list.join(list_joiner));
         outerThis.showInfoMessage('test_case_duration', millis);
         // must check for a partial match of the generated output
         const numMatchedOutputs = output.list.reduce((acc, actualOutput, index) => {
@@ -77,9 +78,8 @@ export class IVProgAssessment {
       } else {
         const isOk = outerThis.checkOutputLists(output.list, expectedOutputs);
         if(!isOk) {
-          console.log("not ok.");
-          outerThis.showErrorMessage('test_case_failed', name + 1, inputList.join(','),
-            expectedOutputs.join(','), output.list.join(','));
+          outerThis.showErrorMessage('test_case_failed', name + 1, inputList.join(list_joiner),
+            expectedOutputs.join(list_joiner), output.list.join(list_joiner));
           outerThis.showInfoMessage('test_case_duration', millis);
           return Promise.resolve(accumulator);
         } else {