-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqcms.php
93 lines (90 loc) · 3.14 KB
/
qcms.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
// Define the time limit (18h30) in 24-hour format
$timeLimit = "18:30";
// Get the current server time in "H:i" format (24-hour clock)
$currentTime = date("H:i");
if (isset($_GET['id'])) {
$id = $_GET['id'];
$filePath = __DIR__ . "/qcms/{$id}.html";
// Check if the current time is after 18h30
if ($currentTime >= $timeLimit) {
// Serve the corrected QCM content if the time is after 18h30
if (file_exists($filePath)) {
// Read and display the content of the corrected QCM
echo file_get_contents($filePath);
} else {
echo "<h1>QCM non trouvé</h1>";
}
} else {
// If before 18h30, show a friendly message
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Correction non disponible</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;500&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Poppins', sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f8ff;
text-align: center;
}
.message-container {
max-width: 600px;
padding: 20px;
background-color: #ffffff;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 10px;
}
h1 {
font-size: 2.5em;
color: #333;
margin-bottom: 10px;
}
p {
font-size: 1.2em;
color: #666;
margin-bottom: 20px;
}
.emoji {
font-size: 3em;
margin-bottom: 20px;
}
.footer {
margin-top: 20px;
font-size: 0.9em;
color: #999;
}
@media (max-width: 768px) {
h1 {
font-size: 2em;
}
p {
font-size: 1em;
}
}
</style>
</head>
<body>
<div class="message-container">
<div class="emoji">⏳📚👩🎓👨🎓</div>
<h1>Patience, chers élèves !</h1>
<p>Les corrections ne seront disponibles qu'après <strong>18h30</strong> tous les jours pour éviter la fraude pendant l'examen.</p>
<p>Revenez plus tard pour consulter vos réponses corrigées.</p>
<div class="footer">Merci de votre compréhension 💡</div>
</div>
</body>
</html>
<?php
}
} else {
echo "<h1>ID du QCM non fourni.</h1>";
}
?>