Difference between revisions of "Dev/Awards2"

Line 204: Line 204:
  
  
var award_temp="";
+
var award_name;
var help="";
+
var trim;
  
//sort awards  
+
//sort awards  
 
for( x=0; x< awards_set.length; x++) {
 
for( x=0; x< awards_set.length; x++) {
  
// is this a nomination ?
+
award_name="";
 +
trim = 0;
 +
 +
// is this a nomination ?
 
if ( (awards_set[x].award).substring(0,9) == "Nominated" ) {
 
if ( (awards_set[x].award).substring(0,9) == "Nominated" ) {
 +
trim = 19;
 +
}
  
//what award did they win ? (trims from after Best to the next empty space )
 
help = (awards_set[x].award).substring( 19,  (awards_set[x].award).length );
 
help = help.substring( 0 , help.indexOf( ' ') );
 
  
console.log(help);
+
// is this a winner ?
 
+
award_temp = (  help.substring( 0,  (help).indexOf(' ', (help).indexOf(' ') + 1) )  ) ;
+
 
+
//append to the undergrad or overgrad
+
$("#"+award_temp+"_"+awards_set[x].section).append( "<li>" + awards_set[x].team_name + "</li>" );
+
 
+
award_temp ="";
+
help="";
+
}
+
 
+
// is this a winner ?
+
 
if ( (awards_set[x].award).substring(0,4) == "Best" ) {  
 
if ( (awards_set[x].award).substring(0,4) == "Best" ) {  
 +
trim = 5;
 +
}
  
//what award did they win ? (trims from after Best to the next empty space )
 
award_temp = (  (awards_set[x].award).substring( 5,  ((awards_set[x].award).indexOf(' ', (awards_set[x].award).indexOf(' ') + 1) )  ));
 
  
//append to the undergrad or overgrad
+
award_name = (awards_set[x].award).substring( trim,  (awards_set[x].award).length );
$("#"+award_temp+"_"+awards_set[x].section).append( "<li>" + awards_set[x].team_name + "</li>" );
+
award_name = award_name.substring( 0 , award_name.indexOf( ' ') );
  
award_temp ="";
+
//append winner to their section
 +
if (trim == 5  ) {
 +
$("#"+award_name+"_"+awards_set[x].section).append( "<li>" + awards_set[x].team_name + "</li>" );
 
}
 
}
  
 +
//append nomination to their award
 +
if (trim == 19  ) {
 +
$("#"+award_name+"_nominations").append( "<li>" + awards_set[x].team_name + "</li>" );
 +
}
 
}
 
}
  

Revision as of 23:07, 6 November 2017

MENU

AWARDS

Best Diagnostics Project

Nominations

Best Energy Project

Nominations

Best Environment Project

Nominations

Best Food and Nutrition Project

Nominations

Best Foundational Advance Project

Nominations

Best Information Processing Advance Project

Nominations

GOLD

SILVER

BRONZE