Difference between revisions of "HQ:Code Test"

Line 16: Line 16:
 
</ol>
 
</ol>
 
 
 
 
<div class="clear extra_space"></div>
 
 
<textarea  rows="4" id="results_page"></textarea>
 
 
 
 
<div class="clear extra_space"></div>
 
<div class="clear extra_space"></div>
Line 26: Line 21:
 
<div class="clear extra_space"></div>
 
<div class="clear extra_space"></div>
 
 
<div id="all_teams_info">
+
</div>
+
<h3> Results page</h3>
 +
<textarea  rows="15" id="results_page"></textarea>
 +
 +
 
 +
<h3> All teams info </h3>
 +
<textarea  rows="15" id="all_teams_info_page"></textarea>
 +
 
 
 
</div>
 
</div>
Line 1,133: Line 1,134:
 
 
 
//place data base for the results page  
 
//place data base for the results page  
var t="";
+
var results_page_data="";
 
for(x=0; x < data.length; x++ ){
 
for(x=0; x < data.length; x++ ){
 
 
t = t + ("{'team_name':'"+data[x].team_name+"', "+
+
results_page_data = results_page_data + ("{'team_name':'"+data[x].team_name+"', "+
  "'region':'"+data[x].region+"', "+
+
"'region':'"+data[x].region+"', "+
  "'section':'"+data[x].section+"', "+    
+
"'section':'"+data[x].section+"', "+    
  "'track':'"+data[x].track+"', "+
+
"'track':'"+data[x].track+"', "+
  "'location':'"+data[x].location+"', "+
+
"'location':'"+data[x].location+"', "+
  "'medal':'"+data[x].medal+"', "+
+
"'medal':'"+data[x].medal+"', "+
  "'award':'"+data[x].awards+"', "+
+
"'award':'"+data[x].awards+"', "+
  "'nomination':'"+data[x].nominations+"' "+
+
"'nomination':'"+data[x].nominations+"' "+
  "},");
+
"},");
 
}
 
}
 
 
 
 
$("#results_page").val(t);
+
$("#results_page").val((results_page_data).substring(0, (results_page_data.length - 1)));
 
 
 +
 +
var all_teams_info_page_data="";
 +
for(x=0; x < data.length; x++ ){
 
 
 +
all_teams_info_page_data = all_teams_info_page_data + ("{'team_name':'"+data[x].team_name+"', "+
 +
  "'region':'"+data[x].region+"', "+
 +
  "'section':'"+data[x].section+"', "+ "'track':'"+data[x].track+"', "+
 +
  "'location':'"+data[x].location+"', "+
 +
  "'medal':'"+data[x].medal+"', "+
 +
  "'award':'"+data[x].awards+"', "+
 +
  "'nomination':'"+data[x].nominations+"' "+
 +
  "'wiki_link':'"+data[x].wiki_link+"' "+
 +
  "'institution':'"+data[x].institution+"' "+
 +
  "'project_title':'"+data[x].project_title+"' "+
 +
  "'abstract':'"+data[x].abstract+"' "+
 +
  "},");
 +
}
 +
 +
 +
$("#all_teams_info_page").val((all_teams_info_page_data).substring(0, (all_teams_info_page_data.length - 1)));
 +
 +
 
});
 
});
  

Revision as of 15:44, 16 September 2019

Loading...

Code setup page

This page will help you setup the awards and results page

  1. Place the awards and medals into a excel file to create the variable notation
  2. Place the variables indicated on the code on this page
  3. Place the resulting data bases into the results and all teams info pages

Results page

All teams info