mirror of
				https://gitlab.com/animath/si/plateforme-corres2math.git
				synced 2025-11-04 16:42:33 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			134 lines
		
	
	
		
			5.6 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			134 lines
		
	
	
		
			5.6 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
require_once "header.php";
 | 
						|
?>
 | 
						|
<?php
 | 
						|
if (false) {
 | 
						|
} elseif (Phase::getCurrentPhase() >= Phase::PHASE1) { ?>
 | 
						|
    <div class="mt-4 mb-4">
 | 
						|
        <h1 class="display-4">Ma participation</h1>
 | 
						|
    </div>
 | 
						|
	<?php if ($video != null) { ?>
 | 
						|
        <div class="jumbotron">
 | 
						|
            <h4>Vidéo de solution proposée :</h4>
 | 
						|
            <div class="alert alert-info">
 | 
						|
                <strong>Lien de la vidéo :</strong> <a href="<?= $video->getLink() ?>"><?= $video->getLink() ?></a>
 | 
						|
            </div>
 | 
						|
			<?php displayVideo($video->getLink()) ?>
 | 
						|
            <br/>
 | 
						|
			<?php if (Phase::getCurrentPhase() >= Phase::PHASE3) { ?>
 | 
						|
                <h4>Questions reçues :</h4>
 | 
						|
				<?php
 | 
						|
				for ($i = 0; $i < 2; ++$i) {
 | 
						|
					if ($questions_received[$i] == null)
 | 
						|
						continue;
 | 
						|
					$asker = Team::fromId($questions_received[$i][0]->getFrom());
 | 
						|
					$answer = Video::getVideo($asker->getVideoTeamIds()[0] == $team->getId() ? Reason::ANSWER1 : Reason::ANSWER2,
 | 
						|
                        $asker, Video::ACCEPTED);
 | 
						|
					?>
 | 
						|
                    <h5>Questions de l'équipe <?= $asker->getName() ?> (<?= $asker->getTrigram() ?>) :</h5>
 | 
						|
					<?php
 | 
						|
					for ($j = 0; $j < 6; ++$j) {
 | 
						|
						/** @var Question $question */
 | 
						|
						$question = $questions_received[$i][$j];
 | 
						|
						if ($question->getQuestion() === null)
 | 
						|
							continue;
 | 
						|
						?>
 | 
						|
                        <div class="alert alert-info">
 | 
						|
                            <strong><?= $j == 0 ? "Remarques générales :" : "Question " . $j . " :" ?></strong>
 | 
						|
                            <?= $question->getQuestion() ?>
 | 
						|
                            <br/>
 | 
						|
							<?php
 | 
						|
							if ($question->getAttachedFile() !== null) { ?>
 | 
						|
                                <em>Pièce jointe attachée :</em>
 | 
						|
                                <a href="/file/<?= $question->getAttachedFile() ?>"><strong>Télécharger</strong></a>
 | 
						|
                                <br/>
 | 
						|
							<?php } ?>
 | 
						|
                            <strong>Réponse :</strong> <?= $question->getAnswer() ?><br/>
 | 
						|
							<?php
 | 
						|
							if ($question->getAttachedFileAnswer() !== null) { ?>
 | 
						|
                                <em>Pièce jointe attachée :</em>
 | 
						|
                                <a href="/file/<?= $question->getAttachedFileAnswer() ?>"><strong>Télécharger</strong></a>
 | 
						|
                                <br/>
 | 
						|
							<?php } ?>
 | 
						|
                        </div>
 | 
						|
					<?php } ?>
 | 
						|
                    <br/>
 | 
						|
					<?php if (Phase::getCurrentPhase() > Phase::PHASE4 && $answer != null) { ?>
 | 
						|
                        <h6>Vidéo de réponse proposée par l'équipe :</h6>
 | 
						|
                        <div class="alert alert-info">
 | 
						|
                            <strong>Lien de la vidéo :</strong> <a
 | 
						|
                                    href="<?= $answer->getLink() ?>"><?= $answer->getLink() ?></a>
 | 
						|
                        </div>
 | 
						|
						<?php displayVideo($answer->getLink()) ?>
 | 
						|
						<?= $i == 0 ? "<hr />" : "" ?>
 | 
						|
					<?php } ?>
 | 
						|
				<?php } ?>
 | 
						|
			<?php } ?>
 | 
						|
 | 
						|
        </div>
 | 
						|
 | 
						|
		<?php
 | 
						|
		if (Phase::getCurrentPhase() >= 2) { ?>
 | 
						|
            <hr/>
 | 
						|
            <div class="jumbotron">
 | 
						|
			<?php
 | 
						|
			for ($i = 0; $i < 2; ++$i) {
 | 
						|
				$defender = Team::fromId($team->getVideoTeamIds()[$i]);
 | 
						|
				if ($defender == null)
 | 
						|
					continue;
 | 
						|
				$sol = Video::getVideo(Reason::SOLUTION, $defender, Video::ACCEPTED);
 | 
						|
				$answer = Video::getVideo($i == 0 ? Reason::ANSWER1 : Reason::ANSWER2, $team, Video::ACCEPTED);
 | 
						|
				$questions = Question::getQuestions($team, $defender);
 | 
						|
				?>
 | 
						|
                <h4>Vidéo de solution proposée par l'équipe <?= $defender->getName() ?>
 | 
						|
                    (<?= $defender->getTrigram() ?>) :</h4>
 | 
						|
                <div class="alert alert-info">
 | 
						|
                    <strong>Lien de la vidéo :</strong> <a href="<?= $sol->getLink() ?>"><?= $sol->getLink() ?></a>
 | 
						|
                </div>
 | 
						|
				<?php displayVideo($sol->getLink()) ?>
 | 
						|
                <br/>
 | 
						|
                <h5>Vos questions :</h5>
 | 
						|
                <br/>
 | 
						|
				<?php
 | 
						|
				for ($j = 0; $j < 6; ++$j) {
 | 
						|
					/** @var Question $question */
 | 
						|
					$question = $questions[$j];
 | 
						|
					if ($question->getQuestion() === null)
 | 
						|
						continue;
 | 
						|
					?>
 | 
						|
                    <div class="alert alert-info">
 | 
						|
                        <strong>Question <?= $question->getNumber() ?>
 | 
						|
                            :</strong> <?= $question->getQuestion() ?>
 | 
						|
                        <br/>
 | 
						|
						<?php
 | 
						|
						if ($question->getAttachedFile() !== null) { ?>
 | 
						|
                            <em>Pièce jointe attachée :</em>
 | 
						|
                            <a href="/file/<?= $question->getAttachedFile() ?>"><strong>Télécharger</strong></a>
 | 
						|
                            <br/>
 | 
						|
						<?php } ?>
 | 
						|
                        <?php if (Phase::getCurrentPhase() >= Phase::PHASE4) { ?>
 | 
						|
                            <strong>Réponse :</strong> <?= $question->getAnswer() ?><br/>
 | 
						|
                            <?php
 | 
						|
                            if ($question->getAttachedFile() !== null) { ?>
 | 
						|
                                <em>Pièce jointe attachée :</em>
 | 
						|
                                <a href="/file/<?= $question->getAttachedFileAnswer() ?>"><strong>Télécharger</strong></a>
 | 
						|
                                <br/>
 | 
						|
                            <?php } ?>
 | 
						|
                        <?php } ?>
 | 
						|
                    </div>
 | 
						|
				<?php } ?>
 | 
						|
                <br/>
 | 
						|
				<?php if (Phase::getCurrentPhase() >= Phase::PHASE4 && $answer != null) { ?>
 | 
						|
                    <h5>Votre vidéo de réponse :</h5>
 | 
						|
                    <div class="alert alert-info">
 | 
						|
                        <strong>Lien de la vidéo :</strong> <a href="<?= $answer->getLink() ?>"><?= $answer->getLink() ?></a>
 | 
						|
                    </div>
 | 
						|
					<?php displayVideo($answer->getLink()) ?>
 | 
						|
				<?php } ?>
 | 
						|
				<?= $i == 0 ? "<hr/>" : "" ?>
 | 
						|
			<?php } ?>
 | 
						|
		<?php } ?>
 | 
						|
	<?php } ?>
 | 
						|
<?php } ?>
 | 
						|
<?php
 | 
						|
require_once "footer.php";
 |