Skip to content

Commit a4db094

Browse files
committed
version 1.4
1 parent fdf662b commit a4db094

File tree

2 files changed

+204
-3
lines changed

2 files changed

+204
-3
lines changed

docs/index.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<meta property="og:title" content="Corso Python Base - Gratis e Open Source in Italiano">
1111
<meta property="og:description" content="Corso introduttivo in italiano pensato per aiutarti a muovere i primi passi nel linguaggio Python.">
1212
<meta property="og:type" content="website">
13-
<meta property="og:url" content="https://hanamai-ai.github.io/corso-python-basic/">
13+
<meta property="og:url" content="https://h-anamai.github.io/corso-python-basic/">
1414
<meta property="og:image" content="https://hanam.ai/assets/hanamai-logo-DgV2uQ4U.svg">
1515
<link rel="icon" href="https://hanam.ai/assets/hanamai-logo-DgV2uQ4U.svg" type="image/svg">
16-
<link rel="canonical" href="https://hanamai-ai.github.io/corso-python-basic/">
16+
<link rel="canonical" href="https://h-anamai.github.io/corso-python-basic/">
1717

1818
<!-- Structured Data (Google Rich Results) -->
1919
<script type="application/ld+json">
@@ -28,7 +28,7 @@
2828
"sameAs": "https://hanam.ai"
2929
},
3030
"inLanguage": "it",
31-
"url": "https://hanamai-ai.github.io/corso-python-basic/"
31+
"url": "https://h-anamai.github.io/corso-python-basic/"
3232
}
3333
</script>
3434
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
@@ -176,6 +176,11 @@ <h2>Inizia subito</h2>
176176
<a href="https://discord.gg/gkjMTFSVc" class="btn social-btn discord">Unisciti al gruppo Discord</a>
177177
</section>
178178

179+
<section style="text-align:center; margin:60px 0;">
180+
<h2 style="color:#306998; font-size:2rem; margin-bottom:20px;">🎖️ Ottieni il tuo Badge</h2>
181+
<p><a href="quiz.html">Completa</a> il corso e ricevi il tuo badge digitale ufficiale da condividere su GitHub o LinkedIn!</p>
182+
183+
179184
<section style="text-align:center; margin:40px 0;">
180185
<h2 style="color:#306998; font-size:2rem; margin-bottom:20px;">Contatti</h2>
181186
<p style="margin-bottom:20px;">Domande o suggerimenti? Contattaci:</p>

docs/quiz.html

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
<!DOCTYPE html>
2+
<html lang="it">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Corso Python Base - Gratis e Open Source in Italiano"</title>
7+
<meta name="description" content="Corso introduttivo in italiano pensato per aiutarti a muovere i primi passi nel linguaggio Python.">
8+
<meta name="keywords" content="corso python, python base, impara python, corso gratuito python, python italiano, programmazione python, hanam.ai">
9+
<meta name="author" content="hanam.ai">
10+
<meta property="og:title" content="Corso Python Base - Gratis e Open Source in Italiano">
11+
<meta property="og:description" content="Corso introduttivo in italiano pensato per aiutarti a muovere i primi passi nel linguaggio Python.">
12+
<meta property="og:type" content="website">
13+
<meta property="og:url" content="https://h-anamai.github.io/corso-python-basic/">
14+
<meta property="og:image" content="https://hanam.ai/assets/hanamai-logo-DgV2uQ4U.svg">
15+
<link rel="icon" href="https://hanam.ai/assets/hanamai-logo-DgV2uQ4U.svg" type="image/svg">
16+
<link rel="canonical" href="https://h-anamai.github.io/corso-python-basic/">
17+
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script>
18+
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js"></script>
19+
<style>
20+
body {
21+
font-family: 'Inter', sans-serif;
22+
margin: 0;
23+
padding: 0;
24+
background-color: #f7f9fc;
25+
color: #333;
26+
}
27+
header {
28+
background: linear-gradient(90deg, #306998, #4B8BBE);
29+
color: white;
30+
text-align: center;
31+
padding: 80px 20px;
32+
}
33+
header h1 {
34+
font-size: 3rem;
35+
margin: 0;
36+
}
37+
header p {
38+
font-size: 1.3rem;
39+
margin-top: 10px;
40+
}
41+
main {
42+
max-width: 1000px;
43+
margin: 40px auto;
44+
padding: 0 20px;
45+
}
46+
.btn {
47+
display: inline-block;
48+
background-color: #306998;
49+
color: white;
50+
text-decoration: none;
51+
padding: 14px 28px;
52+
border-radius: 12px;
53+
font-weight: bold;
54+
margin: 5px;
55+
transition: all 0.3s ease;
56+
}
57+
.btn:hover {
58+
background-color: #1f4e7a;
59+
transform: translateY(-2px);
60+
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
61+
}
62+
section {
63+
margin-bottom: 60px;
64+
}
65+
h2 {
66+
color: #306998;
67+
margin-bottom: 20px;
68+
font-size: 2rem;
69+
}
70+
.question { margin-bottom:20px; padding:15px; border:1px solid #ddd; border-radius:8px; background:#fff; }
71+
.question h3 { margin-bottom:10px; color:#333; white-space:pre-line; }
72+
button { padding:12px 24px; border:none; border-radius:8px; background:#306998; color:#fff; font-size:1rem; cursor:pointer; margin-top:10px; }
73+
button:hover { background:#1f4e7a; }
74+
#quiz-result { margin-top:20px; font-size:1.2rem; font-weight:bold; text-align:center; }
75+
#badge-link { display:none; text-align:center; margin-top:20px; padding:20px; border:2px solid #306998; border-radius:12px; background:#e0e7ff; }
76+
#badge-link img { width:200px; margin-top:10px; }
77+
#download-btn { display:none; margin-top:20px; }
78+
#certificate { position:absolute; left:-9999px; top:0; width:600px; padding:40px; text-align:center; border:2px solid #306998; border-radius:12px; background:#e0e7ff; }
79+
#certificate img { width:200px; margin-top:20px; }
80+
footer {
81+
text-align: center;
82+
padding: 30px;
83+
background-color: #eaeaea;
84+
}
85+
.opacity-90{
86+
opacity: 0.9;
87+
}
88+
.object-contain {
89+
object-fit: contain;
90+
}
91+
.w-8 {
92+
width: 2rem;
93+
}
94+
.h-8 {
95+
height: 2rem;
96+
}
97+
</style>
98+
</head>
99+
<body>
100+
101+
<header>
102+
<a href="https://hanam.ai"><img src="https://hanam.ai/assets/hanamai-logo-DgV2uQ4U.svg" alt="Hanamai" class="w-8 h-8 object-contain opacity-90"></a>
103+
<h1>Corso Python Basic</h1>
104+
<p>Quiz finale.</p>
105+
</header>
106+
107+
<form id="quiz-form"></form>
108+
<div style="text-align:center;">
109+
<button onclick="checkQuiz(event)">Invia Risposte</button>
110+
</div>
111+
<div id="quiz-result"></div>
112+
<div id="badge-link">
113+
<p>🎉 Complimenti, hai completato il corso! Ecco il tuo badge:</p>
114+
<img src="https://img.shields.io/badge/Python%20Basic-Completato-success?style=for-the-badge&logo=python" alt="Badge completamento">
115+
</div>
116+
117+
<div id="certificate">
118+
<h1>Certificato Python 🐍</h1>
119+
<p>🎉 Complimenti! Hai completato il Corso Python Base</p>
120+
<img src="https://img.shields.io/badge/Python%20Basic-Completato-success?style=for-the-badge&logo=python" alt="Badge completamento">
121+
</div>
122+
123+
<script>
124+
const secretKey="pyCorso2025SecretKey";
125+
126+
const rawQuestions=[
127+
{q:"Quale keyword viene usata per definire una classe astratta in Python?", a:["abstract","@abstract","ABC","abc"], c:"ABC"},
128+
{q:"Quale keyword viene usata per gestire eccezioni in Python?", a:["try/except","catch","handle","throw"], c:"try/except"},
129+
{q:"Qual è il risultato di: 2 ** 3 ** 2 ?", a:["512","64","16","Errore"], c:"512"},
130+
{q:"Qual è la differenza principale tra lista e tupla?", a:["Le tuple sono immutabili","Le liste sono immutabili","Le tuple sono più lente","Nessuna"], c:"Le tuple sono immutabili"},
131+
{q:"Quale funzione serve per leggere tutto il contenuto di un file?", a:["read()","readline()","readlines()","open()"], c:"read()"},
132+
{q:"Qual è il costrutto corretto per definire una funzione in Python?", a:["def mia_funzione():","function mia_funzione()","fun mia_funzione():","define mia_funzione()"], c:"def mia_funzione():"},
133+
{q:"Qual è l’output di: 'Python'[1:4] ?", a:["yth","Pyt","tho","ytho"], c:"yth"},
134+
{q:"Qual è il modulo standard per lavorare con espressioni regolari?", a:["re","regex","match","exp"], c:"re"},
135+
{q:"In Python, qual è la differenza tra 'is' e '=='?", a:["'is' confronta identità, '==' confronta valori","Sono uguali","'==' confronta identità","'is' è per numeri, '==' per stringhe"], c:"'is' confronta identità, '==' confronta valori"},
136+
{q:"Qual è il costrutto per gestire un contesto (es. aprire file)?", a:["with","context","using","as"], c:"with"},
137+
{q:"Qual è il risultato di: bool('False')", a:["True","False","Errore","None"], c:"True"},
138+
{q:"Quale libreria Python è usata per i test unitari?", a:["unittest","pytest","doctest","tutte le precedenti"], c:"tutte le precedenti"},
139+
{q:"Qual è il metodo per aggiungere un elemento ad un dizionario?", a:["dict[key]=val","dict.add()","dict.append()","dict.push()"], c:"dict[key]=val"},
140+
{q:"Qual è l’output di: len(set([1,1,2,3]))", a:["3","4","2","1"], c:"3"},
141+
{q:"Qual è la parola chiave per definire una classe?", a:["class","Class","defclass","object"], c:"class"}
142+
];
143+
144+
const encryptedAnswers={};
145+
rawQuestions.forEach((q,i)=>{ encryptedAnswers["q"+i]=CryptoJS.AES.encrypt(q.c,secretKey).toString(); });
146+
147+
function shuffle(array){for(let i=array.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[array[i],array[j]]=[array[j],array[i]];} return array;}
148+
149+
const form=document.getElementById("quiz-form");
150+
const shuffledQuestions=shuffle([...rawQuestions]);
151+
shuffledQuestions.forEach((q,idx)=>{
152+
const qDiv=document.createElement("div");
153+
qDiv.className="question";
154+
qDiv.innerHTML=`<h3>${idx+1}. ${q.q}</h3>`;
155+
const answers=shuffle([...q.a]);
156+
answers.forEach(ans=>{
157+
qDiv.innerHTML+=`<label><input type="radio" name="q${rawQuestions.indexOf(q)}" value="${ans}"> ${ans}</label><br>`;
158+
});
159+
form.appendChild(qDiv);
160+
});
161+
162+
function checkQuiz(e){
163+
e.preventDefault();
164+
let score=0;
165+
for(let i=0;i<rawQuestions.length;i++){
166+
const user=document.querySelector(`input[name="q${i}"]:checked`);
167+
if(user){
168+
const decrypted=CryptoJS.AES.decrypt(encryptedAnswers["q"+i],secretKey).toString(CryptoJS.enc.Utf8);
169+
if(user.value===decrypted) score++;
170+
}
171+
}
172+
if(score===rawQuestions.length){
173+
document.getElementById("quiz-result").innerText="✅ Hai superato il quiz!";
174+
document.getElementById("badge-link").style.display="block";
175+
document.getElementById("download-btn").style.display="inline-block";
176+
} else {
177+
document.getElementById("quiz-result").innerText=`❌ Risposte corrette: ${score}/${rawQuestions.length}. Riprova!`;
178+
document.getElementById("download-btn").style.display="none";
179+
}
180+
}
181+
182+
183+
</script>
184+
185+
<section style="text-align:center;">
186+
<a href="https://github.com/h-anamai/corso-python-basic" class="btn">Vai al GitHub Repo</a>
187+
<a href="https://t.me/+gTwagH1r9kVjMjY0" class="btn social-btn">Unisciti al canale Telegram</a>
188+
<a href="https://discord.gg/gkjMTFSVc" class="btn social-btn discord">Unisciti al gruppo Discord</a>
189+
</section>
190+
191+
<footer>
192+
&copy; 2025 Hanamai. All rights reserved. | Built with precision for real-time data streaming excellence.
193+
</footer>
194+
195+
</body>
196+
</html>

0 commit comments

Comments
 (0)