mirror of
				https://gitlab.com/animath/si/plateforme-corres2math.git
				synced 2025-11-04 12:32:23 +01:00 
			
		
		
		
	Divserses corrections, phase 0 terminée
This commit is contained in:
		@@ -80,13 +80,13 @@ class Document
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	public function getAllDocuments($problem)
 | 
			
		||||
	public static function getAllDocuments($problem, $team_id = -1)
 | 
			
		||||
	{
 | 
			
		||||
		global $DB;
 | 
			
		||||
		$req = $DB->query("SELECT * FROM `documents` AS `t1` "
 | 
			
		||||
			. "INNER JOIN (SELECT `user`, `type`, `problem`, MAX(`uploaded_at`) AS `last_upload`, COUNT(`team`) AS `version` FROM `documents` GROUP BY `problem`, `type`, `user`) `t2` "
 | 
			
		||||
			. "ON `t1`.`user` = `t2`.`user` AND `t1`.`type` = `t2`.`type` AND `t1`.`problem` = `t2`.`problem` "
 | 
			
		||||
			. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`problem` = $problem ORDER BY `t1`.`type`;");
 | 
			
		||||
			. "WHERE `t1`.`uploaded_at` = `t2`.`last_upload` AND `t1`.`problem` = $problem " . ($team_id >= 0 ? "AND `team` = $team_id" : "") . " ORDER BY `t1`.`type`;");
 | 
			
		||||
 | 
			
		||||
		$docs = [];
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -134,7 +134,7 @@ class User
 | 
			
		||||
	{
 | 
			
		||||
		global $DB;
 | 
			
		||||
		$this->school = $school;
 | 
			
		||||
		$DB->prepare("UPDATE `users` SET `school` = ? WHERE `id` = ?;")->execute([SchoolClass::getName($school), $this->getId()]);
 | 
			
		||||
		$DB->prepare("UPDATE `users` SET `school` = ? WHERE `id` = ?;")->execute([$school, $this->getId()]);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public function getClass()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user