Selaa lähdekoodia

Version update

Gustavo Grancieiro 2 vuotta sitten
vanhempi
commit
cc12add8d4

+ 3 - 1
src/app/component-registry/trash-component.js

@@ -10,8 +10,10 @@ class TrashComponent extends Component {
     );
     super(new TrashDrawer(), options);
     document.addEventListener('keyup', (event) => {
-      if (event.key === "Delete")
+      if (event.key === "Delete") {
+        console.log('addEventListener: Início')
         this.draw(event);
+      }
     });
   }
 }

+ 0 - 3
src/app/components/trash-component/drawers/trash-drawer.js

@@ -19,14 +19,11 @@ export class TrashDrawer extends SelectableDrawer {
   }
 
   delete(aggregator) {
-
     Objects.removeAggregator(aggregator);
     aggregator.aggregators.forEach(dependenceAggregator => {
       this.delete(dependenceAggregator);
-
     });
     aggregator.visible = false;
-
   }
 
   update(aggregator, e) {

+ 1 - 0
src/app/core/application/header-menu.js

@@ -24,6 +24,7 @@ class HeaderMenu {
       window.URL.revokeObjectURL(url);
     }, 0);
   }
+
   open() {
     $("#input-file").click();
   }

+ 43 - 0
src/app/core/application/integration-functions.js

@@ -0,0 +1,43 @@
+// Lê parâmetros informados pelo iTarefa via URL
+function getParameterByName (name) {
+	var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
+  return match ? decodeURIComponent(match[1].replace(/\+/g, ' ')) : null;
+}
+
+// Array com parâmetros informados pelo iTarefa via URL
+var iLMparameters = {
+	iLM_PARAM_Authoring: getParameterByName("iLM_PARAM_Authoring"), // if defined, then is teacher, allow edit
+  iLM_PARAM_ServerToGetAnswerURL: getParameterByName("iLM_PARAM_ServerToGetAnswerURL"),
+  iLM_PARAM_SendAnswer: getParameterByName("iLM_PARAM_SendAnswer"),
+  iLM_PARAM_AssignmentURL: getParameterByName("iLM_PARAM_AssignmentURL"),
+  iLM_PARAM_Assignment: getParameterByName("iLM_PARAM_Assignment"),
+  iLM_PARAM_TeacherAutoEval: getParameterByName("iLM_PARAM_TeacherAutoEval"),
+  lang: getParameterByName("lang")
+}
+
+// Função chamada pelo iTarefa quando o professor finaliza a criação da atividade
+// ou quando o aluno finaliza a resolução do exercício
+function getAnswer () {
+	// Se o parâmetro iLM_PARAM_SendAnswer for false, trata-se de resolução de atividade
+	if (iLMparameters.iLM_PARAM_SendAnswer == 'false') {
+
+		// TODO -> Retornar resposta do aluno
+		const layer = stageManager.getCurrentLayer();
+    	const file = layer.actionManager.save();
+		return file;
+
+	} else {
+		return 0;
+	}
+}
+
+// Função chamada pelo iTarefa para receber nota do aluno em atividade (0.0-1.0)
+function getEvaluation () {
+	if (iLMparameters.iLM_PARAM_SendAnswer == 'false') {
+		// TODO
+		var nota = 1.0
+
+		// A chamada do método abaixo é obrigatória!
+		parent.getEvaluationCallback(nota);
+	}
+}

+ 7 - 2
src/app/core/drawers/layer.js

@@ -43,11 +43,16 @@ export class Layer {
   }
   removeAggregator(aggregator) {
     let index = this.aggregators.indexOf(aggregator);
+    
+    //console.log('indexOf(aggregator): ', index) Debug
+
     this.aggregators.splice(index, 1);
-    if (this.selectedAggregators.includes(aggregator)) {
+    
+    /*if (this.selectedAggregators.includes(aggregator)) {
       let index = this.selectedAggregators.indexOf(aggregator);
       this.selectedAggregators.splice(index, 1);
-    }
+    } TODO = trecho estava causando conflitos, checar propósito*/ 
+
     this.actionManager.remove(aggregator.genericObject);
     aggregator.konvaObject.destroy();
 

+ 1 - 2
src/css/app.css

@@ -40,8 +40,7 @@
   transition: border-color 1s linear;
   transition: border-size 1s linear;
   opacity: 1;
-  border: 2px solid #9bc364;
-  color: #333333;
+  border: 3px solid #9bc364;
 }
 
 #sidebar #tool-bar span {