Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 139 | Rev 141 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 139 Rev 140
Línea 1011... Línea 1011...
1011
            $('html, body').animate({
1011
            $('html, body').animate({
1012
                scrollTop: $(validator.errorList[0].element).offset().top - 100
1012
                scrollTop: $(validator.errorList[0].element).offset().top - 100
1013
            }, 1000);
1013
            }, 1000);
1014
        },
1014
        },
1015
		submitHandler: function(form) {
1015
		submitHandler: function(form) {
1016
		    // do other things for a valid form
-
 
1017
		    //form.submit();
-
 
1018
 
-
 
1019
		    
1016
		   
1020
		    var error = false;
1017
		    var error = false;
1021
		    if(objFormGenerator.sections.length == 0) {
1018
		    if(objFormGenerator.sections.length == 0) {
1022
		    	$.fn.showError(ERROR_SECCTIONS);
1019
		    	$.fn.showError('ERROR_SECCTIONS'.replace('%s','text'));
1023
		    	error = true;
1020
		    	error = true;
1024
		    } else {
1021
		    } else {
Línea 1025... Línea 1022...
1025
		    	
1022
		    	
1026
		    	for(i = 0; i < objFormGenerator.sections.length; i++) 
1023
		    	for(i = 0; i < objFormGenerator.sections.length; i++) 
Línea 1027... Línea 1024...
1027
		    	{
1024
		    	{
1028
		    		
1025
		    		
1029
		    		if(objFormGenerator.sections[i].questions.length == 0) {
1026
		    		if(objFormGenerator.sections[i].questions.length == 0) {
1030
		    			$.fn.showError( ERROR_QUESTION.str_replace('%s', objFormGenerator.sections[i].name ));
1027
		    			//$.fn.showError( 'ERROR_QUESTION'.replace('%s', objFormGenerator.sections[i].name ));
Línea 1031... Línea 1028...
1031
		    			break;
1028
		    			break;
1032
		    		}
1029
		    		}
Línea 1047... Línea 1044...
1047
		    				var numberCorrect = 0;
1044
		    				var numberCorrect = 0;
Línea 1048... Línea 1045...
1048
		    				
1045
		    				
Línea 1049... Línea 1046...
1049
		    				
1046
		    				
1050
		    				if(objFormGenerator.sections[i].questions[j].options.length == 0) {
1047
		    				if(objFormGenerator.sections[i].questions[j].options.length == 0) {
1051
 
1048
 
1052
								$.fn.showError( ERROR_OPTIONS.str_replace('%s', objFormGenerator.sections[i].name ).str_replace('%n', questionNumber));
1049
								//$.fn.showError( ERROR_OPTIONS.replace('%s', objFormGenerator.sections[i].name ).replace('%n', questionNumber));
Línea 1053... Línea 1050...
1053
								error = true;
1050
								error = true;
Línea 1077... Línea 1074...
1077
		    				}
1074
		    				}
Línea 1078... Línea 1075...
1078
 
1075
 
Línea 1079... Línea 1076...
1079
		    				if(objFormGenerator.sections[i].questions[j].type == 'simple' || objFormGenerator.sections[i].questions[j].type == 'multiple' ) {
1076
		    				if(objFormGenerator.sections[i].questions[j].type == 'simple' || objFormGenerator.sections[i].questions[j].type == 'multiple' ) {
1080
		    				
1077
		    				
1081
    		    				if(numberCorrect == 0) {
1078
    		    				if(numberCorrect == 0) {
1082
    		    					$.fn.showError( ERROR_OPTIONS_CORRECT.str_replace('%s', objFormGenerator.sections[i].name ).str_replace('%n', questionNumber));
1079
    		    					//$.fn.showError( ERROR_OPTIONS_CORRECT.replace('%s', objFormGenerator.sections[i].name ).replace('%n', questionNumber));
1083
    		    					error = true;
1080
    		    					error = true;
1084
    		    					break;
1081
    		    					break;
1085
    		    				}
1082
    		    				}
1086
    		    				if(objFormGenerator.sections[i].questions[j].type == 'simple' && numberCorrect > 1) {
1083
    		    				if(objFormGenerator.sections[i].questions[j].type == 'simple' && numberCorrect > 1) {
1087
    		    					$.fn.showError( ERROR_OPTIONS_DUPLICATE_CORRECT.str_replace('%s', objFormGenerator.sections[i].name ).str_replace('%n', questionNumber));
1084
    		    					//$.fn.showError( ERROR_OPTIONS_DUPLICATE_CORRECT.replace('%s', objFormGenerator.sections[i].name ).replace('%n', questionNumber));
1088
    		    					error = true;
1085
    		    					error = true;
1089
    		    					break;
1086
    		    					break;
1090
    		    				}
1087
    		    				}
1091
    		    				if(objFormGenerator.sections[i].questions[j].type == 'multiple' && numberCorrect == 1) {
1088
    		    				if(objFormGenerator.sections[i].questions[j].type == 'multiple' && numberCorrect == 1) {
1092
    		    					$.fn.showError( ERROR_OPTIONS_ONE_CORRECT.str_replace('%s', objFormGenerator.sections[i].name ).str_replace('%n', questionNumber));
1089
    		    					//$.fn.showError( ERROR_OPTIONS_ONE_CORRECT.replace('%s', objFormGenerator.sections[i].name ).replace('%n', questionNumber));
1093
    		    					error = true;
1090
    		    					error = true;
1094
    		    					break;
1091
    		    					break;
Línea 1095... Línea 1092...
1095
    		    				}
1092
    		    				}
Línea 1096... Línea 1093...
1096
		    				}
1093
		    				}
1097
 
1094
 
1098
			 				if(objFormGenerator.sections[i].questions[j].type == 'multiple' && totalOption > valueQuestion ) {
1095
			 				if(objFormGenerator.sections[i].questions[j].type == 'multiple' && totalOption > valueQuestion ) {
1099
 
1096
 
Línea 1100... Línea 1097...
1100
								$.fn.showError( ERROR_OPTIONS_SUM_VALUES.str_replace('%s', objFormGenerator.sections[i].name ).str_replace('%n', questionNumber));
1097
								//$.fn.showError( ERROR_OPTIONS_SUM_VALUES.replace('%s', objFormGenerator.sections[i].name ).replace('%n', questionNumber));
1101
		    					error = true;
1098
		    					error = true;
1102
		    					break;
1099
		    					break;
1103
			    			}
1100
			    			}
1104
 
1101
 
1105
		    				if(objFormGenerator.sections[i].questions[j].type == 'rating-open' && maxOption > valueQuestion ) {
1102
		    				if(objFormGenerator.sections[i].questions[j].type == 'rating-open' && maxOption > valueQuestion ) {
Línea 1106... Línea 1103...
1106
								$.fn.showError( ERROR_OPTIONS_MAX_OPTION.str_replace('%s', objFormGenerator.sections[i].name ).str_replace('%n', questionNumber));
1103
								//$.fn.showError( ERROR_OPTIONS_MAX_OPTION.replace('%s', objFormGenerator.sections[i].name ).replace('%n', questionNumber));
Línea 1107... Línea 1104...
1107
		    					error = true;
1104
		    					error = true;
1108
		    					break;
1105
		    					break;
1109
			    			}
1106
			    			}
1110
						}
1107
						}
1111
	
1108
	
1112
		    		}
1109
		    		}
Línea 1820... Línea 1817...
1820
		
1817
		
1821
		$('#row-forms').hide();
1818
		$('#row-forms').hide();
1822
		$('#row-edit').show();
1819
		$('#row-edit').show();
Línea 1823... Línea -...
1823
		$('#form-main #form-name').focus();
-
 
1824
 
-
 
1825
        /*$('html, body').animate({
-
 
1826
            scrollTop: $('#form-main #form-name').offset().top - 100
1820
		$('#form-main #form-name').focus();
Línea 1827... Línea 1821...
1827
        }, 1000);*/
1821
 
1828
	});
1822
	});
1829
 
1823