Difference between revisions of "Dev/Results"

(damn it, I always forget the difference between :checked and :selected)
(The two different ajax-requested team informations were "out of sync" on regions. I got rid of the Team List call since it wasn't helping anything. And fixed the parse method back to how it was, I hope.)
Line 64: Line 64:
  
 
//Accepts an array of team objects and reorganizes it into an array of team*awards (incl no-awards)
 
//Accepts an array of team objects and reorganizes it into an array of team*awards (incl no-awards)
function parseTeamsToAwards(arrayOfTeams, extraTeamInfo) {
+
//function parseTeamsToAwards(arrayOfTeams, extraTeamInfo) {
 +
function parseTeamsToAwards(arrayOfTeams) {
 
var arrayOfTeamAwards = [];
 
var arrayOfTeamAwards = [];
 
for (i = 0; i < arrayOfTeams.length; i++) {
 
for (i = 0; i < arrayOfTeams.length; i++) {
var teamObj = jQuery.extend(arrayOfTeams[i], extraTeamInfo[i]);
+
//var teamObj = jQuery.extend(arrayOfTeams[i], extraTeamInfo[i]);
 
//Take care of any teams that didn't win any awards
 
//Take care of any teams that didn't win any awards
 
if (teamObj.awards.length == 0) {
 
if (teamObj.awards.length == 0) {
Line 98: Line 99:
 
 
 
//Request team data
 
//Request team data
var teamsRequest = jQuery.ajax({
+
// var teamsRequest = jQuery.ajax({
url: "https://igem.org/aj/team_list.cgi",
+
// url: "https://igem.org/aj/team_list.cgi",
type: "GET",
+
// type: "GET",
timeout: 30000,
+
// timeout: 30000,
dataType: "json",
+
// dataType: "json",
data: {command: "get_team_list", year: currentYear},
+
// data: {command: "get_team_list", year: currentYear},
error: function(jqxhr, textStatus, errorThrown) {
+
// error: function(jqxhr, textStatus, errorThrown) {
console.log("Failed to get list of teams. look at var teamsRequest");
+
// console.log("Failed to get list of teams. look at var teamsRequest");
showInTable("Error loading list of teams. Please check your internet connection and try again. If the problem persists, contact iGEM HQ.");
+
// showInTable("Error loading list of teams. Please check your internet connection and try again. If the problem persists, contact iGEM HQ.");
}
+
// }
});
+
// });
 
//Request the awards data
 
//Request the awards data
 
var awardsRequest = jQuery.ajax({
 
var awardsRequest = jQuery.ajax({
Line 123: Line 124:
 
 
 
//When both requests finish, parse the data and set up the table.
 
//When both requests finish, parse the data and set up the table.
jQuery.when(teamsRequest, awardsRequest).done(function(teamsReqResult, awardsReqResult) {
+
//jQuery.when(teamsRequest, awardsRequest).done(function(teamsReqResult, awardsReqResult) {
 +
awardsRequest.done(function(data, textStatus, jqxhr) {
 
showInTable();
 
showInTable();
var teamsData = teamsReqResult[0];
+
// var teamsData = teamsReqResult[0];
var awardsData = awardsReqResult[0];
+
// var awardsData = awardsReqResult[0];
var arrayOfTeamAwards = parseTeamsToAwards(awardsData, teamsData);
+
// var arrayOfTeamAwards = parseTeamsToAwards(awardsData, teamsData);
 +
var arrayOfTeamAwards = parseTeamsToAwards(data);
 
 
 
//Initialize dataTable and set up event bindings.
 
//Initialize dataTable and set up event bindings.

Revision as of 03:05, 28 September 2015

Comprehensive Results from iGEM

View:

  •    
  •                    
Team Medal Award
Please enable JavaScript in your browser to view results.