<commit_before>var questionList = new Array();
var currentQuestion;
var currentQuestionName;
var currentGroupName;

$( function() {
   if( repo ) {
     console.log( repo );
     questionList = repo;

     //hide xls upload
     $( '#build_form' ).hide();
     $( '#xform_file_upload').hide();
     $( '#survey_builder' ).show();
     reloadQuestionListHTML();
     buildSurvey();
   }
});

function questionTypeChanged() {
	var questionType = $("#questionType").val();

  	removeChoices();
  	removeConstraint();

  	$("#groupOptions").hide();

	removeRelevance();//switch to showRelevance when relevances is ready

  	if( questionType == "select one" || questionType == "select all that apply" ) {
  		showChoices();
  		showConstraint();
  	} else if( questionType == "audio" ||questionType == "photo" || questionType == "video" || questionType == "barcode" ) {

	} else if( questionType == "geopoint" ) {

	} else if( questionType == "decimal" || questionType == "integer" ) {
		showConstraint();
	} else if( questionType == "text" ) {

	} else if( questionType == "note" ) {

  	} else if( questionType == "date" || questionType == "dateTime" || questionType == "time") {
  		showConstraint();
  	} else if( questionType == "group" ) {
  		$("#groupOptions").show();<commit_msg>Form Builder - keep survey if form submit is invalid<commit_after>var questionList = new Array();
var currentQuestion;
var currentQuestionName;
var currentGroupName;

$( function() {
   if( repo ) {
     console.log( repo );
     questionList = repo;

     //hide xls upload
     $( '#build_form' ).hide();
     $( '#xform_file_upload').hide();
     $( '#survey_builder' ).show();
     reloadQuestionListHTML();
     buildSurvey();
   } else {

   	var jsonvalue = $("#id_survey_json").val();
   	if( jsonvalue ) {
   		$( "#build_form" ).hide();
		$( '#survey_builder' ).show();
   	  	questionList = JSON.parse( $("#id_survey_json").val() ).children;
   	  	reloadQuestionListHTML();
   	}
   }
});

function questionTypeChanged() {
	var questionType = $("#questionType").val();

  	removeChoices();
  	removeConstraint();

  	$("#groupOptions").hide();

	removeRelevance();//switch to showRelevance when relevances is ready

  	if( questionType == "select one" || questionType == "select all that apply" ) {
  		showChoices();
  		showConstraint();
  	} else if( questionType == "audio" ||questionType == "photo" || questionType == "video" || questionType == "barcode" ) {

	} else if( questionType == "geopoint" ) {

	} else if( questionType == "decimal" || questionType == "integer" ) {
		showConstraint();
	} else if( questionType == "text" ) {

	} else if( questionType == "note" ) {

  	} else if( questionType == "date" || questionType == "dateTime" || questionType == "time") {
  		showConstraint();
  	} else if( questionType == "group" ) {
  		$("#groupOptions").show();
{'fraction_non_alphanumeric': 0.1787085514834206, 'fraction_numerical': 0.0, 'mean_word_length': 3.713815789473684, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6330855', 'n_tokens_mistral': 911, 'n_tokens_neox': 884, 'n_words': 214}