mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 03:42:11 +01:00 
			
		
		
		
	Les notes de synthèses n'ont pas à être copiées pour la finale
This commit is contained in:
		@@ -39,26 +39,6 @@ if (isset($_POST["select"])) {
 | 
				
			|||||||
                VALUES (?, ?, ?, ?);");
 | 
					                VALUES (?, ?, ?, ?);");
 | 
				
			||||||
		$req->execute([$id, $team->getId(), $_SESSION["final_id"], $sol_data["problem"]]);
 | 
							$req->execute([$id, $team->getId(), $_SESSION["final_id"], $sol_data["problem"]]);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	$syntheses_req = $DB->prepare("SELECT `file_id`, `dest`, COUNT(`dest`) AS `version` FROM `syntheses` WHERE `team` = ? AND `tournament` = ? GROUP BY `dest`, `uploaded_at` ORDER BY `dest`, `uploaded_at` DESC;");
 | 
					 | 
				
			||||||
	$syntheses_req->execute([$team->getId(), $team->getTournamentId()]);
 | 
					 | 
				
			||||||
	while (($synthese_data = $syntheses_req->fetch()) !== false) {
 | 
					 | 
				
			||||||
		$old_id = $synthese_data["file_id"];
 | 
					 | 
				
			||||||
		$alphabet = "abcdefghijklmnopqrstuvwxyz0123456789";
 | 
					 | 
				
			||||||
		
 | 
					 | 
				
			||||||
		do {
 | 
					 | 
				
			||||||
			$id = "";
 | 
					 | 
				
			||||||
			for ($i = 0; $i < 64; ++$i) {
 | 
					 | 
				
			||||||
				$id .= $alphabet[rand(0, strlen($alphabet) - 1)];
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		while (file_exists("$LOCAL_PATH/files/$id"));
 | 
					 | 
				
			||||||
		
 | 
					 | 
				
			||||||
		copy("$LOCAL_PATH/files/$old_id", "$LOCAL_PATH/files/$id");
 | 
					 | 
				
			||||||
		
 | 
					 | 
				
			||||||
		$req = $DB->prepare("INSERT INTO `syntheses`(`file_id`, `team`, `tournament`, `dest`) VALUES (?, ?, ?, ?);");
 | 
					 | 
				
			||||||
		$req->execute([$id, $team->getId(), $FINAL->getId(), $synthese_data["dest"]]);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$documents_req = $DB->prepare("SELECT `file_id`, `user`, `type`, COUNT(`type`) AS `version` FROM `documents` WHERE `team` = ? AND `tournament` = ? GROUP BY `user`, `type` ORDER BY `user`, `type` ASC, MAX(`uploaded_at`) DESC;");
 | 
					$documents_req = $DB->prepare("SELECT `file_id`, `user`, `type`, COUNT(`type`) AS `version` FROM `documents` WHERE `team` = ? AND `tournament` = ? GROUP BY `user`, `type` ORDER BY `user`, `type` ASC, MAX(`uploaded_at`) DESC;");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user