forked from technolyceum/ai6-m2
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2cee19ba0e | |||
| 41a623d02a | |||
| 30bc82ad00 | |||
| dd33d45f46 | |||
| cae0d5b946 |
1017
AI-Powered Joke Bot _ Student Thesis.html
Normal file
1017
AI-Powered Joke Bot _ Student Thesis.html
Normal file
File diff suppressed because it is too large
Load Diff
315
AI-Powered Joke Bot _ Student Thesis_files/css2
Normal file
315
AI-Powered Joke Bot _ Student Thesis_files/css2
Normal file
@@ -0,0 +1,315 @@
|
|||||||
|
/* cyrillic-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
||||||
|
}
|
||||||
|
/* cyrillic */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||||
|
}
|
||||||
|
/* greek-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+1F00-1FFF;
|
||||||
|
}
|
||||||
|
/* greek */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
|
||||||
|
}
|
||||||
|
/* vietnamese */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
|
||||||
|
}
|
||||||
|
/* latin-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
|
}
|
||||||
|
/* latin */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2) format('woff2');
|
||||||
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
|
}
|
||||||
|
/* cyrillic-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
||||||
|
}
|
||||||
|
/* cyrillic */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||||
|
}
|
||||||
|
/* greek-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+1F00-1FFF;
|
||||||
|
}
|
||||||
|
/* greek */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
|
||||||
|
}
|
||||||
|
/* vietnamese */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
|
||||||
|
}
|
||||||
|
/* latin-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
|
}
|
||||||
|
/* latin */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2) format('woff2');
|
||||||
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
|
}
|
||||||
|
/* cyrillic-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 600;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
||||||
|
}
|
||||||
|
/* cyrillic */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 600;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||||
|
}
|
||||||
|
/* greek-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 600;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+1F00-1FFF;
|
||||||
|
}
|
||||||
|
/* greek */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 600;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
|
||||||
|
}
|
||||||
|
/* vietnamese */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 600;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
|
||||||
|
}
|
||||||
|
/* latin-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 600;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
|
}
|
||||||
|
/* latin */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 600;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2) format('woff2');
|
||||||
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
|
}
|
||||||
|
/* cyrillic-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
||||||
|
}
|
||||||
|
/* cyrillic */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||||
|
}
|
||||||
|
/* greek-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+1F00-1FFF;
|
||||||
|
}
|
||||||
|
/* greek */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
|
||||||
|
}
|
||||||
|
/* vietnamese */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
|
||||||
|
}
|
||||||
|
/* latin-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
|
}
|
||||||
|
/* latin */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2) format('woff2');
|
||||||
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
|
}
|
||||||
|
/* cyrillic-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 800;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
||||||
|
}
|
||||||
|
/* cyrillic */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 800;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||||
|
}
|
||||||
|
/* greek-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 800;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+1F00-1FFF;
|
||||||
|
}
|
||||||
|
/* greek */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 800;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
|
||||||
|
}
|
||||||
|
/* vietnamese */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 800;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
|
||||||
|
}
|
||||||
|
/* latin-ext */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 800;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2) format('woff2');
|
||||||
|
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
|
}
|
||||||
|
/* latin */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 800;
|
||||||
|
font-display: swap;
|
||||||
|
src: url(https://fonts.gstatic.com/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2) format('woff2');
|
||||||
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
|
}
|
||||||
@@ -1,154 +0,0 @@
|
|||||||
DANIL - DATABASE DESIGNER MISSION
|
|
||||||
Your Role: Question Master | Your File: questions.json
|
|
||||||
|
|
||||||
💡 What You're Building: You're creating all the quiz questions about Russian culture!
|
|
||||||
|
|
||||||
📋 LESSON 1-2: SETUP & BASIC QUESTIONS
|
|
||||||
|
|
||||||
Step 1: Fork and Clone (10 minutes)
|
|
||||||
1. Go to: https://gitea.techshare.cc/technolyceum/ai6-m2
|
|
||||||
2. Click the "Fork" button (creates your copy)
|
|
||||||
3. Copy your forked repository URL
|
|
||||||
4. Open Terminal and type:
|
|
||||||
git clone [YOUR-FORKED-URL-HERE]
|
|
||||||
cd ai6-m2
|
|
||||||
git checkout -b danil-database-work
|
|
||||||
|
|
||||||
Step 2: Understand the Question Format (10 minutes)
|
|
||||||
Open questions.json and look at the example:
|
|
||||||
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"question": "EXAMPLE: What is the capital of Russia?",
|
|
||||||
"options": ["St. Petersburg", "Moscow", "Kazan", "Sochi"],
|
|
||||||
"correct_answer": "Moscow"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
Each question needs:
|
|
||||||
- question: The actual question text
|
|
||||||
- options: 4 possible answers (A, B, C, D)
|
|
||||||
- correct_answer: The right answer (must match exactly)
|
|
||||||
|
|
||||||
Step 3: Create Your First 5 Questions (30 minutes)
|
|
||||||
DELETE everything in questions.json and TYPE THIS instead:
|
|
||||||
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"question": "What is the capital of Russia?",
|
|
||||||
"options": ["St. Petersburg", "Moscow", "Kazan", "Sochi"],
|
|
||||||
"correct_answer": "Moscow"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"question": "Which Russian composer wrote the music for Swan Lake?",
|
|
||||||
"options": ["Tchaikovsky", "Rachmaninoff", "Shostakovich", "Stravinsky"],
|
|
||||||
"correct_answer": "Tchaikovsky"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"question": "What is the traditional Russian doll called?",
|
|
||||||
"options": ["Babushka", "Matryoshka", "Krasnaya", "Kukla"],
|
|
||||||
"correct_answer": "Matryoshka"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"question": "Which Russian river is the longest in Europe?",
|
|
||||||
"options": ["Don River", "Volga River", "Yenisei River", "Lena River"],
|
|
||||||
"correct_answer": "Volga River"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"question": "What is the name of the Russian space agency?",
|
|
||||||
"options": ["Rosaviakosmos", "Roscosmos", "Soviet Space Program", "Starfleet Russia"],
|
|
||||||
"correct_answer": "Roscosmos"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
Save and push:
|
|
||||||
git add questions.json
|
|
||||||
git commit -m "feat: added first 5 Russian questions"
|
|
||||||
git push origin danil-database-work
|
|
||||||
|
|
||||||
📋 LESSON 3-4: MORE RUSSIAN CULTURE QUESTIONS
|
|
||||||
|
|
||||||
Step 4: Add 5 More Questions (40 minutes)
|
|
||||||
Add these questions AFTER your first 5 (don't delete the first ones!):
|
|
||||||
|
|
||||||
{
|
|
||||||
"question": "Which Russian leader introduced the policy of perestroika?",
|
|
||||||
"options": ["Vladimir Putin", "Joseph Stalin", "Mikhail Gorbachev", "Boris Yeltsin"],
|
|
||||||
"correct_answer": "Mikhail Gorbachev"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"question": "What is borscht?",
|
|
||||||
"options": ["A type of Russian bread", "A fermented drink", "A beet soup", "A meat pastry"],
|
|
||||||
"correct_answer": "A beet soup"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"question": "Which animal appears on the Russian coat of arms?",
|
|
||||||
"options": ["Bear", "Eagle", "Wolf", "Lion"],
|
|
||||||
"correct_answer": "Eagle"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"question": "What is the currency of Russia?",
|
|
||||||
"options": ["Ruble", "Krone", "Zloty", "Forint"],
|
|
||||||
"correct_answer": "Ruble"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"question": "Which Russian city was formerly called Stalingrad?",
|
|
||||||
"options": ["Moscow", "Volgograd", "Yekaterinburg", "Kursk"],
|
|
||||||
"correct_answer": "Volgograd"
|
|
||||||
}
|
|
||||||
|
|
||||||
Save and push:
|
|
||||||
git add questions.json
|
|
||||||
git commit -m "feat: added 5 more Russian culture questions"
|
|
||||||
git push origin danil-database-work
|
|
||||||
|
|
||||||
📋 LESSON 5-6: FINAL QUESTIONS & DIFFICULT ONES
|
|
||||||
|
|
||||||
Step 5: Add the Last 5 Challenging Questions (40 minutes)
|
|
||||||
Add these 5 final questions:
|
|
||||||
|
|
||||||
{
|
|
||||||
"question": "What is the name of the famous Russian ballet company?",
|
|
||||||
"options": ["Moscow Ballet", "Bolshoi Ballet", "St. Petersburg Ballet", "Imperial Russian Ballet"],
|
|
||||||
"correct_answer": "Bolshoi Ballet"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"question": "Which Russian scientist created the periodic table of elements?",
|
|
||||||
"options": ["Mikhail Lomonosov", "Dmitri Mendeleev", "Ivan Pavlov", "Nikola Tesla"],
|
|
||||||
"correct_answer": "Dmitri Mendeleev"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"question": "What was Sputnik famous for?",
|
|
||||||
"options": ["First animal in space", "First human in space", "First satellite in space", "First space station"],
|
|
||||||
"correct_answer": "First satellite in space"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"question": "Which Russian mountain range separates Europe from Asia?",
|
|
||||||
"options": ["Caucasus Mountains", "Ural Mountains", "Altai Mountains", "Sayan Mountains"],
|
|
||||||
"correct_answer": "Ural Mountains"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"question": "Who was the first woman in space from Russia?",
|
|
||||||
"options": ["Svetlana Savitskaya", "Yelena Kondakova", "Valentina Tereshkova", "Anna Kikina"],
|
|
||||||
"correct_answer": "Valentina Tereshkova"
|
|
||||||
}
|
|
||||||
|
|
||||||
Step 6: Test Your Questions (10 minutes)
|
|
||||||
Make sure you have exactly 15 questions total!
|
|
||||||
|
|
||||||
Final push:
|
|
||||||
git add questions.json
|
|
||||||
git commit -m "feat: completed all 15 Russian questions"
|
|
||||||
git push origin danil-database-work
|
|
||||||
|
|
||||||
✅ DANIL'S COMPLETION CHECKLIST
|
|
||||||
☐ 15 questions total (no more, no less)
|
|
||||||
☐ All questions about Russian culture/history
|
|
||||||
☐ Each question has 4 options
|
|
||||||
☐ Correct answers are accurate
|
|
||||||
☐ No spelling mistakes
|
|
||||||
☐ All questions are different topics
|
|
||||||
☐ All code pushed to your branch
|
|
||||||
☐ Created Pull Request for teacher to review
|
|
||||||
|
|
||||||
🎉 Congratulations Danil! You created the entire question database!
|
|
||||||
@@ -1,262 +0,0 @@
|
|||||||
DIMA - BACKEND DEVELOPER MISSION
|
|
||||||
Your Role: Game Brain Developer | Your File: app.py
|
|
||||||
|
|
||||||
💡 What You're Building: You're creating the "brain" of the game - all the rules, scoring, and game logic!
|
|
||||||
|
|
||||||
📋 LESSON 1-2: SETUP & PRIZE SYSTEM
|
|
||||||
|
|
||||||
Step 1: Fork and Clone (10 minutes)
|
|
||||||
1. Go to: https://gitea.techshare.cc/technolyceum/ai6-m2
|
|
||||||
2. Click the "Fork" button (creates your copy)
|
|
||||||
3. Copy your forked repository URL
|
|
||||||
4. Open Terminal and type:
|
|
||||||
git clone [YOUR-FORKED-URL-HERE]
|
|
||||||
cd ai6-m2
|
|
||||||
git checkout -b dima-backend-work
|
|
||||||
|
|
||||||
Step 2: Create the Prize Money System (20 minutes)
|
|
||||||
Open app.py and find these lines around line 8:
|
|
||||||
|
|
||||||
# TODO: Dima - Implement prize structure (15 levels)
|
|
||||||
PRIZE_LEVELS = [
|
|
||||||
# Format: [1000, 2000, 4000, 8000, 16000, 32000, ... up to 15 values]
|
|
||||||
]
|
|
||||||
|
|
||||||
DELETE those lines and TYPE THIS instead:
|
|
||||||
|
|
||||||
PRIZE_LEVELS = [
|
|
||||||
1000, # Level 1 - Question 1
|
|
||||||
2000, # Level 2 - Question 2
|
|
||||||
4000, # Level 3 - Question 3
|
|
||||||
8000, # Level 4 - Question 4
|
|
||||||
16000, # Level 5 - Question 5 ✅ Safe level!
|
|
||||||
32000, # Level 6 - Question 6
|
|
||||||
64000, # Level 7 - Question 7
|
|
||||||
128000, # Level 8 - Question 8
|
|
||||||
256000, # Level 9 - Question 9
|
|
||||||
512000, # Level 10 - Question 10 ✅ Safe level!
|
|
||||||
1024000, # Level 11 - Question 11
|
|
||||||
2048000, # Level 12 - Question 12
|
|
||||||
4096000, # Level 13 - Question 13
|
|
||||||
8192000, # Level 14 - Question 14
|
|
||||||
16384000 # Level 15 - Question 15 🏆 JACKPOT!
|
|
||||||
]
|
|
||||||
|
|
||||||
Save the file and test:
|
|
||||||
git add app.py
|
|
||||||
git commit -m "feat: added prize money system"
|
|
||||||
git push origin dima-backend-work
|
|
||||||
|
|
||||||
📋 LESSON 3-4: GAME SESSION & QUESTIONS
|
|
||||||
|
|
||||||
Step 3: Make the Game Start Working (25 minutes)
|
|
||||||
Find these lines around line 25:
|
|
||||||
|
|
||||||
@app.route('/start')
|
|
||||||
def start_game():
|
|
||||||
# TODO: Dima - Initialize game session
|
|
||||||
# Set up: score, current_question, lifelines, questions
|
|
||||||
return render_template('game.html')
|
|
||||||
|
|
||||||
DELETE those lines and TYPE THIS instead:
|
|
||||||
|
|
||||||
@app.route('/start')
|
|
||||||
def start_game():
|
|
||||||
# Initialize a new game session
|
|
||||||
session['score'] = 0
|
|
||||||
session['current_question'] = 0
|
|
||||||
session['guaranteed_prize'] = 0
|
|
||||||
session['lifelines'] = {
|
|
||||||
'fifty_fifty': True,
|
|
||||||
'phone_friend': True
|
|
||||||
}
|
|
||||||
session['game_over'] = False
|
|
||||||
|
|
||||||
# Load questions and shuffle them
|
|
||||||
with open('questions.json', 'r') as f:
|
|
||||||
session['questions'] = json.load(f)
|
|
||||||
|
|
||||||
return render_template('game.html')
|
|
||||||
|
|
||||||
Step 4: Make Questions Appear (15 minutes)
|
|
||||||
Find these lines around line 35:
|
|
||||||
|
|
||||||
@app.route('/get_question')
|
|
||||||
def get_question():
|
|
||||||
# TODO: Dima - Serve questions to frontend
|
|
||||||
# Return: question, options, question_number, current_prize
|
|
||||||
return jsonify({"error": "Not implemented"})
|
|
||||||
|
|
||||||
DELETE those lines and TYPE THIS instead:
|
|
||||||
|
|
||||||
@app.route('/get_question')
|
|
||||||
def get_question():
|
|
||||||
if session.get('game_over'):
|
|
||||||
return jsonify({'error': 'Game over'})
|
|
||||||
|
|
||||||
question_index = session.get('current_question', 0)
|
|
||||||
questions = session.get('questions', [])
|
|
||||||
|
|
||||||
if question_index >= len(questions):
|
|
||||||
session['game_over'] = True
|
|
||||||
return jsonify({'game_over': True, 'final_score': session['score']})
|
|
||||||
|
|
||||||
question = questions[question_index]
|
|
||||||
current_prize = PRIZE_LEVELS[question_index] if question_index < len(PRIZE_LEVELS) else 0
|
|
||||||
|
|
||||||
return jsonify({
|
|
||||||
'question': question['question'],
|
|
||||||
'options': question['options'],
|
|
||||||
'question_number': question_index + 1,
|
|
||||||
'total_questions': len(questions),
|
|
||||||
'current_prize': current_prize,
|
|
||||||
'score': session['score']
|
|
||||||
})
|
|
||||||
|
|
||||||
Save and push:
|
|
||||||
git add app.py
|
|
||||||
git commit -m "feat: game start and questions working"
|
|
||||||
git push origin dima-backend-work
|
|
||||||
|
|
||||||
📋 LESSON 5-6: ANSWER CHECKING & LIFELINES
|
|
||||||
|
|
||||||
Step 5: Make Answer Checking Work (30 minutes)
|
|
||||||
Find these lines around line 45:
|
|
||||||
|
|
||||||
@app.route('/answer', methods=['POST'])
|
|
||||||
def check_answer():
|
|
||||||
# TODO: Dima - Validate answers and update score
|
|
||||||
# Check if answer is correct, update session, return result
|
|
||||||
return jsonify({"error": "Not implemented"})
|
|
||||||
|
|
||||||
DELETE those lines and TYPE THIS instead:
|
|
||||||
|
|
||||||
@app.route('/answer', methods=['POST'])
|
|
||||||
def check_answer():
|
|
||||||
if session.get('game_over'):
|
|
||||||
return jsonify({'error': 'Game over'})
|
|
||||||
|
|
||||||
data = request.json
|
|
||||||
user_answer = data.get('answer')
|
|
||||||
question_index = session.get('current_question', 0)
|
|
||||||
questions = session.get('questions', [])
|
|
||||||
|
|
||||||
if question_index >= len(questions):
|
|
||||||
return jsonify({'error': 'No more questions'})
|
|
||||||
|
|
||||||
question = questions[question_index]
|
|
||||||
correct_answer = question['correct_answer']
|
|
||||||
prize_won = PRIZE_LEVELS[question_index] if question_index < len(PRIZE_LEVELS) else 0
|
|
||||||
|
|
||||||
if user_answer == correct_answer:
|
|
||||||
# Correct answer! Update score
|
|
||||||
session['score'] = prize_won
|
|
||||||
|
|
||||||
# Update guaranteed prize if reached safe level
|
|
||||||
if (question_index + 1) in GUARANTEED_LEVELS:
|
|
||||||
session['guaranteed_prize'] = prize_won
|
|
||||||
|
|
||||||
session['current_question'] += 1
|
|
||||||
|
|
||||||
# Check if game is won
|
|
||||||
if session['current_question'] >= len(questions):
|
|
||||||
session['game_over'] = True
|
|
||||||
return jsonify({
|
|
||||||
'correct': True,
|
|
||||||
'score': session['score'],
|
|
||||||
'prize_won': prize_won,
|
|
||||||
'game_won': True,
|
|
||||||
'final_score': session['score']
|
|
||||||
})
|
|
||||||
|
|
||||||
return jsonify({
|
|
||||||
'correct': True,
|
|
||||||
'score': session['score'],
|
|
||||||
'prize_won': prize_won,
|
|
||||||
'next_question': session['current_question'] < len(questions)
|
|
||||||
})
|
|
||||||
else:
|
|
||||||
# Wrong answer - game over!
|
|
||||||
session['game_over'] = True
|
|
||||||
final_prize = session.get('guaranteed_prize', 0)
|
|
||||||
|
|
||||||
return jsonify({
|
|
||||||
'correct': False,
|
|
||||||
'correct_answer': correct_answer,
|
|
||||||
'game_over': True,
|
|
||||||
'final_score': final_prize,
|
|
||||||
'prize_lost': prize_won
|
|
||||||
})
|
|
||||||
|
|
||||||
Step 6: Create Lifelines (20 minutes)
|
|
||||||
Find these lines around line 55:
|
|
||||||
|
|
||||||
@app.route('/lifeline/<lifeline_name>')
|
|
||||||
def use_lifeline(lifeline_name):
|
|
||||||
# TODO: Dima - Implement 50:50 and Phone a Friend
|
|
||||||
# Note: Ask AI will be version 2
|
|
||||||
return jsonify({"error": "Not implemented"})
|
|
||||||
|
|
||||||
DELETE those lines and TYPE THIS instead:
|
|
||||||
|
|
||||||
@app.route('/lifeline/<lifeline_name>')
|
|
||||||
def use_lifeline(lifeline_name):
|
|
||||||
if session.get('game_over'):
|
|
||||||
return jsonify({'error': 'Game over'})
|
|
||||||
|
|
||||||
if lifeline_name not in session['lifelines']:
|
|
||||||
return jsonify({'error': 'Invalid lifeline'})
|
|
||||||
|
|
||||||
if not session['lifelines'][lifeline_name]:
|
|
||||||
return jsonify({'error': 'Lifeline already used'})
|
|
||||||
|
|
||||||
question_index = session.get('current_question', 0)
|
|
||||||
questions = session.get('questions', [])
|
|
||||||
question = questions[question_index]
|
|
||||||
|
|
||||||
if lifeline_name == 'fifty_fifty':
|
|
||||||
# Remove two wrong answers
|
|
||||||
correct_answer = question['correct_answer']
|
|
||||||
options = question['options'].copy()
|
|
||||||
|
|
||||||
# Keep correct answer + one wrong answer
|
|
||||||
remaining_options = [correct_answer]
|
|
||||||
wrong_options = [opt for opt in options if opt != correct_answer]
|
|
||||||
remaining_options.append(random.choice(wrong_options))
|
|
||||||
random.shuffle(remaining_options)
|
|
||||||
|
|
||||||
session['lifelines'][lifeline_name] = False
|
|
||||||
return jsonify({
|
|
||||||
'lifeline': 'fifty_fifty',
|
|
||||||
'remaining_options': remaining_options
|
|
||||||
})
|
|
||||||
|
|
||||||
elif lifeline_name == 'phone_friend':
|
|
||||||
# Phone a friend simulation
|
|
||||||
correct_answer = question['correct_answer']
|
|
||||||
friend_names = ["Ivan", "Svetlana", "Dmitri", "Anastasia"]
|
|
||||||
confidence = random.randint(50, 90)
|
|
||||||
|
|
||||||
session['lifelines'][lifeline_name] = False
|
|
||||||
return jsonify({
|
|
||||||
'lifeline': 'phone_friend',
|
|
||||||
'friend_says': f"{random.choice(friend_names)} says: 'I think it's {correct_answer}, but I'm only {confidence}% sure'"
|
|
||||||
})
|
|
||||||
|
|
||||||
Final push:
|
|
||||||
git add app.py
|
|
||||||
git commit -m "feat: completed backend with answers and lifelines"
|
|
||||||
git push origin dima-backend-work
|
|
||||||
|
|
||||||
✅ DIMA'S COMPLETION CHECKLIST
|
|
||||||
☐ Prize money system (15 levels) working
|
|
||||||
☐ Game starts and creates new session
|
|
||||||
☐ Questions load from JSON file
|
|
||||||
☐ Answer checking works (right/wrong)
|
|
||||||
☐ 50:50 lifeline removes 2 wrong answers
|
|
||||||
☐ Phone a Friend gives hints
|
|
||||||
☐ Safe levels save your money at Q5 and Q10
|
|
||||||
☐ All code pushed to your branch
|
|
||||||
☐ Created Pull Request for teacher to review
|
|
||||||
|
|
||||||
🎉 Congratulations Dima! You built the entire game engine!
|
|
||||||
@@ -1,349 +0,0 @@
|
|||||||
INNA - FRONTEND DEVELOPER MISSION
|
|
||||||
Your Role: Game Interface Designer | Your Files: templates/ and static/script.js
|
|
||||||
|
|
||||||
💡 What You're Building: You're creating what players see and click on!
|
|
||||||
|
|
||||||
📋 LESSON 1-2: SETUP & BASIC GAME FLOW
|
|
||||||
|
|
||||||
Step 1: Fork and Clone (10 minutes)
|
|
||||||
1. Go to: https://gitea.techshare.cc/technolyceum/ai6-m2
|
|
||||||
2. Click the "Fork" button (creates your copy)
|
|
||||||
3. Copy your forked repository URL
|
|
||||||
4. Open Terminal and type:
|
|
||||||
git clone [YOUR-FORKED-URL-HERE]
|
|
||||||
cd ai6-m2
|
|
||||||
git checkout -b inna-frontend-work
|
|
||||||
|
|
||||||
Step 2: Make the Game Load Questions (30 minutes)
|
|
||||||
Open static/script.js and find the loadQuestion function.
|
|
||||||
|
|
||||||
DELETE these lines:
|
|
||||||
|
|
||||||
function loadQuestion() {
|
|
||||||
fetch('/get_question')
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.error) {
|
|
||||||
console.error(data.error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (data.game_over) {
|
|
||||||
endGame(data.final_score);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
gameState.currentQuestion = data;
|
|
||||||
displayQuestion(data);
|
|
||||||
})
|
|
||||||
.catch(error => console.error('Error:', error));
|
|
||||||
}
|
|
||||||
|
|
||||||
TYPE THIS instead:
|
|
||||||
|
|
||||||
function loadQuestion() {
|
|
||||||
fetch('/get_question')
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.error) {
|
|
||||||
alert("Game error: " + data.error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (data.game_over) {
|
|
||||||
endGame(data.final_score);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
gameState.currentQuestion = data;
|
|
||||||
displayQuestion(data);
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
alert("Network error - check if server is running!");
|
|
||||||
console.error('Error:', error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Step 3: Make Questions Display Properly (20 minutes)
|
|
||||||
Find the displayQuestion function.
|
|
||||||
|
|
||||||
DELETE these lines:
|
|
||||||
|
|
||||||
function displayQuestion(questionData) {
|
|
||||||
document.getElementById('question-num').textContent = questionData.question_number;
|
|
||||||
document.getElementById('question-text').textContent = questionData.question;
|
|
||||||
|
|
||||||
const optionsContainer = document.getElementById('options-container');
|
|
||||||
optionsContainer.innerHTML = '';
|
|
||||||
|
|
||||||
const optionLetters = ['A', 'B', 'C', 'D'];
|
|
||||||
questionData.options.forEach((option, index) => {
|
|
||||||
const optionElement = document.createElement('div');
|
|
||||||
optionElement.className = 'option';
|
|
||||||
optionElement.textContent = `${optionLetters[index]}. ${option}`;
|
|
||||||
optionElement.onclick = () => selectAnswer(option);
|
|
||||||
optionsContainer.appendChild(optionElement);
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById('feedback').style.display = 'none';
|
|
||||||
gameState.optionsDisabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
TYPE THIS instead:
|
|
||||||
|
|
||||||
function displayQuestion(questionData) {
|
|
||||||
// Update question number and text
|
|
||||||
document.getElementById('question-num').textContent = questionData.question_number;
|
|
||||||
document.getElementById('question-text').textContent = questionData.question;
|
|
||||||
document.getElementById('current-prize').textContent = questionData.current_prize;
|
|
||||||
|
|
||||||
// Clear previous options
|
|
||||||
const optionsContainer = document.getElementById('options-container');
|
|
||||||
optionsContainer.innerHTML = '';
|
|
||||||
|
|
||||||
// Create new option buttons
|
|
||||||
const optionLetters = ['A', 'B', 'C', 'D'];
|
|
||||||
questionData.options.forEach((option, index) => {
|
|
||||||
const optionElement = document.createElement('div');
|
|
||||||
optionElement.className = 'option';
|
|
||||||
optionElement.textContent = `${optionLetters[index]}. ${option}`;
|
|
||||||
optionElement.onclick = () => selectAnswer(option);
|
|
||||||
optionsContainer.appendChild(optionElement);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Reset feedback and enable clicking
|
|
||||||
document.getElementById('feedback').style.display = 'none';
|
|
||||||
document.getElementById('feedback').className = 'feedback';
|
|
||||||
gameState.optionsDisabled = false;
|
|
||||||
|
|
||||||
// Clear lifeline result
|
|
||||||
document.getElementById('lifeline-result').textContent = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
Save and push:
|
|
||||||
git add static/script.js
|
|
||||||
git commit -m "feat: basic question loading working"
|
|
||||||
git push origin inna-frontend-work
|
|
||||||
|
|
||||||
📋 LESSON 3-4: ANSWER HANDLING
|
|
||||||
|
|
||||||
Step 4: Make Answer Selection Work (30 minutes)
|
|
||||||
Find the selectAnswer function.
|
|
||||||
|
|
||||||
DELETE these lines:
|
|
||||||
|
|
||||||
function selectAnswer(selectedAnswer) {
|
|
||||||
if (gameState.optionsDisabled) return;
|
|
||||||
gameState.optionsDisabled = true;
|
|
||||||
|
|
||||||
fetch('/answer', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {'Content-Type': 'application/json'},
|
|
||||||
body: JSON.stringify({ answer: selectedAnswer })
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
const feedback = document.getElementById('feedback');
|
|
||||||
feedback.style.display = 'block';
|
|
||||||
|
|
||||||
if (data.correct) {
|
|
||||||
feedback.textContent = 'Correct! 🎉';
|
|
||||||
feedback.className = 'feedback correct';
|
|
||||||
setTimeout(() => {
|
|
||||||
if (data.next_question) loadQuestion();
|
|
||||||
else endGame(data.final_score, true);
|
|
||||||
}, 1500);
|
|
||||||
} else {
|
|
||||||
feedback.textContent = `Incorrect! Correct answer: ${data.correct_answer}`;
|
|
||||||
feedback.className = 'feedback incorrect';
|
|
||||||
setTimeout(() => endGame(data.final_score), 2000);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => console.error('Error:', error));
|
|
||||||
}
|
|
||||||
|
|
||||||
TYPE THIS instead:
|
|
||||||
|
|
||||||
function selectAnswer(selectedAnswer) {
|
|
||||||
// Prevent double-clicking
|
|
||||||
if (gameState.optionsDisabled) return;
|
|
||||||
gameState.optionsDisabled = true;
|
|
||||||
|
|
||||||
// Disable all options while checking
|
|
||||||
document.querySelectorAll('.option').forEach(btn => {
|
|
||||||
btn.style.pointerEvents = 'none';
|
|
||||||
});
|
|
||||||
|
|
||||||
// Send answer to server
|
|
||||||
fetch('/answer', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {'Content-Type': 'application/json'},
|
|
||||||
body: JSON.stringify({ answer: selectedAnswer })
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
const feedback = document.getElementById('feedback');
|
|
||||||
feedback.style.display = 'block';
|
|
||||||
|
|
||||||
if (data.correct) {
|
|
||||||
feedback.textContent = 'Correct! 🎉 +' + data.prize_won + ' ₽';
|
|
||||||
feedback.className = 'feedback correct';
|
|
||||||
|
|
||||||
// Wait then load next question or end game
|
|
||||||
setTimeout(() => {
|
|
||||||
if (data.game_won) {
|
|
||||||
endGame(data.final_score, true);
|
|
||||||
} else if (data.next_question) {
|
|
||||||
loadQuestion();
|
|
||||||
} else {
|
|
||||||
endGame(data.final_score);
|
|
||||||
}
|
|
||||||
}, 2000);
|
|
||||||
} else {
|
|
||||||
feedback.textContent = `Incorrect! Correct answer was: ${data.correct_answer}`;
|
|
||||||
feedback.className = 'feedback incorrect';
|
|
||||||
|
|
||||||
// Highlight correct answer in green
|
|
||||||
document.querySelectorAll('.option').forEach(btn => {
|
|
||||||
if (btn.textContent.includes(data.correct_answer)) {
|
|
||||||
btn.style.background = '#4CAF50';
|
|
||||||
btn.style.color = 'white';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
setTimeout(() => endGame(data.final_score), 3000);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
alert("Error sending answer!");
|
|
||||||
console.error('Error:', error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Step 5: Make Lifelines Work (20 minutes)
|
|
||||||
Find the useLifeline function.
|
|
||||||
|
|
||||||
DELETE these lines:
|
|
||||||
|
|
||||||
function useLifeline(lifelineName) {
|
|
||||||
fetch(`/lifeline/${lifelineName}`)
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.error) {
|
|
||||||
alert(data.error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
document.getElementById('lifeline-result').textContent =
|
|
||||||
data.hint || data.friend_says || 'Lifeline used!';
|
|
||||||
})
|
|
||||||
.catch(error => console.error('Error:', error));
|
|
||||||
}
|
|
||||||
|
|
||||||
TYPE THIS instead:
|
|
||||||
|
|
||||||
function useLifeline(lifelineName) {
|
|
||||||
// Disable the lifeline button
|
|
||||||
document.querySelector(`button[onclick="useLifeline('${lifelineName}')"]`).disabled = true;
|
|
||||||
|
|
||||||
fetch(`/lifeline/${lifelineName}`)
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.error) {
|
|
||||||
alert(data.error);
|
|
||||||
document.querySelector(`button[onclick="useLifeline('${lifelineName}')"]`).disabled = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const resultElement = document.getElementById('lifeline-result');
|
|
||||||
|
|
||||||
if (lifelineName === 'fifty_fifty') {
|
|
||||||
// Hide the wrong options
|
|
||||||
document.querySelectorAll('.option').forEach(option => {
|
|
||||||
const optionText = option.textContent.substring(3); // Remove "A. ", "B. ", etc.
|
|
||||||
if (!data.remaining_options.includes(optionText)) {
|
|
||||||
option.style.display = 'none';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
resultElement.textContent = 'Two wrong answers removed!';
|
|
||||||
} else if (lifelineName === 'phone_friend') {
|
|
||||||
resultElement.textContent = data.friend_says;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
alert("Lifeline error!");
|
|
||||||
console.error('Error:', error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Save and push:
|
|
||||||
git add static/script.js
|
|
||||||
git commit -m "feat: answer handling and lifelines working"
|
|
||||||
git push origin inna-frontend-work
|
|
||||||
|
|
||||||
📋 LESSON 5-6: GAME FLOW COMPLETION
|
|
||||||
|
|
||||||
Step 6: Complete the Game Flow (40 minutes)
|
|
||||||
Find the endGame function.
|
|
||||||
|
|
||||||
DELETE these lines:
|
|
||||||
|
|
||||||
function endGame(finalScore, isWin = false) {
|
|
||||||
document.getElementById('final-prize').textContent = finalScore;
|
|
||||||
document.getElementById('game-over-screen').style.display = 'block';
|
|
||||||
document.querySelector('.game-area').style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
TYPE THIS instead:
|
|
||||||
|
|
||||||
function endGame(finalScore, isWin = false) {
|
|
||||||
const finalPrizeElement = document.getElementById('final-prize');
|
|
||||||
const gameOverScreen = document.getElementById('game-over-screen');
|
|
||||||
const gameOverTitle = document.getElementById('game-over-title');
|
|
||||||
const gameOverMessage = document.getElementById('game-over-message');
|
|
||||||
|
|
||||||
finalPrizeElement.textContent = finalScore.toLocaleString();
|
|
||||||
|
|
||||||
if (isWin) {
|
|
||||||
gameOverTitle.innerHTML = '🎉 YOU WIN! 🎉';
|
|
||||||
gameOverTitle.style.color = '#fdbb2d';
|
|
||||||
gameOverMessage.textContent = 'Congratulations! You won the top prize!';
|
|
||||||
} else if (finalScore > 0) {
|
|
||||||
gameOverTitle.textContent = 'Game Over!';
|
|
||||||
gameOverTitle.style.color = '#1a2a6c';
|
|
||||||
gameOverMessage.textContent = 'You reached a guaranteed prize level!';
|
|
||||||
} else {
|
|
||||||
gameOverTitle.textContent = 'Game Over!';
|
|
||||||
gameOverTitle.style.color = '#b21f1f';
|
|
||||||
gameOverMessage.textContent = 'Better luck next time!';
|
|
||||||
}
|
|
||||||
|
|
||||||
gameOverScreen.style.display = 'block';
|
|
||||||
document.querySelector('.game-area').style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
Also update the restartGame function:
|
|
||||||
|
|
||||||
DELETE this line:
|
|
||||||
function restartGame() {
|
|
||||||
window.location.href = '/start';
|
|
||||||
}
|
|
||||||
|
|
||||||
TYPE THIS instead:
|
|
||||||
function restartGame() {
|
|
||||||
// Reload the page to start fresh
|
|
||||||
window.location.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
Final push:
|
|
||||||
git add static/script.js
|
|
||||||
git commit -m "feat: completed frontend game flow"
|
|
||||||
git push origin inna-frontend-work
|
|
||||||
|
|
||||||
✅ INNA'S COMPLETION CHECKLIST
|
|
||||||
☐ Questions load and display correctly
|
|
||||||
☐ Answer buttons work and show feedback
|
|
||||||
☐ Prize money updates when answering
|
|
||||||
☐ 50:50 lifeline hides wrong answers
|
|
||||||
☐ Phone a Friend shows hints
|
|
||||||
☐ Game over screen shows correct messages
|
|
||||||
☐ Restart button works
|
|
||||||
☐ All code pushed to your branch
|
|
||||||
☐ Created Pull Request for teacher to review
|
|
||||||
|
|
||||||
🎉 Congratulations Inna! You built the entire game interface!
|
|
||||||
@@ -1,510 +0,0 @@
|
|||||||
{\rtf1\ansi\ansicpg1252\cocoartf2818
|
|
||||||
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 AppleColorEmoji;\f2\fnil\fcharset0 AppleSymbols;
|
|
||||||
\f3\fnil\fcharset0 LucidaGrande;}
|
|
||||||
{\colortbl;\red255\green255\blue255;}
|
|
||||||
{\*\expandedcolortbl;;}
|
|
||||||
\paperw11900\paperh16840\margl1440\margr1440\vieww11900\viewh14080\viewkind1
|
|
||||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
|
||||||
|
|
||||||
\f0\fs24 \cf0 # Teacher - Complete Project Manager Guide.txt\
|
|
||||||
\
|
|
||||||
```\
|
|
||||||
TEACHER - COMPLETE PROJECT MANAGER GUIDE\
|
|
||||||
Russian Millionaire Quiz Game - 6 Lesson Project\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u55357 \u56523
|
|
||||||
\f0 YOUR ROLES:\
|
|
||||||
\'95 Team Lead - Guide students through development\
|
|
||||||
\'95 Git Master - Manage repositories and merges\
|
|
||||||
\'95 User Tester - Verify all components work\
|
|
||||||
\'95 Integration Manager - Combine all student work\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u55356 \u57263
|
|
||||||
\f0 PROJECT TIMELINE (6 Lessons)\
|
|
||||||
\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
LESSON 1-2: SETUP & FOUNDATION\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
STUDENT GOALS:\
|
|
||||||
\'95 Dima: Implement prize money system in app.py\
|
|
||||||
\'95 Danil: Create first 5 Russian culture questions\
|
|
||||||
\'95 Inna: Make basic question loading work\
|
|
||||||
\'95 Artyom: Start Russian color theme in CSS\
|
|
||||||
\
|
|
||||||
TEACHER TASKS:\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Setup Verification:\
|
|
||||||
1. Ensure main repo is ready: \
|
|
||||||
https://gitea.techshare.cc/technolyceum/ai6-m2\
|
|
||||||
\
|
|
||||||
2. Verify all students have:\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Forked the repository\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Created their role-specific branch\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Made first commit\
|
|
||||||
\
|
|
||||||
3. Quick Progress Check (Terminal):\
|
|
||||||
```bash\
|
|
||||||
# Check each student's fork manually in Gitea web interface\
|
|
||||||
# Look for 4 branches: \
|
|
||||||
# - dima-backend-work\
|
|
||||||
# - inna-frontend-work \
|
|
||||||
# - danil-database-work\
|
|
||||||
# - artyom-graphics-work\
|
|
||||||
```\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Individual Progress Checks:\
|
|
||||||
```bash\
|
|
||||||
# Temporary check for each student:\
|
|
||||||
git clone [STUDENT-FORK-URL] temp-check\
|
|
||||||
cd temp-check\
|
|
||||||
git checkout [THEIR-BRANCH]\
|
|
||||||
\
|
|
||||||
# Dima Check:\
|
|
||||||
grep -A 15 "PRIZE_LEVELS" app.py\
|
|
||||||
\
|
|
||||||
# Danil Check:\
|
|
||||||
python3 -c "import json; print('Questions:', len(json.load(open('questions.json'))))"\
|
|
||||||
\
|
|
||||||
# Inna Check:\
|
|
||||||
grep -c "function" static/script.js\
|
|
||||||
\
|
|
||||||
# Artyom Check:\
|
|
||||||
grep -c "background" static/style.css\
|
|
||||||
\
|
|
||||||
cd ..\
|
|
||||||
rm -rf temp-check\
|
|
||||||
```\
|
|
||||||
\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
LESSON 3-4: CORE DEVELOPMENT\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
STUDENT GOALS:\
|
|
||||||
\'95 Dima: Game session & question loading\
|
|
||||||
\'95 Danil: 10+ questions completed \
|
|
||||||
\'95 Inna: Answer handling system\
|
|
||||||
\'95 Artyom: Enhanced question/option styling\
|
|
||||||
\
|
|
||||||
TEACHER TASKS:\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Daily Monitoring:\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 All students have pushed latest work\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 No Git conflicts detected\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Students approximately 60% complete\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Progress Verification Commands:\
|
|
||||||
```bash\
|
|
||||||
# Dima - Session Management:\
|
|
||||||
grep -A 10 "session\\[" app.py\
|
|
||||||
\
|
|
||||||
# Danil - Question Count:\
|
|
||||||
python3 -c "import json; data=json.load(open('questions.json')); print(f'Total: \{len(data)\} questions')"\
|
|
||||||
\
|
|
||||||
# Inna - Answer Handling:\
|
|
||||||
grep -A 5 "selectAnswer" static/script.js\
|
|
||||||
\
|
|
||||||
# Artyom - Enhanced Styling:\
|
|
||||||
grep -c "border-radius.*15\\|box-shadow" static/style.css\
|
|
||||||
```\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Early Integration Test:\
|
|
||||||
```bash\
|
|
||||||
# Test backend basics:\
|
|
||||||
python3 app.py\
|
|
||||||
# Open http://localhost:5000\
|
|
||||||
# Check: Home page loads? /start works?\
|
|
||||||
```\
|
|
||||||
\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
LESSON 5-6: FEATURE COMPLETION & TESTING\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
STUDENT GOALS:\
|
|
||||||
\'95 Dima: Answer checking & lifelines complete\
|
|
||||||
\'95 Danil: All 15 questions finished\
|
|
||||||
\'95 Inna: Lifelines & game flow working\
|
|
||||||
\'95 Artyom: Complete visual design\
|
|
||||||
\
|
|
||||||
TEACHER TASKS:\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Final Progress Check:\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 All features implemented\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Students created Pull Requests\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Ready for final integration\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 PR Review Checklist:\
|
|
||||||
\
|
|
||||||
DIMA'S BACKEND PR:\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 All routes work (/start, /get_question, /answer, /lifeline)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Prize system calculates correctly\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 No syntax errors in app.py\
|
|
||||||
\
|
|
||||||
DANIL'S DATABASE PR:\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Exactly 15 questions\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Russian culture themes\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 No spelling errors\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Plausible wrong answers\
|
|
||||||
\
|
|
||||||
INNA'S FRONTEND PR:\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Questions display correctly\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Answer selection works\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Lifelines functional\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Game flow complete\
|
|
||||||
\
|
|
||||||
ARTYOM'S GRAPHICS PR:\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Russian color theme throughout\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Professional styling\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Good user experience\
|
|
||||||
\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
FINAL INTEGRATION & MERGING\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Merge Strategy (Do in Gitea Web Interface):\
|
|
||||||
1. FIRST: Danil's questions.json (database)\
|
|
||||||
2. SECOND: Dima's app.py (backend)\
|
|
||||||
3. THIRD: Artyom's static/style.css (styling) \
|
|
||||||
4. FOURTH: Inna's templates/ and static/script.js (frontend)\
|
|
||||||
\
|
|
||||||
Merge Commands (Gitea Web):\
|
|
||||||
\'95 Go to each PR\
|
|
||||||
\'95 Click "Merge Pull Request"\
|
|
||||||
\'95 Resolve conflicts if needed (prioritize more complete code)\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Final Integration Test:\
|
|
||||||
```bash\
|
|
||||||
# After all merges:\
|
|
||||||
git clone https://gitea.techshare.cc/technolyceum/ai6-m2.git final-game\
|
|
||||||
cd final-game\
|
|
||||||
\
|
|
||||||
# Install dependencies:\
|
|
||||||
pip install flask\
|
|
||||||
\
|
|
||||||
# Test complete application:\
|
|
||||||
python3 app.py\
|
|
||||||
\
|
|
||||||
# Manual Testing Checklist:\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Home page loads with Russian theme\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Start game button works\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Questions display with styling\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Answer selection works\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Prize money updates correctly\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 50:50 lifeline removes wrong answers\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Phone a Friend gives hints\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Game over screen appears\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Restart button works\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 No console errors in browser\
|
|
||||||
```\
|
|
||||||
\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
TROUBLESHOOTING GUIDE\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
COMMON ISSUES & SOLUTIONS:\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u10060
|
|
||||||
\f0 "ModuleNotFoundError: No module named 'flask'"\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Solution: pip install flask\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u10060
|
|
||||||
\f0 JSON syntax error in questions.json\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Solution: Use https://jsonlint.com to validate\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u10060
|
|
||||||
\f0 Game starts but no questions appear\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Solution: Check browser console for errors, verify backend routes\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u10060
|
|
||||||
\f0 CSS not loading\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Solution: Check static file paths, clear browser cache\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u10060
|
|
||||||
\f0 Git merge conflicts\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Solution: Manually resolve in Gitea, prioritize more complete implementation\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u10060
|
|
||||||
\f0 Student stuck on task\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Solution: Use exact code from their instruction sheet\
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u10060
|
|
||||||
\f0 Prize money not updating\
|
|
||||||
|
|
||||||
\f1 \uc0\u9989
|
|
||||||
\f0 Solution: Check Dima's PRIZE_LEVELS array and answer validation\
|
|
||||||
\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
ASSESSMENT RUBRIC\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
GRADING (25 points per student):\
|
|
||||||
\
|
|
||||||
BACKEND (DIMA):\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Prize system implemented (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Game session management (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Question serving (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Answer validation (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Lifeline functionality (5pts)\
|
|
||||||
\
|
|
||||||
DATABASE (DANIL):\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 15 questions total (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Russian culture theme (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Accurate answers (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Good wrong options (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 No errors (5pts)\
|
|
||||||
\
|
|
||||||
FRONTEND (INNA):\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Question display (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Answer handling (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Game flow (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Lifeline integration (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Error handling (5pts)\
|
|
||||||
\
|
|
||||||
GRAPHICS (ARTYOM):\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Russian theme (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Professional styling (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 User experience (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Consistency (5pts)\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Visual appeal (5pts)\
|
|
||||||
\
|
|
||||||
EXTRA CREDIT (5pts):\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Early completion\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Extra features\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Exceptional quality\
|
|
||||||
\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
QUICK REFERENCE COMMANDS\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
```bash\
|
|
||||||
# Check any student's progress:\
|
|
||||||
git clone [STUDENT-FORK-URL] temp\
|
|
||||||
cd temp && git checkout [BRANCH]\
|
|
||||||
\
|
|
||||||
# Backend check:\
|
|
||||||
grep -A 15 "PRIZE_LEVELS" app.py\
|
|
||||||
\
|
|
||||||
# Database check:\
|
|
||||||
python3 -c "import json; print(len(json.load(open('questions.json'))))"\
|
|
||||||
\
|
|
||||||
# Frontend check:\
|
|
||||||
grep -c "function" static/script.js\
|
|
||||||
\
|
|
||||||
# Graphics check:\
|
|
||||||
grep -c "gradient" static/style.css\
|
|
||||||
\
|
|
||||||
# Test integrated game:\
|
|
||||||
python3 app.py\
|
|
||||||
# Open: http://localhost:5000\
|
|
||||||
```\
|
|
||||||
\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
FINAL TEACHER CHECKLIST\
|
|
||||||
\uc0\u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \u9473 \
|
|
||||||
\
|
|
||||||
BEFORE PROJECT:\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Main repo prepared with boilerplate\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Students understand fork workflow\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Instruction sheets distributed\
|
|
||||||
\
|
|
||||||
DURING PROJECT:\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Daily progress monitoring\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Individual student support\
|
|
||||||
|
|
||||||
\f3 \uc0\u65533 \u65039
|
|
||||||
\f0 Regular Git status checks\
|
|
||||||
\
|
|
||||||
AFTER PROJECT:\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 All PRs reviewed and merged\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Final integration tested\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Game fully functional\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Grades assigned using rubric\
|
|
||||||
|
|
||||||
\f2 \uc0\u9744
|
|
||||||
\f0 Student achievements celebrated!
|
|
||||||
\f1 \uc0\u55356 \u57225
|
|
||||||
\f0 \
|
|
||||||
\
|
|
||||||
|
|
||||||
\f1 \uc0\u55356 \u57225
|
|
||||||
\f0 CONGRATULATIONS! You successfully guided a complete software development project from concept to working application!\
|
|
||||||
```\
|
|
||||||
\
|
|
||||||
This single file contains everything you need as project manager - timeline, monitoring commands, troubleshooting, assessment, and final integration steps all in one printable document!}
|
|
||||||
257
Thesis_AI6_Building a Telegram Joke Bot_ A Student Project.html
Normal file
257
Thesis_AI6_Building a Telegram Joke Bot_ A Student Project.html
Normal file
@@ -0,0 +1,257 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Building a Telegram Joke Bot: A Student Project</title>
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: 'Arial', sans-serif;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #333;
|
||||||
|
max-width: 800px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.document {
|
||||||
|
background-color: white;
|
||||||
|
padding: 40px;
|
||||||
|
box-shadow: 0 0 20px rgba(0,0,0,0.1);
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
color: #2c3e50;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
padding-bottom: 15px;
|
||||||
|
border-bottom: 3px solid #3498db;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-team {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
padding: 15px;
|
||||||
|
background-color: #f0f7ff;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.supervisor {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #2c3e50;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.developers {
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
color: #3498db;
|
||||||
|
margin-top: 25px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
padding-left: 10px;
|
||||||
|
border-left: 4px solid #3498db;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul, ol {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
padding-left: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-block {
|
||||||
|
background-color: #2c3e50;
|
||||||
|
color: #ecf0f1;
|
||||||
|
padding: 20px;
|
||||||
|
margin: 20px 0;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-family: 'Courier New', monospace;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-note {
|
||||||
|
background-color: #ffebee;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin: 10px 0;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
border-left: 3px solid #f44336;
|
||||||
|
}
|
||||||
|
|
||||||
|
.highlight {
|
||||||
|
background-color: #fffacd;
|
||||||
|
padding: 2px 4px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addendum {
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
padding: 20px;
|
||||||
|
margin-top: 30px;
|
||||||
|
border-left: 4px solid #e74c3c;
|
||||||
|
page-break-inside: avoid;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
body {
|
||||||
|
background-color: white;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.document {
|
||||||
|
box-shadow: none;
|
||||||
|
padding: 15mm;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
color: #2c3e50;
|
||||||
|
page-break-after: avoid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-block {
|
||||||
|
background-color: #f8f9fa;
|
||||||
|
color: black;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-team {
|
||||||
|
background-color: #f8f9fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addendum {
|
||||||
|
page-break-inside: avoid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="document">
|
||||||
|
<h1>Building a Telegram Joke Bot: A Student Project</h1>
|
||||||
|
|
||||||
|
<div class="project-team">
|
||||||
|
<div class="supervisor">Supervisor: Bob Santos</div>
|
||||||
|
<div class="developers">
|
||||||
|
Developers: Дашунин Дмитрий, Ерохин Даниил, Овганова Инна, Полковников Артём
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2>Introduction</h2>
|
||||||
|
<p>A group of students created a Telegram joke bot as a school project. A Telegram bot is a small computer program that can send and receive messages automatically. This particular bot tells jokes to people who message it. The students wanted to make something fun that could bring smiles to people's faces while learning about computer programming.</p>
|
||||||
|
|
||||||
|
<h2>Aim</h2>
|
||||||
|
<p>The goal of this project was to create a simple, working bot that could:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Respond to basic commands from users</li>
|
||||||
|
<li>Tell different jokes at random</li>
|
||||||
|
<li>Stay online and working all the time</li>
|
||||||
|
<li>Show how even beginners can create useful programs</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Method</h2>
|
||||||
|
<p>The students used these steps to build their bot:</p>
|
||||||
|
<ol>
|
||||||
|
<li><strong>Choose Python</strong>: They picked Python because it's a beginner-friendly programming language.</li>
|
||||||
|
<li><strong>Use Telegram's Tools</strong>: They connected to Telegram's Bot API, which lets programs send and receive messages.</li>
|
||||||
|
<li><strong>Write the Code</strong>: They wrote about 30 lines of code that make the bot work.</li>
|
||||||
|
<li><strong>Add Jokes</strong>: They created a list of three funny jokes for the bot to tell.</li>
|
||||||
|
<li><strong>Test the Bot</strong>: They tested the bot to make sure it worked correctly.</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<h2>Results</h2>
|
||||||
|
<p>The students successfully created a working Telegram bot with these features:</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>/start command</strong>: When users type <span class="highlight">/start</span>, the bot greets them and explains how to get jokes.</li>
|
||||||
|
<li><strong>/joke command</strong>: When users type <span class="highlight">/joke</span>, the bot randomly picks and tells one of its jokes.</li>
|
||||||
|
<li><strong>Three different jokes</strong>: The bot can tell jokes about robots, lettuce, and eggs.</li>
|
||||||
|
<li><strong>Always available</strong>: Once started, the bot runs continuously until stopped.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Conclusion</h2>
|
||||||
|
<p>The students learned that creating technology doesn't have to be complicated. With just basic programming skills, they built a bot that can make people happy. This project showed them that coding is not just about math and logic—it's also a creative tool. They proved that even simple programs can have real value and bring joy to people.</p>
|
||||||
|
|
||||||
|
<h2>Future Possibilities</h2>
|
||||||
|
<p>This bot could be improved in many ways:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Let users submit their own jokes</li>
|
||||||
|
<li>Allow users to vote for their favorite jokes</li>
|
||||||
|
<li>Send jokes at scheduled times each day</li>
|
||||||
|
<li>Connect to online joke databases for more variety</li>
|
||||||
|
<li>Add voice messages that tell jokes out loud</li>
|
||||||
|
<li>Tell different types of jokes based on user preferences</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="addendum">
|
||||||
|
<h2>Addendum: Complete Bot Code</h2>
|
||||||
|
<p>Here is the complete Python code for the Telegram joke bot:</p>
|
||||||
|
|
||||||
|
<div class="code-note">
|
||||||
|
<strong>Note:</strong> For security reasons, the actual bot token has been removed. When using this code, you should replace "YOUR_BOT_TOKEN_HERE" with your actual bot token from @BotFather.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="code-block">from telegram import Update
|
||||||
|
from telegram.ext import Application, CommandHandler, ContextTypes
|
||||||
|
import random
|
||||||
|
|
||||||
|
JOKE_LIST = [
|
||||||
|
"Why did the robot go to school? To recharge his brain! 🔋",
|
||||||
|
"Knock knock!\nWho's there?\nLettuce!\nLettuce who?\nLettuce in!",
|
||||||
|
"Why don't eggs tell jokes? They'd crack each other up! 🥚"
|
||||||
|
]
|
||||||
|
|
||||||
|
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||||
|
await update.message.reply_text("Hi! Type /joke for a funny joke! 😄")
|
||||||
|
|
||||||
|
async def send_joke(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||||
|
joke = random.choice(JOKE_LIST)
|
||||||
|
await update.message.reply_text(joke)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# 🔑 REPLACE THIS with your bot token from @BotFather
|
||||||
|
BOT_TOKEN = "YOUR_BOT_TOKEN_HERE"
|
||||||
|
|
||||||
|
app = Application.builder().token(BOT_TOKEN).build()
|
||||||
|
app.add_handler(CommandHandler("start", start))
|
||||||
|
app.add_handler(CommandHandler("joke", send_joke))
|
||||||
|
print("Bot is running... Press Ctrl+C to stop.")
|
||||||
|
app.run_polling()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()</div>
|
||||||
|
|
||||||
|
<p>The code is organized in a simple way:</p>
|
||||||
|
<ol>
|
||||||
|
<li>It imports necessary tools (like the Telegram library and random number generator)</li>
|
||||||
|
<li>It creates a list of jokes</li>
|
||||||
|
<li>It makes two functions: one for the /start command and one for the /joke command</li>
|
||||||
|
<li>It connects to Telegram using a special bot token</li>
|
||||||
|
<li>It starts the bot and keeps it running</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
BIN
Thesis_AI6_Building a Telegram Joke Bot_ A Student Project.pdf
Normal file
BIN
Thesis_AI6_Building a Telegram Joke Bot_ A Student Project.pdf
Normal file
Binary file not shown.
21
android_game.py
Normal file
21
android_game.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# asteroid_game.py - Starter Template
|
||||||
|
import turtle
|
||||||
|
import random
|
||||||
|
|
||||||
|
# === SETUP THE GAME WINDOW ===
|
||||||
|
|
||||||
|
|
||||||
|
# === CREATE PLAYER ===
|
||||||
|
|
||||||
|
|
||||||
|
# === GAME VARIABLES ===
|
||||||
|
|
||||||
|
|
||||||
|
# === FUNCTIONS ===
|
||||||
|
|
||||||
|
|
||||||
|
# === TEST CODE ===
|
||||||
|
# Uncomment this to test:
|
||||||
|
# draw_player()
|
||||||
|
# screen.update()
|
||||||
|
# turtle.done()
|
||||||
44
app.py
44
app.py
@@ -1,44 +0,0 @@
|
|||||||
from flask import Flask, render_template, request, jsonify, session
|
|
||||||
import json
|
|
||||||
import random
|
|
||||||
import os
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
|
||||||
app.secret_key = 'quizimoto_secret_key'
|
|
||||||
|
|
||||||
# TODO: Dima - Implement prize structure (15 levels)
|
|
||||||
PRIZE_LEVELS = [
|
|
||||||
# Format: [1000, 2000, 4000, 8000, 16000, 32000, ... up to 15 values]
|
|
||||||
]
|
|
||||||
GUARANTEED_LEVELS = [5, 10] # First and second guaranteed levels
|
|
||||||
|
|
||||||
@app.route('/')
|
|
||||||
def index():
|
|
||||||
return render_template('index.html')
|
|
||||||
|
|
||||||
@app.route('/start')
|
|
||||||
def start_game():
|
|
||||||
# TODO: Dima - Initialize game session
|
|
||||||
# Set up: score, current_question, lifelines, questions
|
|
||||||
return render_template('game.html')
|
|
||||||
|
|
||||||
@app.route('/get_question')
|
|
||||||
def get_question():
|
|
||||||
# TODO: Dima - Serve questions to frontend
|
|
||||||
# Return: question, options, question_number, current_prize
|
|
||||||
return jsonify({"error": "Not implemented"})
|
|
||||||
|
|
||||||
@app.route('/answer', methods=['POST'])
|
|
||||||
def check_answer():
|
|
||||||
# TODO: Dima - Validate answers and update score
|
|
||||||
# Check if answer is correct, update session, return result
|
|
||||||
return jsonify({"error": "Not implemented"})
|
|
||||||
|
|
||||||
@app.route('/lifeline/<lifeline_name>')
|
|
||||||
def use_lifeline(lifeline_name):
|
|
||||||
# TODO: Dima - Implement 50:50 and Phone a Friend
|
|
||||||
# Note: Ask AI will be version 2
|
|
||||||
return jsonify({"error": "Not implemented"})
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
app.run(debug=True)
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"question": "EXAMPLE: What is the capital of Russia?",
|
|
||||||
"options": ["St. Petersburg", "Moscow", "Kazan", "Sochi"],
|
|
||||||
"correct_answer": "Moscow"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"question": "TODO: Danil - Add Russian culture question here",
|
|
||||||
"options": ["Option A", "Option B", "Option C", "Option D"],
|
|
||||||
"correct_answer": "Correct Answer"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
535
quiz_game/From_concept_to_release.html
Normal file
535
quiz_game/From_concept_to_release.html
Normal file
@@ -0,0 +1,535 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Build a Russian Millionaire Quiz Game!</title>
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-family: 'Comic Sans MS', cursive, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
|
||||||
|
color: white;
|
||||||
|
min-height: 100vh;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
max-width: 1000px;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
|
border-radius: 20px;
|
||||||
|
padding: 30px;
|
||||||
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
header {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
padding: 20px;
|
||||||
|
background: linear-gradient(90deg, #1a2a6c, #b21f1f);
|
||||||
|
border-radius: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 2.5rem;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
text-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
color: #fdbb2d;
|
||||||
|
margin: 20px 0 15px;
|
||||||
|
border-bottom: 2px solid #fdbb2d;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide {
|
||||||
|
display: none;
|
||||||
|
padding: 20px;
|
||||||
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
|
border-radius: 15px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
animation: fadeIn 0.5s ease-in;
|
||||||
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
line-height: 1.6;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.role-box {
|
||||||
|
background: linear-gradient(135deg, #1a2a6c, #b21f1f);
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin: 15px 0;
|
||||||
|
border-left: 5px solid #fdbb2d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.role-title {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #fdbb2d;
|
||||||
|
font-size: 1.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.role-desc {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
background: linear-gradient(135deg, #1a2a6c, #b21f1f);
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 12px 25px;
|
||||||
|
border-radius: 50px;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s;
|
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
transform: translateY(-3px);
|
||||||
|
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
button:active {
|
||||||
|
transform: translateY(1px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-bar {
|
||||||
|
height: 10px;
|
||||||
|
background-color: rgba(255, 255, 255, 0.2);
|
||||||
|
border-radius: 5px;
|
||||||
|
margin: 20px 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress {
|
||||||
|
height: 100%;
|
||||||
|
background: linear-gradient(90deg, #1a2a6c, #fdbb2d);
|
||||||
|
width: 0%;
|
||||||
|
transition: width 0.5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide-counter {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 10px;
|
||||||
|
font-size: 1rem;
|
||||||
|
color: #fdbb2d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-preview {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-screen {
|
||||||
|
width: 300px;
|
||||||
|
height: 200px;
|
||||||
|
background-color: #1a2a6c;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 15px;
|
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.question-box {
|
||||||
|
background-color: #fdbb2d;
|
||||||
|
color: #1a2a6c;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option {
|
||||||
|
background-color: white;
|
||||||
|
color: #1a2a6c;
|
||||||
|
padding: 8px;
|
||||||
|
margin: 5px 0;
|
||||||
|
border-radius: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option:hover {
|
||||||
|
background-color: #b21f1f;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeIn {
|
||||||
|
from { opacity: 0; }
|
||||||
|
to { opacity: 1; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.highlight {
|
||||||
|
color: #fdbb2d;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.russian-flag {
|
||||||
|
display: inline-block;
|
||||||
|
width: 20px;
|
||||||
|
height: 15px;
|
||||||
|
background: linear-gradient(to bottom, white 33%, blue 33%, blue 66%, red 66%);
|
||||||
|
margin: 0 5px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<header>
|
||||||
|
<h1>Build a Russian Millionaire Quiz Game!</h1>
|
||||||
|
<p>From Concept to Release in 30 Minutes</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="progress-bar">
|
||||||
|
<div class="progress" id="progress"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Slide 1: Introduction -->
|
||||||
|
<div class="slide active" id="slide1">
|
||||||
|
<h2>Welcome, Future Game Developers!</h2>
|
||||||
|
<div class="content">
|
||||||
|
<p>Today we're going to create our very own "Who Wants to Be a Millionaire" style quiz game with a Russian twist!</p>
|
||||||
|
<p>We'll use Python Flask for the website and DeepSeek AI to help with our questions.</p>
|
||||||
|
<p>By the end of this class, you'll understand how games are made from start to finish!</p>
|
||||||
|
|
||||||
|
<div class="game-preview">
|
||||||
|
<div class="game-screen">
|
||||||
|
<div class="question-box">What is the capital of Russia?</div>
|
||||||
|
<div class="option">A. St. Petersburg</div>
|
||||||
|
<div class="option">B. Moscow <span class="russian-flag"></span></div>
|
||||||
|
<div class="option">C. Kazan</div>
|
||||||
|
<div class="option">D. Sochi</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Let's get started on our game development journey!</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-container">
|
||||||
|
<button onclick="prevSlide()">Previous</button>
|
||||||
|
<button onclick="nextSlide()">Next</button>
|
||||||
|
</div>
|
||||||
|
<div class="slide-counter">Slide 1 of 8</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Slide 2: Concept & Research -->
|
||||||
|
<div class="slide" id="slide2">
|
||||||
|
<h2>Stage 1: Concept & Research</h2>
|
||||||
|
<div class="content">
|
||||||
|
<p>Every great game starts with an idea! Our concept is:</p>
|
||||||
|
<p class="highlight">"A 'Who Wants to Be a Millionaire' style quiz about Russian culture, history, and fun facts!"</p>
|
||||||
|
|
||||||
|
<p>Our research tasks:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Learn about the original Millionaire game format</li>
|
||||||
|
<li>Research interesting Russian trivia</li>
|
||||||
|
<li>Study how Flask websites work</li>
|
||||||
|
<li>Explore how AI can help create questions</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="role-box">
|
||||||
|
<div class="role-title">Research Specialist</div>
|
||||||
|
<div class="role-desc">This person will find fun Russian facts and help create our question database.</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Who wants to be our Research Specialist?</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-container">
|
||||||
|
<button onclick="prevSlide()">Previous</button>
|
||||||
|
<button onclick="nextSlide()">Next</button>
|
||||||
|
</div>
|
||||||
|
<div class="slide-counter">Slide 2 of 8</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Slide 3: User Stories -->
|
||||||
|
<div class="slide" id="slide3">
|
||||||
|
<h2>Stage 2: User Stories</h2>
|
||||||
|
<div class="content">
|
||||||
|
<p>User stories help us understand what our players will do in the game:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>"As a player, I want to see multiple choice questions"</li>
|
||||||
|
<li>"As a player, I want lifelines like 50:50 and Ask the Audience"</li>
|
||||||
|
<li>"As a player, I want to see my score increase as I answer correctly"</li>
|
||||||
|
<li>"As a player, I want fun Russian-themed graphics and sounds"</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>These stories help us plan what features to build!</p>
|
||||||
|
|
||||||
|
<div class="game-preview">
|
||||||
|
<div class="game-screen">
|
||||||
|
<div class="question-box">Which Russian composer wrote 'Swan Lake'?</div>
|
||||||
|
<div class="option">A. Tchaikovsky <span class="russian-flag"></span></div>
|
||||||
|
<div class="option">B. Rachmaninoff</div>
|
||||||
|
<div class="option">C. Shostakovich</div>
|
||||||
|
<div class="option">D. Stravinsky</div>
|
||||||
|
<div style="margin-top: 10px; font-size: 0.8rem;">
|
||||||
|
Lifelines: 50:50 | Ask AI | Phone a Friend
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-container">
|
||||||
|
<button onclick="prevSlide()">Previous</button>
|
||||||
|
<button onclick="nextSlide()">Next</button>
|
||||||
|
</div>
|
||||||
|
<div class="slide-counter">Slide 3 of 8</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Slide 4: Task Allocation -->
|
||||||
|
<div class="slide" id="slide4">
|
||||||
|
<h2>Stage 3: Task Allocation</h2>
|
||||||
|
<div class="content">
|
||||||
|
<p>Now let's divide the work! We have 4 important roles:</p>
|
||||||
|
|
||||||
|
<div class="role-box">
|
||||||
|
<div class="role-title">Backend Developer</div>
|
||||||
|
<div class="role-desc">Creates the game logic using Python Flask and connects to the DeepSeek API.</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="role-box">
|
||||||
|
<div class="role-title">Database Designer</div>
|
||||||
|
<div class="role-desc">Builds the question database using JSON and works with the Research Specialist.</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="role-box">
|
||||||
|
<div class="role-title">Frontend Developer</div>
|
||||||
|
<div class="role-desc">Designs the game screens using HTML, CSS, and JavaScript.</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="role-box">
|
||||||
|
<div class="role-title">Graphics & Sound Artist</div>
|
||||||
|
<div class="role-desc">Creates Russian-themed visuals, icons, and sound effects for the game.</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Which role sounds most interesting to you?</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-container">
|
||||||
|
<button onclick="prevSlide()">Previous</button>
|
||||||
|
<button onclick="nextSlide()">Next</button>
|
||||||
|
</div>
|
||||||
|
<div class="slide-counter">Slide 4 of 8</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Slide 5: Alpha Development -->
|
||||||
|
<div class="slide" id="slide5">
|
||||||
|
<h2>Stage 4: Alpha Development</h2>
|
||||||
|
<div class="content">
|
||||||
|
<p>In the Alpha stage, we build the basic version of our game:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Backend Developer: Sets up Flask server and basic game routes</li>
|
||||||
|
<li>Database Designer: Creates JSON file with first 5 Russian trivia questions</li>
|
||||||
|
<li>Frontend Developer: Builds the question screen with 4 answer options</li>
|
||||||
|
<li>Graphics Artist: Creates simple Russian-themed background and buttons</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Our Alpha version will have:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Basic question display</li>
|
||||||
|
<li>Answer selection</li>
|
||||||
|
<li>Simple scoring</li>
|
||||||
|
<li>Russian color theme (white, blue, red)</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Let's build our foundation!</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-container">
|
||||||
|
<button onclick="prevSlide()">Previous</button>
|
||||||
|
<button onclick="nextSlide()">Next</button>
|
||||||
|
</div>
|
||||||
|
<div class="slide-counter">Slide 5 of 8</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Slide 6: Beta Development -->
|
||||||
|
<div class="slide" id="slide6">
|
||||||
|
<h2>Stage 5: Beta Development</h2>
|
||||||
|
<div class="content">
|
||||||
|
<p>In the Beta stage, we add more features and polish:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Backend Developer: Implements lifelines and connects to DeepSeek API</li>
|
||||||
|
<li>Database Designer: Expands to 15 questions with difficulty levels</li>
|
||||||
|
<li>Frontend Developer: Adds lifeline buttons and score display</li>
|
||||||
|
<li>Graphics Artist: Creates matryoshka doll icons and Russian landmark images</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Our Beta version will have:</p>
|
||||||
|
<ul>
|
||||||
|
<li>All 15 questions with increasing difficulty</li>
|
||||||
|
<li>50:50 and "Ask AI" lifelines</li>
|
||||||
|
<li>Better visuals with Russian themes</li>
|
||||||
|
<li>Sound effects for correct/incorrect answers</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="game-preview">
|
||||||
|
<div class="game-screen">
|
||||||
|
<div class="question-box">What is the traditional Russian doll called?</div>
|
||||||
|
<div class="option">A. Babushka</div>
|
||||||
|
<div class="option">B. Matryoshka <span class="russian-flag"></span></div>
|
||||||
|
<div class="option">C. Krasnaya</div>
|
||||||
|
<div class="option">D. Kukla</div>
|
||||||
|
<div style="margin-top: 10px; font-size: 0.8rem; text-align: center;">
|
||||||
|
Score: 1,000 RUB | Lifelines: <span style="color: #fdbb2d">50:50</span> | Ask AI |
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-container">
|
||||||
|
<button onclick="prevSlide()">Previous</button>
|
||||||
|
<button onclick="nextSlide()">Next</button>
|
||||||
|
</div>
|
||||||
|
<div class="slide-counter">Slide 6 of 8</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Slide 7: Production & Testing -->
|
||||||
|
<div class="slide" id="slide7">
|
||||||
|
<h2>Stage 6: Production & Testing</h2>
|
||||||
|
<div class="content">
|
||||||
|
<p>Time to test our game and fix any issues!</p>
|
||||||
|
|
||||||
|
<p>Testing tasks:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Play the game multiple times to find bugs</li>
|
||||||
|
<li>Check if all questions display correctly</li>
|
||||||
|
<li>Test the lifelines - do they work properly?</li>
|
||||||
|
<li>Make sure the scoring system is accurate</li>
|
||||||
|
<li>Verify the AI integration gives helpful hints</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>After testing, we'll:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Fix any problems we find</li>
|
||||||
|
<li>Add final polish to graphics and sounds</li>
|
||||||
|
<li>Prepare for our game launch!</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Who wants to be our Chief Tester?</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-container">
|
||||||
|
<button onclick="prevSlide()">Previous</button>
|
||||||
|
<button onclick="nextSlide()">Next</button>
|
||||||
|
</div>
|
||||||
|
<div class="slide-counter">Slide 7 of 8</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Slide 8: Release & Celebration -->
|
||||||
|
<div class="slide" id="slide8">
|
||||||
|
<h2>Stage 7: Release & Celebration!</h2>
|
||||||
|
<div class="content">
|
||||||
|
<p>Congratulations! Our Russian Millionaire Quiz Game is ready!</p>
|
||||||
|
|
||||||
|
<p>What we've accomplished:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Created a working quiz game with 15 Russian trivia questions</li>
|
||||||
|
<li>Built a Flask website with game logic</li>
|
||||||
|
<li>Integrated DeepSeek AI for lifelines</li>
|
||||||
|
<li>Designed Russian-themed graphics and sounds</li>
|
||||||
|
<li>Tested and polished our game</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Now it's time to:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Share our game with friends and family</li>
|
||||||
|
<li>Celebrate our success!</li>
|
||||||
|
<li>Think about what game we want to make next</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="game-preview">
|
||||||
|
<div class="game-screen" style="text-align: center; display: flex; flex-direction: column; justify-content: center;">
|
||||||
|
<div style="font-size: 1.5rem; color: #fdbb2d; margin-bottom: 10px;">YOU WIN!</div>
|
||||||
|
<div>1,000,000 RUB</div>
|
||||||
|
<div style="margin-top: 15px; font-size: 0.9rem;">Congratulations, Millionaire!</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Great job, game developers! You've successfully created your first AI-powered quiz game!</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-container">
|
||||||
|
<button onclick="prevSlide()">Previous</button>
|
||||||
|
<button onclick="restartPresentation()">Start Over</button>
|
||||||
|
</div>
|
||||||
|
<div class="slide-counter">Slide 8 of 8</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let currentSlide = 1;
|
||||||
|
const totalSlides = 8;
|
||||||
|
|
||||||
|
function updateProgress() {
|
||||||
|
const progress = (currentSlide / totalSlides) * 100;
|
||||||
|
document.getElementById('progress').style.width = `${progress}%`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function showSlide(n) {
|
||||||
|
// Hide all slides
|
||||||
|
const slides = document.getElementsByClassName('slide');
|
||||||
|
for (let i = 0; i < slides.length; i++) {
|
||||||
|
slides[i].classList.remove('active');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show the current slide
|
||||||
|
document.getElementById(`slide${n}`).classList.add('active');
|
||||||
|
|
||||||
|
// Update progress bar
|
||||||
|
updateProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
function nextSlide() {
|
||||||
|
if (currentSlide < totalSlides) {
|
||||||
|
currentSlide++;
|
||||||
|
showSlide(currentSlide);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function prevSlide() {
|
||||||
|
if (currentSlide > 1) {
|
||||||
|
currentSlide--;
|
||||||
|
showSlide(currentSlide);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function restartPresentation() {
|
||||||
|
currentSlide = 1;
|
||||||
|
showSlide(currentSlide);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize the presentation
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
showSlide(1);
|
||||||
|
updateProgress();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
1098
quiz_game/Quiz_Game_Project-Student Learning_Portal.html
Normal file
1098
quiz_game/Quiz_Game_Project-Student Learning_Portal.html
Normal file
File diff suppressed because it is too large
Load Diff
876
quiz_game/Russian_Millionaire_Quiz_Game_Comprehensive_Guide.html
Normal file
876
quiz_game/Russian_Millionaire_Quiz_Game_Comprehensive_Guide.html
Normal file
@@ -0,0 +1,876 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Russian Millionaire Quiz Game - Comprehensive Guide</title>
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--primary: #1a237e;
|
||||||
|
--secondary: #d32f2f;
|
||||||
|
--accent: #ffc107;
|
||||||
|
--light: #f5f5f5;
|
||||||
|
--dark: #212121;
|
||||||
|
--success: #4caf50;
|
||||||
|
--step-bg: #f8f9fa;
|
||||||
|
--step-border: #dee2e6;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: var(--light);
|
||||||
|
color: var(--dark);
|
||||||
|
line-height: 1.6;
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
header {
|
||||||
|
background: linear-gradient(135deg, var(--primary), #283593);
|
||||||
|
color: white;
|
||||||
|
padding: 2rem;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 10px 10px 0 0;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 1rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo-icon {
|
||||||
|
font-size: 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 2.5rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subtitle {
|
||||||
|
font-size: 1.4rem;
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section {
|
||||||
|
background: white;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-header {
|
||||||
|
background: var(--step-bg);
|
||||||
|
padding: 1.5rem;
|
||||||
|
border-bottom: 2px solid var(--step-border);
|
||||||
|
font-size: 1.3rem;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-content {
|
||||||
|
padding: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step {
|
||||||
|
background: #f9f9f9;
|
||||||
|
border-left: 4px solid var(--primary);
|
||||||
|
margin: 1rem 0;
|
||||||
|
padding: 1rem;
|
||||||
|
border-radius: 0 8px 8px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-number {
|
||||||
|
background: var(--primary);
|
||||||
|
color: white;
|
||||||
|
padding: 0.3rem 0.7rem;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-structure {
|
||||||
|
background: #fff8e1;
|
||||||
|
padding: 1rem;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-item {
|
||||||
|
margin: 0.3rem 0;
|
||||||
|
padding-left: 1.5rem;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-item:before {
|
||||||
|
content: "📄";
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.folder:before {
|
||||||
|
content: "📁";
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-block {
|
||||||
|
position: relative;
|
||||||
|
background: #2d2d2d;
|
||||||
|
color: #f8f8f2;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 1rem;
|
||||||
|
margin: 1rem 0;
|
||||||
|
overflow-x: auto;
|
||||||
|
font-family: 'Courier New', Courier, monospace;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-line {
|
||||||
|
position: relative;
|
||||||
|
padding-left: 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line-number {
|
||||||
|
position: absolute;
|
||||||
|
left: 1rem;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tip-box {
|
||||||
|
background: #e8f5e9;
|
||||||
|
padding: 1rem;
|
||||||
|
border-left: 4px solid var(--success);
|
||||||
|
margin: 1rem 0;
|
||||||
|
border-radius: 0 8px 8px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.role-header {
|
||||||
|
background: var(--step-bg);
|
||||||
|
padding: 1rem;
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
border-radius: 8px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
text-align: center;
|
||||||
|
padding: 2rem;
|
||||||
|
color: #666;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<header>
|
||||||
|
<div class="logo">
|
||||||
|
<div class="logo-icon">🎮</div>
|
||||||
|
<div>
|
||||||
|
<h1>Russian Millionaire Quiz Game</h1>
|
||||||
|
<div class="subtitle">Comprehensive Step-by-Step Guide</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div class="section-header">Project Overview</div>
|
||||||
|
<div class="section-content">
|
||||||
|
<div class="file-structure">
|
||||||
|
<h4>Project File Structure:</h4>
|
||||||
|
<div class="file-item folder">russian-millionaire/</div>
|
||||||
|
<div class="file-item">app.py (Main application file)</div>
|
||||||
|
<div class="file-item">questions.json (All quiz questions)</div>
|
||||||
|
<div class="file-item folder">templates/</div>
|
||||||
|
<div class="file-item">index.html (Home page)</div>
|
||||||
|
<div class="file-item">game.html (Game screen)</div>
|
||||||
|
<div class="file-item folder">static/</div>
|
||||||
|
<div class="file-item">style.css (All styling)</div>
|
||||||
|
<div class="file-item">script.js (Game interaction)</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tip-box">
|
||||||
|
<p><strong>Pro Tip:</strong> All project files are available at <a href="https://gitea.techshare.cc/technolyceum/ai6-m2.git" target="_blank">https://gitea.techshare.cc/technolyceum/ai6-m2.git</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div class="section-header">Installation Instructions</div>
|
||||||
|
<div class="section-content">
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 1</div>
|
||||||
|
<h3>Clone the Repository</h3>
|
||||||
|
<p>Open your terminal and run the following command to get the project files:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
git clone https://gitea.techshare.cc/technolyceum/ai6-m2.git
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 2</div>
|
||||||
|
<h3>Navigate to Project Directory</h3>
|
||||||
|
<p>Move into the project directory using:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
cd ai6-m2
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 3</div>
|
||||||
|
<h3>Install Requirements</h3>
|
||||||
|
<p>Install the necessary Python packages:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
pip install -r requirements.txt
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div class="section-header">Database Setup - Danil</div>
|
||||||
|
<div class="section-content">
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 1</div>
|
||||||
|
<h3>Open Database File</h3>
|
||||||
|
<p>Navigate to the database file at:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
/Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/starter_templates/docs/roles/database-designer-danil.md
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 2</div>
|
||||||
|
<h3>Set Up MongoDB Connection (Lines 1-5)</h3>
|
||||||
|
<p>Add the MongoDB connection information:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
// 1. Import MongoDB driver (line 1)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">2</span>
|
||||||
|
from pymongo import MongoClient
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">3</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">4</span>
|
||||||
|
// 2. Connect to MongoDB using the connection URI (line 3-5)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">5</span>
|
||||||
|
client = MongoClient('mongodb://localhost:27017/')
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">6</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">7</span>
|
||||||
|
// 3. Select the appropriate database (line 7)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">8</span>
|
||||||
|
db = client['student_db']
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">9</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">10</span>
|
||||||
|
// 4. Select the questions collection (line 9)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">11</span>
|
||||||
|
questions_collection = db['questions']
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">12</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">13</span>
|
||||||
|
// 5. Add error handling for database connection (line 11)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">14</span>
|
||||||
|
try:
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">15</span>
|
||||||
|
client.admin.command('ping')
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">16</span>
|
||||||
|
print("Successfully connected to MongoDB!")
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">17</span>
|
||||||
|
except Exception as e:
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">18</span>
|
||||||
|
print(f"MongoDB connection error: {e}")
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 3</div>
|
||||||
|
<h3>Insert Questions into Database</h3>
|
||||||
|
<p>Add your quiz questions to the database:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
// Sample question format
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">2</span>
|
||||||
|
question = {
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">3</span>
|
||||||
|
// 1. Question text (line 1)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">4</span>
|
||||||
|
"question": "What is the capital of Russia?",
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">5</span>
|
||||||
|
// 2. Answer options (line 2-5)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">6</span>
|
||||||
|
"options": ["Moscow", "St. Petersburg", "Novosibirsk", "Kazan"],
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">7</span>
|
||||||
|
// 3. Correct answer index (line 6)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">8</span>
|
||||||
|
"correct_answer": 0
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">9</span>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">10</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">11</span>
|
||||||
|
// Insert question into collection (line 8)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">12</span>
|
||||||
|
questions_collection.insert_one(question)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div class="section-header">Backend Setup - Dima</div>
|
||||||
|
<div class="section-content">
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 1</div>
|
||||||
|
<h3>Open Backend File</h3>
|
||||||
|
<p>Navigate to the backend developer documentation:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
/Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/starter_templates/docs/roles/backend-developer-dima.md
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 2</div>
|
||||||
|
<h3>Set Up Flask Application (Lines 1-6)</h3>
|
||||||
|
<p>Add the Flask setup code:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
// 1. Import Flask and PyMongo (line 1-2)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">2</span>
|
||||||
|
from flask import Flask, session, redirect, url_for, request, jsonify
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">3</span>
|
||||||
|
from flask_pymongo import PyMongo
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">4</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">5</span>
|
||||||
|
// 2. Connect to MongoDB database (line 4-6)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">6</span>
|
||||||
|
app = Flask(__name__)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">7</span>
|
||||||
|
app.config['MONGO_URI'] = 'mongodb://localhost:27017/student_db'
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">8</span>
|
||||||
|
mongo = PyMongo(app)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 3</div>
|
||||||
|
<h3>Define API Endpoints (Lines 8-14)</h3>
|
||||||
|
<p>Add the API endpoints for getting questions and submitting answers:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
// 3. Define API endpoint for getting questions (line 8-10)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">2</span>
|
||||||
|
@app.route('/get_question')
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">3</span>
|
||||||
|
def get_question():
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">4</span>
|
||||||
|
// 1. Get current question number from session
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">5</span>
|
||||||
|
question_num = session.get('current_question', 0)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">6</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">7</span>
|
||||||
|
// 2. Get question from database
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">8</span>
|
||||||
|
question = mongo.db.questions.find_one({"question_number": question_num})
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">9</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">10</span>
|
||||||
|
// 3. Format response
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">11</span>
|
||||||
|
if question:
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">12</span>
|
||||||
|
return jsonify({
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">13</span>
|
||||||
|
"question": question['question'],
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">14</span>
|
||||||
|
"options": question['options'],
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">15</span>
|
||||||
|
"question_number": question_num,
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">16</span>
|
||||||
|
"current_prize": calculate_prize(question_num)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">17</span>
|
||||||
|
})
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">18</span>
|
||||||
|
else:
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">19</span>
|
||||||
|
return jsonify({"game_over": True, "final_score": calculate_final_score()})
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">20</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">21</span>
|
||||||
|
// 4. Define API endpoint for submitting answers (line 12-14)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">22</span>
|
||||||
|
@app.route('/answer', methods=['POST'])
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">23</span>
|
||||||
|
def answer_question():
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">24</span>
|
||||||
|
// 1. Get user's answer
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">25</span>
|
||||||
|
user_answer = request.json.get('answer')
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">26</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">27</span>
|
||||||
|
// 2. Get current question
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">28</span>
|
||||||
|
question_num = session.get('current_question', 0)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">29</span>
|
||||||
|
current_question = mongo.db.questions.find_one({"question_number": question_num})
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">30</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">31</span>
|
||||||
|
// 3. Check if answer is correct
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">32</span>
|
||||||
|
is_correct = current_question['options'][current_question['correct_answer']] == user_answer
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">33</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">34</span>
|
||||||
|
// 4. Update game state
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">35</span>
|
||||||
|
if is_correct:
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">36</span>
|
||||||
|
session['current_question'] = question_num + 1
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">37</span>
|
||||||
|
return jsonify({
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">38</span>
|
||||||
|
"correct": True,
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">39</span>
|
||||||
|
"correct_answer": current_question['correct_answer'],
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">40</span>
|
||||||
|
"game_over": question_num + 1 >= TOTAL_QUESTIONS
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">41</span>
|
||||||
|
})
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">42</span>
|
||||||
|
else:
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">43</span>
|
||||||
|
return jsonify({
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">44</span>
|
||||||
|
"correct": False,
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">45</span>
|
||||||
|
"correct_answer": current_question['correct_answer'],
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">46</span>
|
||||||
|
"game_over": True
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">47</span>
|
||||||
|
})
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div class="section-header">Frontend Setup - Inna</div>
|
||||||
|
<div class="section-content">
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 1</div>
|
||||||
|
<h3>Open Frontend File</h3>
|
||||||
|
<p>Navigate to the frontend developer documentation:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
/Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/starter_templates/docs/roles/frontend-developer-inna.md
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 2</div>
|
||||||
|
<h3>Create HTML Structure (Lines 1-5)</h3>
|
||||||
|
<p>Add the basic HTML structure with game container:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
// 1. Create HTML structure with game container (line 1-5)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">2</span>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">3</span>
|
||||||
|
<html lang="en">
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">4</span>
|
||||||
|
<head>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">5</span>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">6</span>
|
||||||
|
<title>Russian Quiz</title>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">7</span>
|
||||||
|
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">8</span>
|
||||||
|
</head>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">9</span>
|
||||||
|
<body>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">10</span>
|
||||||
|
<div class="container">
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">11</span>
|
||||||
|
<h1>Russian Quiz</h1>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">12</span>
|
||||||
|
<div class="score">Prize: <span id="prize">0</span> ₽</div>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">13</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">14</span>
|
||||||
|
<div class="question-box">
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">15</span>
|
||||||
|
<div class="question-number">Question <span id="q-number">1</span>/5</div>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">16</span>
|
||||||
|
<div class="question" id="question-text">Loading...</div>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">17</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">18</span>
|
||||||
|
<div class="options" id="options">
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">19</span>
|
||||||
|
<!-- Options go here -->
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">20</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">21</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 3</div>
|
||||||
|
<h3>Add Game Controls (Lines 17-20)</h3>
|
||||||
|
<p>Add the game control elements:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
// 4. Implement game controls and lifelines (line 17-20)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">2</span>
|
||||||
|
<button class="lifeline" onclick="useFiftyFifty()">50:50 Lifeline</button>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">3</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">4</span>
|
||||||
|
<div class="result" id="result"></div>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">5</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">6</span>
|
||||||
|
// 5. Add game over screen UI (line 22-25)
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">7</span>
|
||||||
|
<div class="game-over" id="game-over" style="display: none;">
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">8</span>
|
||||||
|
<h2>Game Over!</h2>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">9</span>
|
||||||
|
<p>You won: <span id="final-prize">0</span> ₽</p>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">10</span>
|
||||||
|
<button onclick="restartGame()">Play Again</button>
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">11</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div class="section-header">Final Steps</div>
|
||||||
|
<div class="section-content">
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 1</div>
|
||||||
|
<h3>Start MongoDB</h3>
|
||||||
|
<p>Make sure MongoDB is running:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
// Start MongoDB service
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">2</span>
|
||||||
|
sudo service mongod start
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 2</div>
|
||||||
|
<h3>Run the Application</h3>
|
||||||
|
<p>Start the Flask application:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
// Run the app
|
||||||
|
</div>
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">2</span>
|
||||||
|
python app.py
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="step">
|
||||||
|
<div class="step-number">STEP 3</div>
|
||||||
|
<h3>Access the Game</h3>
|
||||||
|
<p>Open your browser and go to:</p>
|
||||||
|
<div class="code-block">
|
||||||
|
<div class="code-line">
|
||||||
|
<span class="line-number">1</span>
|
||||||
|
http://localhost:5000/start
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<p>© 2025 Technolyceum. All rights reserved.</p>
|
||||||
|
<p>For support, contact: techsupport@technolyceum.cc</p>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
BIN
quiz_game/__pycache__/app.cpython-313.pyc
Normal file
BIN
quiz_game/__pycache__/app.cpython-313.pyc
Normal file
Binary file not shown.
151
quiz_game/app.py
Normal file
151
quiz_game/app.py
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
from flask import Flask, render_template, request, jsonify, session
|
||||||
|
import json
|
||||||
|
import random
|
||||||
|
from pymongo import MongoClient # Added MongoDB support
|
||||||
|
|
||||||
|
# MongoDB connection
|
||||||
|
MONGO_URI = "mongodb://ai6s3:Student123!@localhost:27017/student_db"
|
||||||
|
client = MongoClient(MONGO_URI)
|
||||||
|
db = client.student_db # Connect to student_db database
|
||||||
|
questions_collection = db.questions # Use questions collection
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
app.secret_key = 'quizimoto_secret_key'
|
||||||
|
|
||||||
|
# Load questions from MongoDB
|
||||||
|
try:
|
||||||
|
questions_data = list(questions_collection.find({}))
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error loading questions from MongoDB: {e}")
|
||||||
|
questions_data = [] # Fallback to empty list if database connection fails
|
||||||
|
|
||||||
|
# Prize structure (15 levels)
|
||||||
|
PRIZE_LEVELS = [
|
||||||
|
100, 200, 300, 500, 1000,
|
||||||
|
2000, 4000, 8000, 16000, 32000,
|
||||||
|
64000, 125000, 250000, 500000, 1000000
|
||||||
|
]
|
||||||
|
|
||||||
|
GUARANTEED_LEVELS = [5, 10] # First and second guaranteed levels
|
||||||
|
|
||||||
|
def get_current_question():
|
||||||
|
"""Get current question data from session"""
|
||||||
|
current_q_index = session.get('current_question', 0)
|
||||||
|
questions = session.get('questions', [])
|
||||||
|
|
||||||
|
if current_q_index >= len(questions):
|
||||||
|
return None
|
||||||
|
|
||||||
|
return questions[current_q_index], current_q_index
|
||||||
|
|
||||||
|
def calculate_guaranteed_prize(current_index):
|
||||||
|
"""Calculate the guaranteed prize based on current question index"""
|
||||||
|
final_score = 0
|
||||||
|
for level in sorted(GUARANTEED_LEVELS, reverse=True):
|
||||||
|
if current_index + 1 >= level:
|
||||||
|
final_score = PRIZE_LEVELS[level - 1] if level <= len(PRIZE_LEVELS) else 0
|
||||||
|
break
|
||||||
|
return final_score
|
||||||
|
|
||||||
|
@app.route('/')
|
||||||
|
def index():
|
||||||
|
return render_template('index.html')
|
||||||
|
|
||||||
|
@app.route('/start')
|
||||||
|
def start_game():
|
||||||
|
# Initialize game session
|
||||||
|
session['score'] = 0
|
||||||
|
session['current_question'] = 0
|
||||||
|
session['lifelines'] = ['fifty_fifty']
|
||||||
|
session['questions'] = random.sample(questions_data, min(15, len(questions_data))) # Select up to 15 random questions
|
||||||
|
return render_template('game.html')
|
||||||
|
|
||||||
|
@app.route('/get_question')
|
||||||
|
def get_question():
|
||||||
|
current_q_index = session.get('current_question', 0)
|
||||||
|
|
||||||
|
# Check if game is over (15 questions answered or no more questions)
|
||||||
|
if current_q_index >= len(session.get('questions', [])) or current_q_index >= 15:
|
||||||
|
return jsonify({
|
||||||
|
"game_over": True,
|
||||||
|
"final_score": session.get('score', 0)
|
||||||
|
})
|
||||||
|
|
||||||
|
question_data = session['questions'][current_q_index]
|
||||||
|
|
||||||
|
return jsonify({
|
||||||
|
"question_number": current_q_index + 1,
|
||||||
|
"question": question_data['question'],
|
||||||
|
"options": question_data['options'],
|
||||||
|
"current_prize": PRIZE_LEVELS[current_q_index] if current_q_index < len(PRIZE_LEVELS) else 1000000,
|
||||||
|
"game_over": False
|
||||||
|
})
|
||||||
|
|
||||||
|
@app.route('/answer', methods=['POST'])
|
||||||
|
def check_answer():
|
||||||
|
data = request.get_json()
|
||||||
|
answer = data.get('answer', '')
|
||||||
|
|
||||||
|
question_info = get_current_question()
|
||||||
|
if not question_info:
|
||||||
|
return jsonify({"error": "No more questions"})
|
||||||
|
|
||||||
|
question_data, current_q_index = question_info
|
||||||
|
correct = answer == question_data['correct_answer']
|
||||||
|
|
||||||
|
if correct:
|
||||||
|
session['current_q_index'] = current_q_index + 1
|
||||||
|
session['score'] = PRIZE_LEVELS[current_q_index] if current_q_index < len(PRIZE_LEVELS) else session.get('score', 0)
|
||||||
|
|
||||||
|
# Check if game is won (15th question answered correctly)
|
||||||
|
game_won = session['current_question'] >= min(15, len(session.get('questions', [])))
|
||||||
|
|
||||||
|
return jsonify({
|
||||||
|
"correct": True,
|
||||||
|
"correct_answer": question_data['correct_answer'],
|
||||||
|
"final_score": session['score'],
|
||||||
|
"game_over": game_won
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
# Game over with last guaranteed prize
|
||||||
|
final_score = calculate_guaranteed_prize(current_q_index)
|
||||||
|
|
||||||
|
return jsonify({
|
||||||
|
"correct": False,
|
||||||
|
"correct_answer": question_data['correct_answer'],
|
||||||
|
"final_score": final_score,
|
||||||
|
"game_over": True
|
||||||
|
})
|
||||||
|
|
||||||
|
@app.route('/lifeline/<lifeline_name>')
|
||||||
|
def use_lifeline(lifeline_name):
|
||||||
|
if lifeline_name != 'fifty_fifty':
|
||||||
|
return jsonify({"error": "Unknown lifeline"})
|
||||||
|
|
||||||
|
if 'fifty_fifty' not in session.get('lifelines', []):
|
||||||
|
return jsonify({"error": "Lifeline already used"})
|
||||||
|
|
||||||
|
question_info = get_current_question()
|
||||||
|
if not question_info:
|
||||||
|
return jsonify({"error": "No current question"})
|
||||||
|
|
||||||
|
# Remove the lifeline from available lifelines
|
||||||
|
session['lifelines'].remove('fifty_fifty')
|
||||||
|
|
||||||
|
question_data, _ = question_info
|
||||||
|
correct_answer = question_data['correct_answer']
|
||||||
|
options = question_data['options']
|
||||||
|
|
||||||
|
# Find indices of wrong answers to remove (we need to remove 2)
|
||||||
|
wrong_indices = [i for i, option in enumerate(options) if option != correct_answer]
|
||||||
|
|
||||||
|
# Randomly select 2 wrong indices to remove
|
||||||
|
indices_to_remove = random.sample(wrong_indices, min(2, len(wrong_indices)))
|
||||||
|
indices_to_remove.sort(reverse=True) # Sort in descending order for safe removal
|
||||||
|
|
||||||
|
return jsonify({
|
||||||
|
"remove_indices": indices_to_remove
|
||||||
|
})
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run(debug=True)
|
||||||
BIN
quiz_game/docs/.DS_Store
vendored
Normal file
BIN
quiz_game/docs/.DS_Store
vendored
Normal file
Binary file not shown.
19
quiz_game/docs/README.md
Normal file
19
quiz_game/docs/README.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Project Documentation
|
||||||
|
|
||||||
|
This directory contains all the documentation for the Millionaire Quiz Game project.
|
||||||
|
|
||||||
|
## Structure
|
||||||
|
|
||||||
|
- [/roles](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/docs/roles) - Role-specific instructions and guidelines for team members
|
||||||
|
- [/technical-specs](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/docs/technical-specs) - Technical specifications and architecture documents
|
||||||
|
|
||||||
|
## Role Documentation
|
||||||
|
|
||||||
|
Each team member has their own instruction file:
|
||||||
|
|
||||||
|
- [Frontend Developer (Inna)](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/docs/roles/frontend-developer-inna.md)
|
||||||
|
- [Backend Developer (Dima)](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/docs/roles/backend-developer-dima.md)
|
||||||
|
- [Database Designer (Danil)](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/docs/roles/database-designer-danil.md)
|
||||||
|
- [Graphics Designer (Artyom)](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/docs/roles/graphics-designer-artyom.md)
|
||||||
|
|
||||||
|
These documents contain step-by-step instructions for implementing various parts of the application.
|
||||||
185
quiz_game/docs/roles/backend-developer-dima.md
Normal file
185
quiz_game/docs/roles/backend-developer-dima.md
Normal file
@@ -0,0 +1,185 @@
|
|||||||
|
DIMA - BACKEND DEVELOPER MISSION
|
||||||
|
Your Role: Game Brain Developer | Your File: app.py
|
||||||
|
|
||||||
|
💡 What You're Building: You're creating the "brain" of the game - all the rules, scoring, and game logic!
|
||||||
|
|
||||||
|
📋 LESSON 1-2: SETUP & PRIZE SYSTEM
|
||||||
|
|
||||||
|
Step 1: Fork and Clone (10 minutes)
|
||||||
|
1. Go to: https://gitea.techshare.cc/technolyceum/ai6-m2
|
||||||
|
2. Click the "Fork" button (creates your copy)
|
||||||
|
3. Copy your forked repository URL
|
||||||
|
4. Open Terminal and type:
|
||||||
|
git clone [YOUR-FORKED-URL-HERE]
|
||||||
|
cd ai6-m2
|
||||||
|
git checkout -b dima-backend-work
|
||||||
|
|
||||||
|
Step 2: Create the Prize Money System (20 minutes)
|
||||||
|
Open app.py and find these lines around line 13:
|
||||||
|
|
||||||
|
# Prize structure (15 levels)
|
||||||
|
PRIZE_LEVELS = [
|
||||||
|
100, 200, 300, 500, 1000,
|
||||||
|
2000, 4000, 8000, 16000, 32000,
|
||||||
|
64000, 125000, 250000, 500000, 1000000
|
||||||
|
]
|
||||||
|
|
||||||
|
This is already implemented! Notice how the prizes increase as the player progresses through the questions.
|
||||||
|
|
||||||
|
Step 3: Review Game Session Management (15 minutes)
|
||||||
|
Look at the [start_game](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/app.py#L42-L48) function (around line 42):
|
||||||
|
|
||||||
|
```python
|
||||||
|
@app.route('/start')
|
||||||
|
def start_game():
|
||||||
|
# Initialize game session
|
||||||
|
session['score'] = 0
|
||||||
|
session['current_question'] = 0
|
||||||
|
session['lifelines'] = ['fifty_fifty']
|
||||||
|
session['questions'] = random.sample(questions_data, min(15, len(questions_data)))
|
||||||
|
return render_template('game.html')
|
||||||
|
```
|
||||||
|
|
||||||
|
This function initializes the game session with:
|
||||||
|
- Starting score of 0
|
||||||
|
- Current question index of 0
|
||||||
|
- One lifeline available: fifty_fifty
|
||||||
|
- A random selection of up to 15 questions from the database
|
||||||
|
|
||||||
|
📋 LESSON 3-4: QUESTION RETRIEVAL & ANSWER VALIDATION
|
||||||
|
|
||||||
|
Step 4: Review Question Retrieval (15 minutes)
|
||||||
|
Check the [get_question](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/app.py#L50-L66) function (around line 50):
|
||||||
|
|
||||||
|
```python
|
||||||
|
@app.route('/get_question')
|
||||||
|
def get_question():
|
||||||
|
current_q_index = session.get('current_question', 0)
|
||||||
|
|
||||||
|
# Check if game is over
|
||||||
|
if current_q_index >= min(15, len(session.get('questions', []))):
|
||||||
|
return jsonify({
|
||||||
|
"game_over": True,
|
||||||
|
"final_score": session.get('score', 0)
|
||||||
|
})
|
||||||
|
|
||||||
|
question_data = session['questions'][current_q_index]
|
||||||
|
|
||||||
|
return jsonify({
|
||||||
|
"question_number": current_q_index + 1,
|
||||||
|
"question": question_data['question'],
|
||||||
|
"options": question_data['options'],
|
||||||
|
"current_prize": PRIZE_LEVELS[current_q_index] if current_q_index < len(PRIZE_LEVELS) else 1000000,
|
||||||
|
"game_over": False
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
This function retrieves the current question and formats it for the frontend.
|
||||||
|
|
||||||
|
Step 5: Review Answer Validation (20 minutes)
|
||||||
|
Look at the [check_answer](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/app.py#L68-L103) function (around line 68):
|
||||||
|
|
||||||
|
```python
|
||||||
|
@app.route('/answer', methods=['POST'])
|
||||||
|
def check_answer():
|
||||||
|
data = request.get_json()
|
||||||
|
answer = data.get('answer', '')
|
||||||
|
|
||||||
|
question_info = get_current_question()
|
||||||
|
if not question_info:
|
||||||
|
return jsonify({"error": "No more questions"})
|
||||||
|
|
||||||
|
question_data, current_q_index = question_info
|
||||||
|
correct = answer == question_data['correct_answer']
|
||||||
|
|
||||||
|
if correct:
|
||||||
|
session['current_question'] = current_q_index + 1
|
||||||
|
session['score'] = PRIZE_LEVELS[current_q_index] if current_q_index < len(PRIZE_LEVELS) else session.get('score', 0)
|
||||||
|
|
||||||
|
# Check if game is won (15th question answered correctly)
|
||||||
|
game_won = session['current_question'] >= min(15, len(session.get('questions', [])))
|
||||||
|
|
||||||
|
return jsonify({
|
||||||
|
"correct": True,
|
||||||
|
"correct_answer": question_data['correct_answer'],
|
||||||
|
"final_score": session['score'],
|
||||||
|
"game_over": game_won
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
# Game over with last guaranteed prize
|
||||||
|
final_score = calculate_guaranteed_prize(current_q_index)
|
||||||
|
|
||||||
|
return jsonify({
|
||||||
|
"correct": False,
|
||||||
|
"correct_answer": question_data['correct_answer'],
|
||||||
|
"final_score": final_score,
|
||||||
|
"game_over": True
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
Notice the helper functions:
|
||||||
|
- [get_current_question()](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/app.py#L20-L28) - Gets the current question data from session
|
||||||
|
- [calculate_guaranteed_prize()](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/app.py#L30-L37) - Calculates prize based on guaranteed levels
|
||||||
|
|
||||||
|
📋 LESSON 5-6: LIFELINES & REFACTORING
|
||||||
|
|
||||||
|
Step 6: Review Lifeline Implementation (15 minutes)
|
||||||
|
Check the [use_lifeline](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/app.py#L105-L133) function (around line 105):
|
||||||
|
|
||||||
|
```python
|
||||||
|
@app.route('/lifeline/<lifeline_name>')
|
||||||
|
def use_lifeline(lifeline_name):
|
||||||
|
if lifeline_name != 'fifty_fifty':
|
||||||
|
return jsonify({"error": "Unknown lifeline"})
|
||||||
|
|
||||||
|
if 'fifty_fifty' not in session.get('lifelines', []):
|
||||||
|
return jsonify({"error": "Lifeline already used"})
|
||||||
|
|
||||||
|
question_info = get_current_question()
|
||||||
|
if not question_info:
|
||||||
|
return jsonify({"error": "No current question"})
|
||||||
|
|
||||||
|
# Remove the lifeline from available lifelines
|
||||||
|
session['lifelines'].remove('fifty_fifty')
|
||||||
|
|
||||||
|
question_data, _ = question_info
|
||||||
|
correct_answer = question_data['correct_answer']
|
||||||
|
options = question_data['options']
|
||||||
|
|
||||||
|
# Find indices of wrong answers to remove (we need to remove 2)
|
||||||
|
wrong_indices = [i for i, option in enumerate(options) if option != correct_answer]
|
||||||
|
|
||||||
|
# Randomly select 2 wrong indices to remove
|
||||||
|
indices_to_remove = random.sample(wrong_indices, min(2, len(wrong_indices)))
|
||||||
|
indices_to_remove.sort(reverse=True) # Sort in descending order for safe removal
|
||||||
|
|
||||||
|
return jsonify({
|
||||||
|
"remove_indices": indices_to_remove
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
Notice the improvements:
|
||||||
|
- Uses list comprehension for finding wrong indices
|
||||||
|
- Uses helper functions to reduce code duplication
|
||||||
|
- Has clear error handling
|
||||||
|
|
||||||
|
## Database Configuration
|
||||||
|
|
||||||
|
The application should connect to the MongoDB database using the following connection string:
|
||||||
|
```python
|
||||||
|
MONGO_URI = "mongodb://ai6s3:Student123!@localhost:27017/student_db"
|
||||||
|
```
|
||||||
|
|
||||||
|
This connection string should be set in the application's configuration file or environment variables.
|
||||||
|
|
||||||
|
✅ DIMA'S COMPLETION CHECKLIST
|
||||||
|
☐ Understand the prize system structure
|
||||||
|
☐ Review game session initialization
|
||||||
|
☐ Understand question retrieval logic
|
||||||
|
☐ Review answer validation process
|
||||||
|
☐ Understand lifeline implementation
|
||||||
|
☐ Recognize the use of helper functions for DRY code
|
||||||
|
☐ All code pushed to your branch
|
||||||
|
☐ Created Pull Request for teacher to review
|
||||||
|
|
||||||
|
🎉 Congratulations Dima! You built the entire game backend!
|
||||||
100
quiz_game/docs/roles/database-designer-danil.md
Normal file
100
quiz_game/docs/roles/database-designer-danil.md
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
DANIL - DATABASE DESIGNER MISSION
|
||||||
|
Your Role: Question Master | Your File: questions.json
|
||||||
|
|
||||||
|
💡 What You're Building: You're creating all the quiz questions about Russian culture!
|
||||||
|
|
||||||
|
📋 LESSON 1-2: SETUP & BASIC QUESTIONS
|
||||||
|
|
||||||
|
Step 1: Fork and Clone (10 minutes)
|
||||||
|
1. Go to: https://gitea.techshare.cc/technolyceum/ai6-m2
|
||||||
|
2. Click the "Fork" button (creates your copy)
|
||||||
|
3. Copy your forked repository URL
|
||||||
|
4. Open Terminal and type:
|
||||||
|
git clone [YOUR-FORKED-URL-HERE]
|
||||||
|
cd ai6-m2
|
||||||
|
git checkout -b danil-database-work
|
||||||
|
|
||||||
|
Step 2: Review the Question Format (10 minutes)
|
||||||
|
Open questions.json and look at the example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"question": "What is the capital of Russia?",
|
||||||
|
"options": ["St. Petersburg", "Moscow", "Kazan", "Sochi"],
|
||||||
|
"correct_answer": "Moscow"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"question": "Which Russian author wrote 'War and Peace'?",
|
||||||
|
"options": ["Dostoevsky", "Tolstoy", "Pushkin", "Chekhov"],
|
||||||
|
"correct_answer": "Tolstoy"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
Each question needs:
|
||||||
|
- question: The actual question text
|
||||||
|
- options: 4 possible answers (A, B, C, D)
|
||||||
|
- correct_answer: The right answer (must match exactly one of the options)
|
||||||
|
|
||||||
|
Step 3: Understand the Current Implementation (15 minutes)
|
||||||
|
Notice that the current implementation:
|
||||||
|
- Has properly formatted JSON (no comments)
|
||||||
|
- Has 5 sample questions about Russian culture
|
||||||
|
- Follows the correct structure for integration with the backend
|
||||||
|
|
||||||
|
📋 LESSON 3-4: EXPANDING THE DATABASE
|
||||||
|
|
||||||
|
Step 4: Add More Questions (30 minutes)
|
||||||
|
Add at least 10 more questions to reach a total of 15. Here are some examples:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"question": "What is the traditional Russian soup made with beets?",
|
||||||
|
"options": ["Shchi", "Borscht", "Solyanka", "Ukha"],
|
||||||
|
"correct_answer": "Borscht"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"question": "Which Russian ruler was known as 'The Terrible'?",
|
||||||
|
"options": ["Peter I", "Catherine II", "Ivan IV", "Nicholas II"],
|
||||||
|
"correct_answer": "Ivan IV"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"question": "What is the name of the famous Russian ballet company?",
|
||||||
|
"options": ["Moscow Ballet", "St. Petersburg Ballet", "Bolshoi Ballet", "Russian National Ballet"],
|
||||||
|
"correct_answer": "Bolshoi Ballet"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Requirements for new questions:
|
||||||
|
- Make sure questions cover different aspects of Russian culture (history, literature, food, arts, geography)
|
||||||
|
- Ensure plausible wrong answers that are not obviously incorrect
|
||||||
|
- Verify that the correct_answer exactly matches one of the options
|
||||||
|
|
||||||
|
## MongoDB Connection Instructions
|
||||||
|
|
||||||
|
To connect to the MongoDB database:
|
||||||
|
- URL: `mongodb://ai6s3:Student123!@localhost:27017/student_db`
|
||||||
|
- Username: `ai6s3`
|
||||||
|
- Password: `Student123!`
|
||||||
|
- Database: `student_db`
|
||||||
|
|
||||||
|
To import your JSON data:
|
||||||
|
1. Save your JSON data in a file named `data.json`
|
||||||
|
2. Run the following command in terminal:
|
||||||
|
```bash
|
||||||
|
mongoimport --uri="mongodb://ai6s3:Student123!@localhost:27017/student_db" --collection=questions --type=json --file=data.json --jsonArray
|
||||||
|
```
|
||||||
|
|
||||||
|
Make sure your JSON data format matches the expected schema for the application.
|
||||||
|
|
||||||
|
✅ DANIL'S COMPLETION CHECKLIST
|
||||||
|
☐ Understand the question format
|
||||||
|
☐ Review current implementation
|
||||||
|
☐ Add 10+ more questions about Russian culture
|
||||||
|
☐ Verify all questions follow the correct structure
|
||||||
|
☐ Check that correct_answer matches exactly one option
|
||||||
|
☐ All code pushed to your branch
|
||||||
|
☐ Created Pull Request for teacher to review
|
||||||
|
|
||||||
|
🎉 Congratulations Danil! You built the entire question database!
|
||||||
225
quiz_game/docs/roles/frontend-developer-inna.md
Normal file
225
quiz_game/docs/roles/frontend-developer-inna.md
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
INNA - FRONTEND DEVELOPER MISSION
|
||||||
|
Your Role: Game Interface Designer | Your Files: templates/ and static/script.js
|
||||||
|
|
||||||
|
💡 What You're Building: You're creating what players see and click on!
|
||||||
|
|
||||||
|
📋 LESSON 1-2: SETUP & BASIC GAME FLOW
|
||||||
|
|
||||||
|
Step 1: Fork and Clone (10 minutes)
|
||||||
|
1. Go to: https://gitea.techshare.cc/technolyceum/ai6-m2
|
||||||
|
2. Click the "Fork" button (creates your copy)
|
||||||
|
3. Copy your forked repository URL
|
||||||
|
4. Open Terminal and type:
|
||||||
|
git clone [YOUR-FORKED-URL-HERE]
|
||||||
|
cd ai6-m2
|
||||||
|
git checkout -b inna-frontend-work
|
||||||
|
|
||||||
|
Step 2: Review Question Loading (15 minutes)
|
||||||
|
Open static/script.js and look at the [loadQuestion](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/static/script.js#L9-L19) function:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
function loadQuestion() {
|
||||||
|
apiRequest('/get_question')
|
||||||
|
.then(data => {
|
||||||
|
if (data.game_over) {
|
||||||
|
endGame(data.final_score);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentQuestion = data;
|
||||||
|
displayQuestion(data);
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error:', error));
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Notice how it uses the [apiRequest](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/static/script.js#L5-L12) utility function for cleaner code.
|
||||||
|
|
||||||
|
Step 3: Review Question Display (15 minutes)
|
||||||
|
Look at the [displayQuestion](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/static/script.js#L21-L41) function:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
function displayQuestion(data) {
|
||||||
|
updateElementText('q-number', data.question_number);
|
||||||
|
updateElementText('question-text', data.question);
|
||||||
|
updateElementText('prize', data.current_prize);
|
||||||
|
|
||||||
|
const optionsContainer = document.getElementById('options');
|
||||||
|
optionsContainer.innerHTML = '';
|
||||||
|
|
||||||
|
data.options.forEach((option, index) => {
|
||||||
|
const optionElement = document.createElement('div');
|
||||||
|
optionElement.className = 'option';
|
||||||
|
optionElement.textContent = option;
|
||||||
|
optionElement.onclick = () => selectAnswer(option);
|
||||||
|
optionsContainer.appendChild(optionElement);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Reset result display
|
||||||
|
toggleElementVisibility('result', false);
|
||||||
|
const result = document.getElementById('result');
|
||||||
|
if (result) {
|
||||||
|
result.className = 'result';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Notice the utility functions:
|
||||||
|
- [updateElementText()](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/static/script.js#L14-L19) - Simplifies updating element text
|
||||||
|
- [toggleElementVisibility()](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/static/script.js#L21-L27) - Standardizes showing/hiding elements
|
||||||
|
|
||||||
|
📋 LESSON 3-4: ANSWER HANDLING & LIFELINES
|
||||||
|
|
||||||
|
Step 4: Review Answer Selection (15 minutes)
|
||||||
|
Check the [selectAnswer](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/static/script.js#L43-L72) function:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
function selectAnswer(answer) {
|
||||||
|
apiRequest('/answer', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {'Content-Type': 'application/json'},
|
||||||
|
body: JSON.stringify({ answer: answer })
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
const result = document.getElementById('result');
|
||||||
|
if (result) {
|
||||||
|
result.style.display = 'block';
|
||||||
|
|
||||||
|
if (data.correct) {
|
||||||
|
result.textContent = 'Correct!';
|
||||||
|
result.className = 'result correct';
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
if (data.game_over) {
|
||||||
|
endGame(data.final_score);
|
||||||
|
} else {
|
||||||
|
loadQuestion();
|
||||||
|
}
|
||||||
|
}, 1500);
|
||||||
|
} else {
|
||||||
|
result.textContent = `Wrong! Correct answer: ${data.correct_answer}`;
|
||||||
|
result.className = 'result incorrect';
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
endGame(data.final_score);
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error:', error));
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Step 5: Review Lifeline Implementation (15 minutes)
|
||||||
|
Look at the [useFiftyFifty](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/static/script.js#L74-L100) function:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
function useFiftyFifty() {
|
||||||
|
const lifelineBtn = document.querySelector('.lifeline');
|
||||||
|
if (lifelineBtn) {
|
||||||
|
lifelineBtn.disabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
apiRequest('/lifeline/fifty_fifty')
|
||||||
|
.then(data => {
|
||||||
|
if (data.error) {
|
||||||
|
alert(data.error);
|
||||||
|
if (lifelineBtn) {
|
||||||
|
lifelineBtn.disabled = false;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide two wrong options
|
||||||
|
const options = document.querySelectorAll('.option');
|
||||||
|
data.remove_indices.forEach(index => {
|
||||||
|
if (options[index]) {
|
||||||
|
options[index].style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error:', error);
|
||||||
|
if (lifelineBtn) {
|
||||||
|
lifelineBtn.disabled = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Notice the improvements:
|
||||||
|
- Uses the [apiRequest](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/static/script.js#L5-L12) utility function
|
||||||
|
- Has proper error handling with element checks
|
||||||
|
- Cleaner, more maintainable code
|
||||||
|
|
||||||
|
Step 6: Review Utility Functions (10 minutes)
|
||||||
|
At the top of script.js, notice the utility functions that make the code DRY:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Utility function for making API requests
|
||||||
|
function apiRequest(url, options = {}) {
|
||||||
|
return fetch(url, options)
|
||||||
|
.then(response => response.json())
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error:', error);
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Utility function for updating element text content
|
||||||
|
function updateElementText(id, text) {
|
||||||
|
const element = document.getElementById(id);
|
||||||
|
if (element) {
|
||||||
|
element.textContent = text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Utility function for showing/hiding elements
|
||||||
|
function toggleElementVisibility(id, show = true) {
|
||||||
|
const element = document.getElementById(id);
|
||||||
|
if (element) {
|
||||||
|
element.style.display = show ? 'block' : 'none';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
📋 LESSON 5-6: GAME FLOW COMPLETION
|
||||||
|
|
||||||
|
Step 7: Review Game End and Restart (10 minutes)
|
||||||
|
Look at the [endGame](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/static/script.js#L102-L108) and [restartGame](file:///Users/home/YandexDisk/TECHNOLYCEUM/ict_repos/ai6-m2/static/script.js#L110-L112) functions:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
function endGame(score) {
|
||||||
|
updateElementText('final-prize', score);
|
||||||
|
toggleElementVisibility('game-over', true);
|
||||||
|
toggleElementVisibility('question-box', false);
|
||||||
|
toggleElementVisibility('lifeline', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
function restartGame() {
|
||||||
|
window.location.href = '/start';
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Notice how they use the utility functions to simplify the code.
|
||||||
|
|
||||||
|
✅ INNA'S COMPLETION CHECKLIST
|
||||||
|
☐ Review question loading implementation
|
||||||
|
☐ Understand question display logic
|
||||||
|
☐ Review answer handling process
|
||||||
|
☐ Understand lifeline implementation
|
||||||
|
☐ Recognize utility functions for DRY code
|
||||||
|
☐ Review game flow completion
|
||||||
|
☐ All code pushed to your branch
|
||||||
|
☐ Created Pull Request for teacher to review
|
||||||
|
|
||||||
|
## Connection Requirements
|
||||||
|
|
||||||
|
The frontend communicates with the backend API, which must be properly configured with the MongoDB connection string:
|
||||||
|
```python
|
||||||
|
MONGO_URI = "mongodb://ai6s3:Student123!@localhost:27017/student_db"
|
||||||
|
```
|
||||||
|
|
||||||
|
Ensure the backend developer has correctly configured this connection string in the application's configuration.
|
||||||
|
|
||||||
|
🎉 Congratulations Inna! You built the entire game interface!
|
||||||
@@ -51,21 +51,21 @@ header {
|
|||||||
|
|
||||||
TYPE THIS instead:
|
TYPE THIS instead:
|
||||||
|
|
||||||
header {
|
/* Keep container styling from current implementation */
|
||||||
text-align: center;
|
.container {
|
||||||
margin-bottom: 30px;
|
background: rgba(255, 255, 255, 0.9);
|
||||||
|
color: #333;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
background: linear-gradient(90deg, #1a2a6c, #b21f1f);
|
border-radius: 10px;
|
||||||
border-radius: 15px;
|
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
||||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
|
margin: 15px 0;
|
||||||
border: 2px solid #fdbb2d;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 3rem;
|
color: #1a237e;
|
||||||
margin-bottom: 10px;
|
text-align: center;
|
||||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
|
font-size: 2.5rem;
|
||||||
color: #fdbb2d;
|
margin: 20px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Save and push:
|
Save and push:
|
||||||
@@ -80,11 +80,20 @@ Find the question-container section.
|
|||||||
|
|
||||||
DELETE these lines:
|
DELETE these lines:
|
||||||
|
|
||||||
.question-container {
|
.question-box {
|
||||||
background: rgba(255, 255, 255, 0.1);
|
background: rgba(255, 255, 255, 0.9);
|
||||||
padding: 20px;
|
color: #333;
|
||||||
|
padding: 15px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
margin-bottom: 20px;
|
margin: 15px 0;
|
||||||
|
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.question {
|
||||||
|
font-size: 1.4rem;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
TYPE THIS instead:
|
TYPE THIS instead:
|
||||||
@@ -122,17 +131,27 @@ Find the option styling.
|
|||||||
DELETE these lines:
|
DELETE these lines:
|
||||||
|
|
||||||
.option {
|
.option {
|
||||||
background: #fdbb2d;
|
background: #2196f3;
|
||||||
color: #1a2a6c;
|
color: white;
|
||||||
padding: 15px;
|
padding: 12px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
margin: 5px 0;
|
||||||
|
transition: background 0.3s;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.option:hover {
|
.option:hover {
|
||||||
background: #e6a923;
|
background: #1976d2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option.correct {
|
||||||
|
background: #4caf50;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option.wrong {
|
||||||
|
background: #f44336;
|
||||||
}
|
}
|
||||||
|
|
||||||
TYPE THIS instead:
|
TYPE THIS instead:
|
||||||
@@ -196,62 +215,42 @@ DELETE these lines:
|
|||||||
|
|
||||||
TYPE THIS instead:
|
TYPE THIS instead:
|
||||||
|
|
||||||
.lifelines {
|
.result.correct {
|
||||||
background: rgba(255, 255, 255, 0.15);
|
background: #c8e6c9;
|
||||||
padding: 20px;
|
color: #2e7d32;
|
||||||
border-radius: 15px;
|
padding: 10px;
|
||||||
border: 1px solid rgba(253, 187, 45, 0.3);
|
border-radius: 5px;
|
||||||
margin-top: 20px;
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lifelines h3 {
|
.result.incorrect {
|
||||||
color: #fdbb2d;
|
background: #ffcdd2;
|
||||||
text-align: center;
|
color: #c62828;
|
||||||
margin-bottom: 15px;
|
padding: 10px;
|
||||||
font-size: 1.3rem;
|
border-radius: 5px;
|
||||||
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lifeline-buttons {
|
.lifeline {
|
||||||
display: flex;
|
background: #ff9800;
|
||||||
gap: 15px;
|
|
||||||
justify-content: center;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lifeline-btn {
|
|
||||||
background: linear-gradient(135deg, #1a2a6c, #2a3a8c);
|
|
||||||
color: white;
|
color: white;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 12px 20px;
|
padding: 12px 20px;
|
||||||
border-radius: 25px;
|
border-radius: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
display: block;
|
||||||
|
margin: 15px auto;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
transition: all 0.3s ease;
|
transition: background 0.3s;
|
||||||
border: 2px solid #fdbb2d;
|
|
||||||
min-width: 120px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.lifeline-btn:hover:not(:disabled) {
|
.lifeline:hover {
|
||||||
background: linear-gradient(135deg, #2a3a8c, #1a2a6c);
|
background: #f57c00;
|
||||||
transform: translateY(-2px);
|
|
||||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.lifeline-btn:disabled {
|
.lifeline:disabled {
|
||||||
background: #666;
|
background: #ccc;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lifeline-result {
|
|
||||||
background: rgba(253, 187, 45, 0.2);
|
|
||||||
padding: 15px;
|
|
||||||
border-radius: 10px;
|
|
||||||
margin-top: 15px;
|
|
||||||
text-align: center;
|
|
||||||
border: 1px solid #fdbb2d;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Step 7: Make Game Over Screen Epic (20 minutes)
|
Step 7: Make Game Over Screen Epic (20 minutes)
|
||||||
@@ -268,46 +267,38 @@ TYPE THIS instead:
|
|||||||
|
|
||||||
.game-over-screen {
|
.game-over-screen {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 40px;
|
padding: 30px;
|
||||||
background: rgba(255, 255, 255, 0.15);
|
background: white;
|
||||||
border-radius: 20px;
|
border-radius: 10px;
|
||||||
border: 3px solid #fdbb2d;
|
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
||||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
|
margin: 15px 0;
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
max-width: 500px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.game-over-screen h2 {
|
.game-over-screen h2 {
|
||||||
font-size: 3rem;
|
color: #d32f2f;
|
||||||
margin-bottom: 20px;
|
font-size: 2rem;
|
||||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.game-over-screen p {
|
.game-over-screen p {
|
||||||
font-size: 1.3rem;
|
font-size: 1.2rem;
|
||||||
margin-bottom: 25px;
|
margin-bottom: 20px;
|
||||||
color: #fdbb2d;
|
color: #333;
|
||||||
font-weight: bold;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.game-over-screen button {
|
.game-over-screen button {
|
||||||
background: linear-gradient(135deg, #1a2a6c, #b21f1f);
|
background: #d32f2f;
|
||||||
color: white;
|
color: white;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 15px 30px;
|
padding: 12px 24px;
|
||||||
border-radius: 25px;
|
border-radius: 5px;
|
||||||
font-size: 1.2rem;
|
font-size: 1rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s ease;
|
transition: background 0.3s;
|
||||||
border: 2px solid #fdbb2d;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.game-over-screen button:hover {
|
.game-over-screen button:hover {
|
||||||
background: linear-gradient(135deg, #b21f1f, #1a2a6c);
|
background: #b71c1c;
|
||||||
transform: translateY(-3px);
|
|
||||||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Final push:
|
Final push:
|
||||||
262
quiz_game/docs/technical-specs/teacher-project-guide.md
Normal file
262
quiz_game/docs/technical-specs/teacher-project-guide.md
Normal file
@@ -0,0 +1,262 @@
|
|||||||
|
# Teacher - Complete Project Manager Guide
|
||||||
|
|
||||||
|
## YOUR ROLES:
|
||||||
|
- Team Lead - Guide students through development
|
||||||
|
- Git Master - Manage repositories and merges
|
||||||
|
- User Tester - Verify all components work
|
||||||
|
- Integration Manager - Combine all student work
|
||||||
|
|
||||||
|
## PROJECT TIMELINE (6 Lessons)
|
||||||
|
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
## LESSON 1-2: SETUP & FOUNDATION
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
### STUDENT GOALS:
|
||||||
|
- Dima: Implement prize money system and game logic in app.py
|
||||||
|
- Danil: Create first 5 Russian culture questions
|
||||||
|
- Inna: Make basic question loading and display work
|
||||||
|
- Artyom: Start Russian color theme in CSS
|
||||||
|
|
||||||
|
### TEACHER TASKS:
|
||||||
|
|
||||||
|
✅ Setup Verification:
|
||||||
|
1. Ensure main repo is ready:
|
||||||
|
https://gitea.techshare.cc/technolyceum/ai6-m2
|
||||||
|
|
||||||
|
2. Verify all students have:
|
||||||
|
- Forked the repository
|
||||||
|
- Created their role-specific branch
|
||||||
|
- Made first commit
|
||||||
|
|
||||||
|
3. Quick Progress Check (Terminal):
|
||||||
|
```bash
|
||||||
|
# Check each student's fork manually in Gitea web interface
|
||||||
|
# Look for 4 branches:
|
||||||
|
# - dima-backend-work
|
||||||
|
# - inna-frontend-work
|
||||||
|
# - danil-database-work
|
||||||
|
# - artyom-graphics-work
|
||||||
|
```
|
||||||
|
|
||||||
|
✅ Individual Progress Checks:
|
||||||
|
```bash
|
||||||
|
# Temporary check for each student:
|
||||||
|
git clone [STUDENT-FORK-URL] temp-check
|
||||||
|
cd temp-check
|
||||||
|
git checkout [THEIR-BRANCH]
|
||||||
|
|
||||||
|
# Dima Check:
|
||||||
|
grep -A 15 "PRIZE_LEVELS" app.py
|
||||||
|
|
||||||
|
# Danil Check:
|
||||||
|
python3 -c "import json; print('Questions:', len(json.load(open('questions.json'))))"
|
||||||
|
|
||||||
|
# Inna Check:
|
||||||
|
grep -c "function" static/script.js
|
||||||
|
|
||||||
|
# Artyom Check:
|
||||||
|
grep -c "background" static/style.css
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
rm -rf temp-check
|
||||||
|
```
|
||||||
|
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
## LESSON 3-4: CORE DEVELOPMENT
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
### STUDENT GOALS:
|
||||||
|
- Dima: Complete game session management and answer validation
|
||||||
|
- Danil: 10+ questions completed
|
||||||
|
- Inna: Answer handling system and lifelines
|
||||||
|
- Artyom: Enhanced question/option styling
|
||||||
|
|
||||||
|
### TEACHER TASKS:
|
||||||
|
|
||||||
|
✅ Code Review Workshop:
|
||||||
|
Show examples of DRY (Don't Repeat Yourself) principles:
|
||||||
|
|
||||||
|
**Before (repetitive code):**
|
||||||
|
```javascript
|
||||||
|
document.getElementById('q-number').textContent = data.question_number;
|
||||||
|
document.getElementById('question-text').textContent = data.question;
|
||||||
|
document.getElementById('prize').textContent = data.current_prize;
|
||||||
|
```
|
||||||
|
|
||||||
|
**After (DRY code with utility functions):**
|
||||||
|
```javascript
|
||||||
|
updateElementText('q-number', data.question_number);
|
||||||
|
updateElementText('question-text', data.question);
|
||||||
|
updateElementText('prize', data.current_prize);
|
||||||
|
```
|
||||||
|
|
||||||
|
✅ Git Workshop:
|
||||||
|
```bash
|
||||||
|
# Help students resolve merge conflicts:
|
||||||
|
git fetch origin
|
||||||
|
git checkout main
|
||||||
|
git pull origin main
|
||||||
|
git checkout [THEIR-BRANCH]
|
||||||
|
git merge main
|
||||||
|
|
||||||
|
# If conflicts occur:
|
||||||
|
# 1. Edit conflicted files
|
||||||
|
# 2. Remove conflict markers
|
||||||
|
# 3. git add .
|
||||||
|
# 4. git commit
|
||||||
|
```
|
||||||
|
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
## LESSON 5-6: INTEGRATION & TESTING
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
### STUDENT GOALS:
|
||||||
|
- Dima: Finalize lifelines and error handling
|
||||||
|
- Danil: Complete 15 questions with difficulty progression
|
||||||
|
- Inna: Complete game flow and end game screens
|
||||||
|
- Artyom: Polish all visual elements and animations
|
||||||
|
|
||||||
|
### FINAL INTEGRATION:
|
||||||
|
|
||||||
|
✅ Integration Steps:
|
||||||
|
1. Merge all branches to main:
|
||||||
|
```bash
|
||||||
|
# On main branch:
|
||||||
|
git merge dima-backend-work
|
||||||
|
git merge danil-database-work
|
||||||
|
git merge inna-frontend-work
|
||||||
|
git merge artyom-graphics-work
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Resolve any conflicts
|
||||||
|
|
||||||
|
3. Test complete game flow:
|
||||||
|
- Start game from index.html
|
||||||
|
- Play through all questions
|
||||||
|
- Test lifelines
|
||||||
|
- Verify scoring system
|
||||||
|
- Check end game states
|
||||||
|
|
||||||
|
✅ Final Testing Checklist:
|
||||||
|
- [ ] All 15 questions load correctly
|
||||||
|
- [ ] Answer validation works
|
||||||
|
- [ ] Scoring system functions properly
|
||||||
|
- [ ] Lifelines function correctly
|
||||||
|
- [ ] Game over states work (win/lose)
|
||||||
|
- [ ] Restart functionality works
|
||||||
|
- [ ] Responsive design on different screens
|
||||||
|
- [ ] No console errors in browser
|
||||||
|
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
## PROJECT ARCHITECTURE OVERVIEW
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
### File Structure:
|
||||||
|
```
|
||||||
|
/ai6-m2
|
||||||
|
├── app.py # Flask backend (Dima)
|
||||||
|
├── questions.json # Question database (Danil)
|
||||||
|
├── static/
|
||||||
|
│ ├── script.js # Frontend logic (Inna)
|
||||||
|
│ └── style.css # Styling (Artyom)
|
||||||
|
├── templates/
|
||||||
|
│ ├── index.html # Landing page
|
||||||
|
│ └── game.html # Game interface
|
||||||
|
├── docs/
|
||||||
|
│ ├── roles/ # Role-specific instructions
|
||||||
|
│ └── technical-specs/ # Technical documentation
|
||||||
|
└── README.md # Project overview
|
||||||
|
```
|
||||||
|
|
||||||
|
### Technical Implementation:
|
||||||
|
|
||||||
|
**Backend (app.py):**
|
||||||
|
- Flask routes for game operations
|
||||||
|
- Session management for game state
|
||||||
|
- JSON data handling for questions
|
||||||
|
- Helper functions for DRY code
|
||||||
|
|
||||||
|
**Frontend (script.js):**
|
||||||
|
- API communication with backend
|
||||||
|
- DOM manipulation for game interface
|
||||||
|
- Utility functions for common operations
|
||||||
|
- Event handling for user interactions
|
||||||
|
|
||||||
|
**Database (questions.json):**
|
||||||
|
- JSON format for easy parsing
|
||||||
|
- Structured question data with options
|
||||||
|
- Correct answer validation
|
||||||
|
|
||||||
|
**Styling (style.css):**
|
||||||
|
- Responsive design principles
|
||||||
|
- Russian-themed color scheme
|
||||||
|
- Component-based styling approach
|
||||||
|
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
## TROUBLESHOOTING GUIDE
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
### Common Issues and Solutions:
|
||||||
|
|
||||||
|
1. **"TypeError: Cannot read properties of undefined"**
|
||||||
|
- Usually caused by API returning error instead of data
|
||||||
|
- Solution: Check backend implementation and JSON formatting
|
||||||
|
|
||||||
|
2. **Lifelines not working**
|
||||||
|
- Check session management for lifeline state
|
||||||
|
- Verify frontend-backend communication
|
||||||
|
|
||||||
|
3. **Scoring issues**
|
||||||
|
- Verify prize structure in backend
|
||||||
|
- Check guaranteed level calculations
|
||||||
|
|
||||||
|
4. **Git merge conflicts**
|
||||||
|
- Use systematic approach to resolve conflicts
|
||||||
|
- Communicate with team members about changes
|
||||||
|
|
||||||
|
### Verification Commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run the application
|
||||||
|
export FLASK_APP=app.py
|
||||||
|
python -m flask run
|
||||||
|
|
||||||
|
# Check for syntax errors
|
||||||
|
python -m py_compile app.py
|
||||||
|
npx eslint static/script.js
|
||||||
|
|
||||||
|
# Validate JSON
|
||||||
|
python -m json.tool questions.json
|
||||||
|
```
|
||||||
|
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
## ASSESSMENT CRITERIA
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
### Technical Skills:
|
||||||
|
- Code quality and organization (20%)
|
||||||
|
- Implementation of requirements (30%)
|
||||||
|
- Problem-solving and debugging (20%)
|
||||||
|
- Git usage and collaboration (15%)
|
||||||
|
- Documentation and comments (15%)
|
||||||
|
|
||||||
|
### Collaboration:
|
||||||
|
- Team communication
|
||||||
|
- Code review participation
|
||||||
|
- Helpfulness to teammates
|
||||||
|
- Integration contribution
|
||||||
|
|
||||||
|
### Final Product:
|
||||||
|
- Game functions without errors
|
||||||
|
- All features implemented
|
||||||
|
- Visually appealing interface
|
||||||
|
- Good user experience
|
||||||
|
|
||||||
|
🎉 Congratulations on completing the Russian Millionaire Quiz Game project!
|
||||||
36
quiz_game/gitea passwords.rtf
Normal file
36
quiz_game/gitea passwords.rtf
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{\rtf1\ansi\ansicpg1252\cocoartf2818
|
||||||
|
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 .SFNS-Regular_wdth_opsz110000_GRAD_wght2580000;}
|
||||||
|
{\colortbl;\red255\green255\blue255;\red19\green21\blue25;\red255\green255\blue255;}
|
||||||
|
{\*\expandedcolortbl;;\cssrgb\c9412\c10980\c12941;\cssrgb\c100000\c100000\c100000;}
|
||||||
|
\paperw11900\paperh16840\margl1440\margr1440\vieww11900\viewh14080\viewkind1
|
||||||
|
\deftab720
|
||||||
|
\pard\pardeftab720\partightenfactor0
|
||||||
|
|
||||||
|
\f0\b\fs32 \cf2 \cb3 \expnd0\expndtw0\kerning0
|
||||||
|
Inna\
|
||||||
|
ai6s4\
|
||||||
|
ai6s4@ict.ru\
|
||||||
|
\pard\pardeftab720\partightenfactor0
|
||||||
|
\cf2 Passwords: Student123!\
|
||||||
|
\
|
||||||
|
\cf2 \
|
||||||
|
\pard\pardeftab720\partightenfactor0
|
||||||
|
\cf2 Daniel\
|
||||||
|
ai6s3\
|
||||||
|
ai6s3@ict.ru\
|
||||||
|
\pard\pardeftab720\partightenfactor0
|
||||||
|
\cf2 Passwords: Student123!\cf2 \
|
||||||
|
\pard\pardeftab720\partightenfactor0
|
||||||
|
\cf2 \
|
||||||
|
\
|
||||||
|
Artyom\
|
||||||
|
ai6s2\
|
||||||
|
ai6s2@ict.ru\
|
||||||
|
\pard\pardeftab720\partightenfactor0
|
||||||
|
\cf2 Passwords: Student123!\cf2 \
|
||||||
|
\pard\pardeftab720\partightenfactor0
|
||||||
|
\cf2 \
|
||||||
|
Dima\
|
||||||
|
ai6s1\
|
||||||
|
ai6s1@ict.ru\
|
||||||
|
Passwords: Student123!}
|
||||||
27
quiz_game/questions.json
Normal file
27
quiz_game/questions.json
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"question": "What is the capital of Russia?",
|
||||||
|
"options": ["St. Petersburg", "Moscow", "Kazan", "Sochi"],
|
||||||
|
"correct_answer": "Moscow"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"question": "Which Russian author wrote 'War and Peace'?",
|
||||||
|
"options": ["Dostoevsky", "Tolstoy", "Pushkin", "Chekhov"],
|
||||||
|
"correct_answer": "Tolstoy"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"question": "What is the traditional Russian soup made with beets?",
|
||||||
|
"options": ["Shchi", "Borscht", "Solyanka", "Ukha"],
|
||||||
|
"correct_answer": "Borscht"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"question": "Which Russian ruler was known as 'The Terrible'?",
|
||||||
|
"options": ["Peter I", "Catherine II", "Ivan IV", "Nicholas II"],
|
||||||
|
"correct_answer": "Ivan IV"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"question": "What is the name of the famous Russian ballet company?",
|
||||||
|
"options": ["Moscow Ballet", "St. Petersburg Ballet", "Bolshoi Ballet", "Russian National Ballet"],
|
||||||
|
"correct_answer": "Bolshoi Ballet"
|
||||||
|
}
|
||||||
|
]
|
||||||
2
quiz_game/requirements.txt
Normal file
2
quiz_game/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# requirements.txt
|
||||||
|
Flask==2.3.3
|
||||||
5
quiz_game/starter_templates/app.py
Normal file
5
quiz_game/starter_templates/app.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
// 1. This file should contain the main application logic
|
||||||
|
// TODO: Implement Flask app setup
|
||||||
|
// TODO: Connect to MongoDB database
|
||||||
|
// TODO: Implement game state management
|
||||||
|
// TODO: Create API endpoints for game functionality
|
||||||
5
quiz_game/starter_templates/docs/README.md
Normal file
5
quiz_game/starter_templates/docs/README.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
// 1. This file should contain project structure documentation
|
||||||
|
// TODO: Describe directory structure
|
||||||
|
// TODO: Document file naming conventions
|
||||||
|
// TODO: Specify documentation standards
|
||||||
|
// TODO: Add contribution guidelines
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
// 1. This file should contain backend API documentation
|
||||||
|
// TODO: Import Flask and PyMongo (line 1-2)
|
||||||
|
from flask import Flask, session, redirect, url_for, request, jsonify
|
||||||
|
from flask_pymongo import PyMongo
|
||||||
|
|
||||||
|
// TODO: Connect to MongoDB database (line 4-6)
|
||||||
|
app = Flask(__name__)
|
||||||
|
app.config['MONGO_URI'] = 'mongodb://localhost:27017/student_db'
|
||||||
|
mongo = PyMongo(app)
|
||||||
|
|
||||||
|
// TODO: Define API endpoint for getting questions (line 8-10)
|
||||||
|
@app.route('/get_question')
|
||||||
|
def get_question():
|
||||||
|
question_num = session.get('current_question', 0)
|
||||||
|
question = mongo.db.questions.find_one({"question_number": question_num})
|
||||||
|
|
||||||
|
if question:
|
||||||
|
return jsonify({
|
||||||
|
"question": question['question'],
|
||||||
|
"options": question['options'],
|
||||||
|
"question_number": question_num,
|
||||||
|
"current_prize": calculate_prize(question_num)
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
return jsonify({"game_over": True, "final_score": calculate_final_score()})
|
||||||
|
|
||||||
|
// TODO: Define API endpoint for submitting answers (line 12-14)
|
||||||
|
@app.route('/answer', methods=['POST'])
|
||||||
|
def answer_question():
|
||||||
|
user_answer = request.json.get('answer')
|
||||||
|
question_num = session.get('current_question', 0)
|
||||||
|
current_question = mongo.db.questions.find_one({"question_number": question_num})
|
||||||
|
|
||||||
|
is_correct = current_question['options'][current_question['correct_answer']] == user_answer
|
||||||
|
|
||||||
|
if is_correct:
|
||||||
|
session['current_question'] = question_num + 1
|
||||||
|
return jsonify({
|
||||||
|
"correct": True,
|
||||||
|
"correct_answer": current_question['correct_answer'],
|
||||||
|
"game_over": question_num + 1 >= TOTAL_QUESTIONS
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
return jsonify({
|
||||||
|
"correct": False,
|
||||||
|
"correct_answer": current_question['correct_answer'],
|
||||||
|
"game_over": True
|
||||||
|
})
|
||||||
|
|
||||||
|
// TODO: Add error handling for database connection (line 16-18)
|
||||||
|
try:
|
||||||
|
mongo.db.command("ping")
|
||||||
|
print("Successfully connected to MongoDB!")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"MongoDB connection error: {e}")
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
// 1. This file should contain database connection information
|
||||||
|
// TODO: Import MongoDB driver (line 1)
|
||||||
|
import pymongo
|
||||||
|
|
||||||
|
// TODO: Connect to MongoDB using the connection URI (line 3-5)
|
||||||
|
client = pymongo.MongoClient("mongodb://localhost:27017/")
|
||||||
|
|
||||||
|
// TODO: Select the appropriate database (line 7)
|
||||||
|
db = client["student_db"]
|
||||||
|
|
||||||
|
// TODO: Select the questions collection (line 9)
|
||||||
|
questions_collection = db["questions"]
|
||||||
|
|
||||||
|
// TODO: Add error handling for database connection (line 11)
|
||||||
|
try:
|
||||||
|
client.admin.command('ping')
|
||||||
|
print("Successfully connected to MongoDB!")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"MongoDB connection error: {e}")
|
||||||
|
|
||||||
|
// 2. Database population instructions (new section)
|
||||||
|
// TODO: Create function to insert questions into database (line 13-25)
|
||||||
|
def insert_questions():
|
||||||
|
questions = [
|
||||||
|
{
|
||||||
|
"question_number": 0,
|
||||||
|
"question": "What is the capital of Russia?",
|
||||||
|
"options": ["Moscow", "Saint Petersburg", "Novosibirsk", "Yekaterinburg"],
|
||||||
|
"correct_answer": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"question_number": 1,
|
||||||
|
"question": "Which river is the longest in Russia?",
|
||||||
|
"options": ["Volga", "Yenisey", "Ob", "Amur"],
|
||||||
|
"correct_answer": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
# Insert questions into collection
|
||||||
|
db.questions.insert_many(questions)
|
||||||
|
print("Questions inserted successfully!")
|
||||||
|
|
||||||
|
// TODO: Call insert_questions function (line 27)
|
||||||
|
if __name__ == "__main__"::
|
||||||
|
insert_questions()
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
// 1. This file should contain frontend implementation instructions
|
||||||
|
|
||||||
|
// TODO: Create HTML structure with game container (line 1-5)
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Russian Quiz</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
// TODO: Add question display elements (line 7-10)
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<h1>Russian Quiz</h1>
|
||||||
|
<div class="score">Prize: <span id="prize">0</span> ₽</div>
|
||||||
|
|
||||||
|
<div class="question-box">
|
||||||
|
<div class="question-number">Question <span id="q-number">1</span>/5</div>
|
||||||
|
<div class="question" id="question-text">Loading...</div>
|
||||||
|
|
||||||
|
<div class="options" id="options">
|
||||||
|
<!-- Options go here -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="result" id="result"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
// TODO: Create answer option buttons (line 12-15)
|
||||||
|
<div class="options" id="options">
|
||||||
|
<!-- Options will be dynamically inserted here -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="lifeline" onclick="useFiftyFifty()">50:50 Lifeline</button>
|
||||||
|
|
||||||
|
// TODO: Implement game controls and lifelines (line 17-20)
|
||||||
|
<div class="game-over" id="game-over" style="display: none;">
|
||||||
|
<h2>Game Over!</h2>
|
||||||
|
<p>You won: <span id="final-prize">0</span> ₽</p>
|
||||||
|
<button onclick="restartGame()">Play Again</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="{{ url_for('static', filename='script.js') }}"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
// TODO: Add game over screen UI (line 22-25)
|
||||||
|
// Game over screen is already included above as part of the main structure
|
||||||
5
quiz_game/starter_templates/static/script.js
Normal file
5
quiz_game/starter_templates/static/script.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
// 1. This file should contain the game logic
|
||||||
|
// TODO: Implement question loading from API
|
||||||
|
// TODO: Implement answer handling
|
||||||
|
// TODO: Implement lifeline functionality
|
||||||
|
// TODO: Add event listeners for game controls
|
||||||
6
quiz_game/starter_templates/static/style.css
Normal file
6
quiz_game/starter_templates/static/style.css
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
/* 1. This file should contain basic styling for the game
|
||||||
|
* TODO: Add styles for game container
|
||||||
|
* TODO: Style question display elements
|
||||||
|
* TODO: Style answer options
|
||||||
|
* TODO: Add styles for game controls and lifelines
|
||||||
|
*/
|
||||||
5
quiz_game/starter_templates/templates/game.html
Normal file
5
quiz_game/starter_templates/templates/game.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
// 1. This file should contain game HTML structure
|
||||||
|
// TODO: Add game container
|
||||||
|
// TODO: Add question display elements
|
||||||
|
// TODO: Add answer options container
|
||||||
|
// TODO: Add game controls and lifelines buttons
|
||||||
5
quiz_game/starter_templates/templates/index.html
Normal file
5
quiz_game/starter_templates/templates/index.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
// 1. This file should contain the main page structure
|
||||||
|
// TODO: Add welcome message
|
||||||
|
// TODO: Add game start button
|
||||||
|
// TODO: Add instructions section
|
||||||
|
// TODO: Add footer with credits
|
||||||
149
quiz_game/static/script.js
Normal file
149
quiz_game/static/script.js
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
// script.js
|
||||||
|
let currentQuestion = null;
|
||||||
|
|
||||||
|
// Utility function for making API requests
|
||||||
|
function apiRequest(url, options = {}) {
|
||||||
|
return fetch(url, options)
|
||||||
|
.then(response => response.json())
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error:', error);
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Utility function for updating element text content
|
||||||
|
function updateElementText(id, text) {
|
||||||
|
const element = document.getElementById(id);
|
||||||
|
if (element) {
|
||||||
|
element.textContent = text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Utility function for showing/hiding elements
|
||||||
|
function toggleElementVisibility(id, show = true) {
|
||||||
|
const element = document.getElementById(id);
|
||||||
|
if (element) {
|
||||||
|
element.style.display = show ? 'block' : 'none';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadQuestion() {
|
||||||
|
apiRequest('/get_question')
|
||||||
|
.then(data => {
|
||||||
|
if (data.game_over) {
|
||||||
|
endGame(data.final_score);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentQuestion = data;
|
||||||
|
displayQuestion(data);
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error:', error));
|
||||||
|
}
|
||||||
|
|
||||||
|
function displayQuestion(data) {
|
||||||
|
updateElementText('q-number', data.question_number);
|
||||||
|
updateElementText('question-text', data.question);
|
||||||
|
updateElementText('prize', data.current_prize);
|
||||||
|
|
||||||
|
const optionsContainer = document.getElementById('options');
|
||||||
|
optionsContainer.innerHTML = '';
|
||||||
|
|
||||||
|
data.options.forEach((option, index) => {
|
||||||
|
const optionElement = document.createElement('div');
|
||||||
|
optionElement.className = 'option';
|
||||||
|
optionElement.textContent = option;
|
||||||
|
optionElement.onclick = () => selectAnswer(option);
|
||||||
|
optionsContainer.appendChild(optionElement);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Reset result display
|
||||||
|
toggleElementVisibility('result', false);
|
||||||
|
const result = document.getElementById('result');
|
||||||
|
if (result) {
|
||||||
|
result.className = 'result';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function selectAnswer(answer) {
|
||||||
|
apiRequest('/answer', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {'Content-Type': 'application/json'},
|
||||||
|
body: JSON.stringify({ answer: answer })
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
const result = document.getElementById('result');
|
||||||
|
if (result) {
|
||||||
|
result.style.display = 'block';
|
||||||
|
|
||||||
|
if (data.correct) {
|
||||||
|
result.textContent = 'Correct!';
|
||||||
|
result.className = 'result correct';
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
if (data.game_over) {
|
||||||
|
endGame(data.final_score);
|
||||||
|
} else {
|
||||||
|
loadQuestion();
|
||||||
|
}
|
||||||
|
}, 1500);
|
||||||
|
} else {
|
||||||
|
result.textContent = `Wrong! Correct answer: ${data.correct_answer}`;
|
||||||
|
result.className = 'result incorrect';
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
endGame(data.final_score);
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error:', error));
|
||||||
|
}
|
||||||
|
|
||||||
|
function useFiftyFifty() {
|
||||||
|
const lifelineBtn = document.querySelector('.lifeline');
|
||||||
|
if (lifelineBtn) {
|
||||||
|
lifelineBtn.disabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
apiRequest('/lifeline/fifty_fifty')
|
||||||
|
.then(data => {
|
||||||
|
if (data.error) {
|
||||||
|
alert(data.error);
|
||||||
|
if (lifelineBtn) {
|
||||||
|
lifelineBtn.disabled = false;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide two wrong options
|
||||||
|
const options = document.querySelectorAll('.option');
|
||||||
|
data.remove_indices.forEach(index => {
|
||||||
|
if (options[index]) {
|
||||||
|
options[index].style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error:', error);
|
||||||
|
if (lifelineBtn) {
|
||||||
|
lifelineBtn.disabled = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function endGame(score) {
|
||||||
|
updateElementText('final-prize', score);
|
||||||
|
toggleElementVisibility('game-over', true);
|
||||||
|
toggleElementVisibility('question-box', false);
|
||||||
|
toggleElementVisibility('lifeline', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
function restartGame() {
|
||||||
|
window.location.href = '/start';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start the game when page loads
|
||||||
|
if (window.location.pathname === '/start') {
|
||||||
|
loadQuestion();
|
||||||
|
}
|
||||||
109
quiz_game/static/style.css
Normal file
109
quiz_game/static/style.css
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
/* style.css */
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 20px;
|
||||||
|
background: #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
background: white;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
color: #1a237e;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.score {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1.2em;
|
||||||
|
margin: 10px 0;
|
||||||
|
color: #d32f2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.question-box {
|
||||||
|
background: #e3f2fd;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.question-number {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.question {
|
||||||
|
font-size: 1.1em;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.options {
|
||||||
|
display: grid;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option {
|
||||||
|
background: #2196f3;
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option:hover {
|
||||||
|
background: #1976d2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option.correct {
|
||||||
|
background: #4caf50;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option.wrong {
|
||||||
|
background: #f44336;
|
||||||
|
}
|
||||||
|
|
||||||
|
.result {
|
||||||
|
margin-top: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
text-align: center;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.result.correct {
|
||||||
|
background: #c8e6c9;
|
||||||
|
color: #2e7d32;
|
||||||
|
}
|
||||||
|
|
||||||
|
.result.incorrect {
|
||||||
|
background: #ffcdd2;
|
||||||
|
color: #c62828;
|
||||||
|
}
|
||||||
|
|
||||||
|
.start-btn, .lifeline {
|
||||||
|
background: #ff9800;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border-radius: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
display: block;
|
||||||
|
margin: 10px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lifeline:disabled {
|
||||||
|
background: #ccc;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-over {
|
||||||
|
text-align: center;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
37
quiz_game/templates/game.html
Normal file
37
quiz_game/templates/game.html
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<!-- game.html -->
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Russian Quiz - Game</title>
|
||||||
|
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<h1>Russian Quiz</h1>
|
||||||
|
<div class="score">Prize: <span id="prize">0</span> ₽</div>
|
||||||
|
|
||||||
|
<div class="question-box">
|
||||||
|
<div class="question-number">Question <span id="q-number">1</span>/5</div>
|
||||||
|
<div class="question" id="question-text">Loading...</div>
|
||||||
|
|
||||||
|
<div class="options" id="options">
|
||||||
|
<!-- Options go here -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="result" id="result"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="lifeline" onclick="useFiftyFifty()">50:50 Lifeline</button>
|
||||||
|
|
||||||
|
<div class="game-over" id="game-over" style="display: none;">
|
||||||
|
<h2>Game Over!</h2>
|
||||||
|
<p>You won: <span id="final-prize">0</span> ₽</p>
|
||||||
|
<button onclick="restartGame()">Play Again</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="{{ url_for('static', filename='script.js') }}"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
23
quiz_game/templates/index.html
Normal file
23
quiz_game/templates/index.html
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<!-- index.html -->
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Russian Quiz Game</title>
|
||||||
|
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<h1>Russian Quiz</h1>
|
||||||
|
<p>Answer questions about Russian culture!</p>
|
||||||
|
<button onclick="startGame()" class="start-btn">Start Game</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function startGame() {
|
||||||
|
window.location.href = '/start';
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1 +0,0 @@
|
|||||||
Flask==2.3.3
|
|
||||||
104
static/script.js
104
static/script.js
@@ -1,104 +0,0 @@
|
|||||||
// TODO: Inna - Implement frontend game functionality
|
|
||||||
|
|
||||||
let gameState = {
|
|
||||||
currentQuestion: null,
|
|
||||||
optionsDisabled: false
|
|
||||||
};
|
|
||||||
|
|
||||||
function loadQuestion() {
|
|
||||||
fetch('/get_question')
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.error) {
|
|
||||||
console.error(data.error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (data.game_over) {
|
|
||||||
endGame(data.final_score);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
gameState.currentQuestion = data;
|
|
||||||
displayQuestion(data);
|
|
||||||
})
|
|
||||||
.catch(error => console.error('Error:', error));
|
|
||||||
}
|
|
||||||
|
|
||||||
function displayQuestion(questionData) {
|
|
||||||
document.getElementById('question-num').textContent = questionData.question_number;
|
|
||||||
document.getElementById('question-text').textContent = questionData.question;
|
|
||||||
|
|
||||||
const optionsContainer = document.getElementById('options-container');
|
|
||||||
optionsContainer.innerHTML = '';
|
|
||||||
|
|
||||||
const optionLetters = ['A', 'B', 'C', 'D'];
|
|
||||||
questionData.options.forEach((option, index) => {
|
|
||||||
const optionElement = document.createElement('div');
|
|
||||||
optionElement.className = 'option';
|
|
||||||
optionElement.textContent = `${optionLetters[index]}. ${option}`;
|
|
||||||
optionElement.onclick = () => selectAnswer(option);
|
|
||||||
optionsContainer.appendChild(optionElement);
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById('feedback').style.display = 'none';
|
|
||||||
gameState.optionsDisabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectAnswer(selectedAnswer) {
|
|
||||||
if (gameState.optionsDisabled) return;
|
|
||||||
gameState.optionsDisabled = true;
|
|
||||||
|
|
||||||
fetch('/answer', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {'Content-Type': 'application/json'},
|
|
||||||
body: JSON.stringify({ answer: selectedAnswer })
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
const feedback = document.getElementById('feedback');
|
|
||||||
feedback.style.display = 'block';
|
|
||||||
|
|
||||||
if (data.correct) {
|
|
||||||
feedback.textContent = 'Correct! 🎉';
|
|
||||||
feedback.className = 'feedback correct';
|
|
||||||
setTimeout(() => {
|
|
||||||
if (data.next_question) loadQuestion();
|
|
||||||
else endGame(data.final_score, true);
|
|
||||||
}, 1500);
|
|
||||||
} else {
|
|
||||||
feedback.textContent = `Incorrect! Correct answer: ${data.correct_answer}`;
|
|
||||||
feedback.className = 'feedback incorrect';
|
|
||||||
setTimeout(() => endGame(data.final_score), 2000);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => console.error('Error:', error));
|
|
||||||
}
|
|
||||||
|
|
||||||
function useLifeline(lifelineName) {
|
|
||||||
fetch(`/lifeline/${lifelineName}`)
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.error) {
|
|
||||||
alert(data.error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
document.getElementById('lifeline-result').textContent =
|
|
||||||
data.hint || data.friend_says || 'Lifeline used!';
|
|
||||||
})
|
|
||||||
.catch(error => console.error('Error:', error));
|
|
||||||
}
|
|
||||||
|
|
||||||
function endGame(finalScore, isWin = false) {
|
|
||||||
document.getElementById('final-prize').textContent = finalScore;
|
|
||||||
document.getElementById('game-over-screen').style.display = 'block';
|
|
||||||
document.querySelector('.game-area').style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
function restartGame() {
|
|
||||||
window.location.href = '/start';
|
|
||||||
}
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
|
||||||
if (window.location.pathname === '/start') {
|
|
||||||
loadQuestion();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
105
static/style.css
105
static/style.css
@@ -1,105 +0,0 @@
|
|||||||
/* TODO: Artyom - Enhance this CSS with Russian-themed design */
|
|
||||||
* {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background: #1a2a6c;
|
|
||||||
color: white;
|
|
||||||
min-height: 100vh;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container {
|
|
||||||
max-width: 800px;
|
|
||||||
margin: 0 auto;
|
|
||||||
background: rgba(255, 255, 255, 0.1);
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
header {
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
padding: 15px;
|
|
||||||
background: #b21f1f;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 2.5rem;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.question-container {
|
|
||||||
background: rgba(255, 255, 255, 0.1);
|
|
||||||
padding: 20px;
|
|
||||||
border-radius: 8px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.question {
|
|
||||||
font-size: 1.3rem;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.options-container {
|
|
||||||
display: grid;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.option {
|
|
||||||
background: #fdbb2d;
|
|
||||||
color: #1a2a6c;
|
|
||||||
padding: 15px;
|
|
||||||
border-radius: 5px;
|
|
||||||
cursor: pointer;
|
|
||||||
text-align: center;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.option:hover {
|
|
||||||
background: #e6a923;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lifelines {
|
|
||||||
background: rgba(255, 255, 255, 0.1);
|
|
||||||
padding: 15px;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lifeline-buttons {
|
|
||||||
display: flex;
|
|
||||||
gap: 10px;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lifeline-btn {
|
|
||||||
background: #1a2a6c;
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
padding: 10px 15px;
|
|
||||||
border-radius: 5px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.start-btn {
|
|
||||||
background: #fdbb2d;
|
|
||||||
color: #1a2a6c;
|
|
||||||
border: none;
|
|
||||||
padding: 15px 30px;
|
|
||||||
border-radius: 25px;
|
|
||||||
font-size: 1.2rem;
|
|
||||||
cursor: pointer;
|
|
||||||
display: block;
|
|
||||||
margin: 20px auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.game-over-screen {
|
|
||||||
text-align: center;
|
|
||||||
padding: 30px;
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Quizimoto - Game</title>
|
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<header>
|
|
||||||
<h1>Quizimoto</h1>
|
|
||||||
<div class="score-display">Prize: <span id="current-prize">0</span> ₽</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div class="game-area">
|
|
||||||
<div class="question-container">
|
|
||||||
<div class="question-number">Question <span id="question-num">1</span>/15</div>
|
|
||||||
<div class="question" id="question-text">Loading question...</div>
|
|
||||||
|
|
||||||
<div class="options-container" id="options-container">
|
|
||||||
<!-- Options will be loaded by JavaScript -->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="feedback" id="feedback"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="lifelines">
|
|
||||||
<h3>Lifelines</h3>
|
|
||||||
<div class="lifeline-buttons">
|
|
||||||
<button class="lifeline-btn" onclick="useLifeline('fifty_fifty')">50:50</button>
|
|
||||||
<button class="lifeline-btn" onclick="useLifeline('phone_friend')">Phone a Friend</button>
|
|
||||||
</div>
|
|
||||||
<div id="lifeline-result" class="lifeline-result"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="game-over-screen" id="game-over-screen" style="display: none;">
|
|
||||||
<h2>Game Over!</h2>
|
|
||||||
<p>Your final prize: <span id="final-prize">0</span> ₽</p>
|
|
||||||
<button onclick="restartGame()">Play Again</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="{{ url_for('static', filename='script.js') }}"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Quizimoto - Russian Millionaire Quiz</title>
|
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<header>
|
|
||||||
<h1>Quizimoto</h1>
|
|
||||||
<p>Russian Millionaire Quiz Game</p>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div class="welcome-content">
|
|
||||||
<h2>Welcome!</h2>
|
|
||||||
<p>Test your knowledge of Russian culture and win up to 1,000,000 ₽!</p>
|
|
||||||
|
|
||||||
<button onclick="startGame()" class="start-btn">Start Game</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function startGame() {
|
|
||||||
window.location.href = '/start';
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Reference in New Issue
Block a user