/***********************
* Acciones de composición de Adobe Edge Animate
*
* Editar este archivo con precaución, teniendo cuidado de conservar 
* las firmas de función y los comentarios que comienzan con "Edge" para mantener la 
* capacidad de interactuar con estas acciones en Adobe Edge Animate
*
***********************/
(function($, Edge, compId){
var Composition = Edge.Composition, Symbol = Edge.Symbol; // los alias más comunes para las clases de Edge

   //Edge symbol: 'stage'
   (function(symbolName) {
      
      
      

      

      

      

      

      

      

      

      

      

      

      

      Symbol.bindElementAction(compId, symbolName, "document", "compositionReady", function(sym, e) {
          		  transformarTexto = true; // Cambiar a false, si la actividad es de lenguaje o requiere validación exacta de las palabras   
          		  eliminarEspacios = false; // Cambiar a true, si la actividad es de matemáticas o requiere omitir los espacios en blanco de la validación
          		  //Total de inputs       
                  TotalInput = 50;
                  //Para filtrar se pueden usar las siguientes variables:
               /* 
              'int':     /[\d]/,
              'float':     /[\d\.]/,
              'money':    /[\d\.\s,]/,
              'num':      /[\d\-\.]/,
              'hex':      /[0-9a-f]/i,
              'email':    /[a-z0-9_\.\-@]/i,
              'alpha':    /[a-zA-Z_ ]/i,
              'alphaupper': /[A-Z_ ]/i,
              'alphanum': /[a-z0-9_]/i,
              'alphanumlower':/[a-z0-9_]/,
              'alphanumupper':/[a-z0-9_]/,	
              'alphaspace':    /[a-z ]/i,
              'alphanumspace': /[a-z0-9_ ]/i,
              'alphanumspacelower':/[a-z0-9_ ],
              'mathsym':'[+-=\/*]/,
              'alphaacent':'[a-zA-Z_áéíóúü ]',
              'alphanumacent':'[a-z0-9_.áéíóúü ]'
          		*/
          
                  	sym.setVariable("border", "2px double #cccccc");		// Modifica el borde del input
          			sym.setVariable("fondo", "rgba(255,255,255,0.5)");	// Modifica el color de fondo del input
          			sym.setVariable("colorini", "#666666");					// Editar el color de la letra 
          			sym.setVariable("colorok", "#666666");
          			sym.setVariable("fondook","rgba(169,194,88,0.80)");
          			sym.setVariable("colorbad", "#ffffff");
          			sym.setVariable("fondobad", "#f3716c");
          			sym.setVariable("fontsize", "20px");						// Editar el tamaño de fuente
          			sym.setVariable("fontFamily", "Cabin");					//	Editar el tipo de fuente
          			sym.setVariable("fontStyle", "normal");				
          			sym.setVariable("fontweight", "bold");
          			sym.setVariable("height", "18px");
          			sym.setVariable("border-radius", "5px");
          			sym.setVariable("alineacionTexto", "center");			// Editar la alineación del texto en el input
          
          			var j=16;
          for(var i=1;i<=16;i++){	
          	$("#Stage_barra_1").append("<div class='cuadros' id='A-"+j+"'></div>");
          	$("#Stage_barra_2").append("<div class='cuadros' id='B-"+j+"'></div>");
          	$("#Stage_barra_3").append("<div class='cuadros' id='C-"+j+"'></div>");
          	$("#Stage_barra_4").append("<div class='cuadros' id='D-"+j+"'></div>");
          	$("#Stage_barra_5").append("<div class='cuadros' id='E-"+j+"'></div>");	
          	j--;
          }
          
          $(".cuadros").css({
          	"background-color":"transparent",
          	"width":"25px",
          	"height":"23.8px",
          	"border":"1px solid black",
          	"cursor":"pointer"
          });
          
          
          /*
          			RESPUESTA
          			Determino las casillas que van coloreadas con el valor 1 
          			y con valor en 0 cuando la casilla no esta marcada en la gráfica			
          		*/
          		aResp = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];		// Respuesta Columna a
          		bResp = [1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];		// Respuesta Columna b
          		cResp = [1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];		// Respuesta Columna c
          		dResp = [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];		// Respuesta Columna d	
          		eResp = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0];		// Respuesta Columna e	
          		fResp = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];		// Respuesta Columna f	
          		gResp = [1,1,1,1,1,1,1,0,0,0,0,0,0,0];								// Respuesta Columna g	
          		hResp = [1,1,1,1,1,1,1,1,0,0,0,0,0,0];								// Respuesta Columna h	
          		iResp = [1,1,1,1,1,1,1,1,1,0,0,0,0,0];								// Respuesta Columna i	
          		jResp = [1,1,1,1,1,1,1,1,1,1,0,0,0,0];								// Respuesta Columna j	
          		kResp = [1,1,1,1,1,1,1,1,1,1,1,0,0,0];								// Respuesta Columna k	
          		lResp = [1,1,1,1,1,1,1,1,1,1,1,1,0,0];								// Respuesta Columna l	
          		mResp = [1,1,1,1,1,1,1,1,1,1,1,1,1,0];								// Respuesta Columna m	
          
          		/*
          			Inicializo los valores de cada columna en la gráfica
          			para comparar los valores al momento de validar
          		*/
          		aResp2 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
          		bResp2 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
          		cResp2 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
          		dResp2 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
          		eResp2 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
          		fResp2 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0];
          		gResp2 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0];
          		hResp2 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0];
          		iResp2 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0];
          		jResp2 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0];
          		kResp2 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0];
          		lResp2 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0];
          		mResp2 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0];	
          
          		// Asignar los colores a cada columna	
          		colorColumnaA = "#FFD640";	//amarillo
          		var colorColumnaB = "#527EFF";	//azul
          		var colorColumnaC = "#56C830";	//verde
          		var colorColumnaD = "#FFA237";	//naranja		
          
          		$(".cuadros").click(function(){
          		idBox = $(this).attr("id");		
          			Bx = idBox.split("-");			
          			if(Bx[0]=='A'){				
          				var acolor=$("#"+idBox).css("background-color");					
          				if(acolor == "rgba(0, 0, 0, 0)"){					
          					$("#"+idBox).css("background-color",colorColumnaA);	
          					aResp2[Bx[1]-1] = 1;				
          				}else{
          					$("#"+idBox).css("background-color","rgba(0, 0, 0, 0)");						
          					aResp2[Bx[1]-1] = 0;				
          				}
          			}
          			if(Bx[0]=='B'){
          				var bcolor=$("#"+idBox).css("background-color");
          				if(bcolor == "rgba(0, 0, 0, 0)"){
          					$("#"+idBox).css("background-color",colorColumnaA);
          					bResp2[Bx[1]-1] = 1;	
          				}else{
          					$("#"+idBox).css("background-color","rgba(0, 0, 0, 0)");	
          					bResp2[Bx[1]-1] = 0;	
          				}
          			}
          			if(Bx[0]=='C'){
          				var ccolor=$("#"+idBox).css("background-color");
          				if(ccolor == "rgba(0, 0, 0, 0)"){
          					$("#"+idBox).css("background-color",colorColumnaA);
          					cResp2[Bx[1]-1] = 1;	
          				}else{
          					$("#"+idBox).css("background-color","rgba(0, 0, 0, 0)");	
          					cResp2[Bx[1]-1] = 0;	
          				}
          			}
          			if(Bx[0]=='D'){
          				var dcolor=$("#"+idBox).css("background-color");
          				if(dcolor == "rgba(0, 0, 0, 0)"){
          					$("#"+idBox).css("background-color",colorColumnaA);
          					dResp2[Bx[1]-1] = 1;	
          				}else{
          					$("#"+idBox).css("background-color","rgba(0, 0, 0, 0)");	
          					dResp2[Bx[1]-1] = 0;	
          				}
          			}	
          			if(Bx[0]=='E'){
          				var ecolor=$("#"+idBox).css("background-color");
          				if(ecolor == "rgba(0, 0, 0, 0)"){
          					$("#"+idBox).css("background-color",colorColumnaA);
          					eResp2[Bx[1]-1] = 1;	
          				}else{
          					$("#"+idBox).css("background-color","rgba(0, 0, 0, 0)");	
          					eResp2[Bx[1]-1] = 0;	
          				}
          			}	
          			if(Bx[0]=='F'){
          				var fcolor=$("#"+idBox).css("background-color");
          				if(fcolor == "rgba(0, 0, 0, 0)"){
          					$("#"+idBox).css("background-color",colorColumnaA);
          					fResp2[Bx[1]-1] = 1;	
          				}else{
          					$("#"+idBox).css("background-color","rgba(0, 0, 0, 0)");	
          					fResp2[Bx[1]-1] = 0;	
          				}
          			}	
          			if(Bx[0]=='G'){
          				var gcolor=$("#"+idBox).css("background-color");
          				if(gcolor == "rgba(0, 0, 0, 0)"){
          					$("#"+idBox).css("background-color",colorColumnaA);
          					gResp2[Bx[1]-1] = 1;	
          				}else{
          					$("#"+idBox).css("background-color","rgba(0, 0, 0, 0)");	
          					gResp2[Bx[1]-1] = 0;	
          				}
          			}	
          			if(Bx[0]=='H'){
          				var hcolor=$("#"+idBox).css("background-color");
          				if(hcolor == "rgba(0, 0, 0, 0)"){
          					$("#"+idBox).css("background-color",colorColumnaA);
          					hResp2[Bx[1]-1] = 1;	
          				}else{
          					$("#"+idBox).css("background-color","rgba(0, 0, 0, 0)");	
          					hResp2[Bx[1]-1] = 0;	
          				}
          			}	
          			if(Bx[0]=='I'){
          				var icolor=$("#"+idBox).css("background-color");
          				if(icolor == "rgba(0, 0, 0, 0)"){
          					$("#"+idBox).css("background-color",colorColumnaA);
          					iResp2[Bx[1]-1] = 1;	
          				}else{
          					$("#"+idBox).css("background-color","rgba(0, 0, 0, 0)");	
          					iResp2[Bx[1]-1] = 0;	
          				}
          			}	
          			if(Bx[0]=='J'){
          				var jcolor=$("#"+idBox).css("background-color");
          				if(jcolor == "rgba(0, 0, 0, 0)"){
          					$("#"+idBox).css("background-color",colorColumnaA);
          					jResp2[Bx[1]-1] = 1;	
          				}else{
          					$("#"+idBox).css("background-color","rgba(0, 0, 0, 0)");	
          					jResp2[Bx[1]-1] = 0;	
          				}
          			}	
          			if(Bx[0]=='K'){
          				var kcolor=$("#"+idBox).css("background-color");
          				if(kcolor == "rgba(0, 0, 0, 0)"){
          					$("#"+idBox).css("background-color",colorColumnaA);
          					kResp2[Bx[1]-1] = 1;	
          				}else{
          					$("#"+idBox).css("background-color","rgba(0, 0, 0, 0)");	
          					kResp2[Bx[1]-1] = 0;	
          				}
          			}	
          			if(Bx[0]=='L'){
          				var lcolor=$("#"+idBox).css("background-color");
          				if(lcolor == "rgba(0, 0, 0, 0)"){
          					$("#"+idBox).css("background-color",colorColumnaA);
          					lResp2[Bx[1]-1] = 1;	
          				}else{
          					$("#"+idBox).css("background-color","rgba(0, 0, 0, 0)");	
          					lResp2[Bx[1]-1] = 0;	
          				}
          			}	
          			if(Bx[0]=='M'){
          				var mcolor=$("#"+idBox).css("background-color");
          				if(mcolor == "rgba(0, 0, 0, 0)"){
          					$("#"+idBox).css("background-color",colorColumnaA);
          					mResp2[Bx[1]-1] = 1;	
          				}else{
          					$("#"+idBox).css("background-color","rgba(0, 0, 0, 0)");	
          					mResp2[Bx[1]-1] = 0;	
          				}
          			}			
          });
          
          
          /*
          $(".cuadros").click(function(){
          	var idCuadro = $(this).prop("id");
          	var colorCuadro = $("#"+idCuadro).css("background-color");	
          	if(colorCuadro=="rgb(255, 255, 255)"){
          		$("#"+idCuadro).css("background-color","rgba(255,204,84,1.00)");
          	}else{
          		$("#"+idCuadro).css("background-color","white");
          	}
          });
          */
          
          

      });
      //Edge binding end

   })("stage");
   //Edge symbol end:'stage'

   //=========================================================
   
   //Edge symbol: 'Precargador'
   (function(symbolName) {   
   
   })("Precargador");
   //Edge symbol end:'Precargador'

   //=========================================================
   
   //Edge symbol: 'ok'
   (function(symbolName) {   
   
   })("ok");
   //Edge symbol end:'ok'

   //=========================================================
   
   //Edge symbol: 'bad'
   (function(symbolName) {   
   
   })("bad");
   //Edge symbol end:'bad'

   //=========================================================
   
   //Edge symbol: 'bt_validar'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 250, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

   })("bt_validar");
   //Edge symbol end:'bt_validar'

   //=========================================================
   
   //Edge symbol: 'bt_solucion'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 250, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

   })("bt_solucion");
   //Edge symbol end:'bt_solucion'

   //=========================================================
   
   //Edge symbol: 'bt_reiniciar'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 250, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

   })("bt_reiniciar");
   //Edge symbol end:'bt_reiniciar'

   //=========================================================
   
   //Edge symbol: 'bt_ayuda'
   (function(symbolName) {   
   
      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

      Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 250, function(sym, e) {
         // introducir código aquí
         sym.stop();

      });
      //Edge binding end

   })("bt_ayuda");
   //Edge symbol end:'bt_ayuda'

})(jQuery, AdobeEdge, "EDGE-94063035");
 