Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"build-js": "esbuild school/bundle.js --bundle --minify --outfile=./school/static/bundle.js"
},
"dependencies": {
"@tailwindcss/cli": "^4.3.0",
"@tailwindcss/cli": "^4.3.1",
"@tailwindcss/forms": "^0.5.11",
"@tailwindcss/typography": "^0.5.19",
"@tailwindcss/typography": "^0.5.20",
"alpinejs": "^3.15.12",
"esbuild": "^0.25.12",
"feather-icons": "^4.29.2",
"htmx.org": "^1.9.12",
"iconify-icon": "^1.0.8",
"tailwindcss": "^4.3.0",
"tailwindcss": "^4.3.1",
"tippy.js": "^6.3.7"
}
}
338 changes: 192 additions & 146 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
allowBuilds:
'@parcel/watcher': false
core-js: false
esbuild: false
4 changes: 2 additions & 2 deletions school/courses/templates/courses/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<div>
<a href="{% url "course_list" %}" class="items-center inline-flex text-blue-300 gap-1 mb-4 hover:text-blue-400 hover:underline"><i data-feather="arrow-left" class="w-4 h-4"></i> Späť na zoznam kurzov</a>

<h1 class="tracking-tight text-3xl text-white font-bold lg:text-5xl">{{ course.name|markdownify }}</h1>
<div class="mt-2 lg:mt-4 prose prose-invert max-w-none">
{{ course.description|markdownify }}
Expand All @@ -28,7 +28,7 @@ <h1 class="tracking-tight text-3xl text-white font-bold lg:text-5xl">{{ course.n
{% with course.recommended_courses.all as next %}
{% if next|length %}
<p class="mt-2">
Asi sa pýtaš, čo ďalej, a my to vieme. Môžeš pokračovať týmito kurzami:
Asi sa pýtaš, čo ďalej... a my to vieme. Môžeš pokračovať napríklad týmito kurzami:
</p>
<ul class="list-inside list-disc mt-2 ml-4">
{% for course in next %}
Expand Down
43 changes: 14 additions & 29 deletions school/courses/templates/courses/lesson.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{% load percent %}
{% load submits %}
{% load markdownify %}
{% load tags %}

{% block title %}{{ item.name }} {{ block.super }}{% endblock %}

Expand Down Expand Up @@ -35,10 +36,20 @@
{% for it in items %}
<li>
<a href="{% url 'lesson' lesson.course.slug lesson.slug it.item.slug %}" class="flex gap-1.5 items-center {% if item == it.item %}text-white font-bold{% endif %}">
<i data-feather="{% if it.item.problem %}code{% else %}file-text{% endif %}" class="w-4 h-4 shrink-0"></i>

{% if it.item.problem %}
{% if item == it.item %}
{% render_icon it.item.problem.difficulty_tag icon="code" highlighted=True %}
{% else %}
{% render_icon it.item.problem.difficulty_tag icon="code" %}
{% endif %}
{% else %}
<i data-feather="{% if it.item.problem %}code{% else %}file-text{% endif %}" class="size-4 shrink-0"></i>
{% endif %}

{{ it.item.name|markdownify }}


{% if it.tracker and it.tracker.state == it.tracker.state.COMPLETE %}
<i data-feather="check" class="ml-auto w-4 h-4 text-green-500 shrink-0"></i>
{% endif %}
Expand Down Expand Up @@ -72,33 +83,7 @@
</div>
{% endif %}
{% elif item.problem %}
<div class="mb-5">
<b>Tagy: </b>
{% for tag in item.problem.tags.all %}
<span class="bg-blue-900 rounded-md p-2 m-1">
{{ tag }}
</span>
{% endfor %}
</div>
<div class="mb-5">
{% if item.problem.difficulty == item.problem.ProblemDifficulty.EASY %}
<b>Obtiažnosť:</b>
<span class="bg-green-900 rounded-md p-2 m-1" data-tippy-content="Úloha by mala byť zvládnuteľná bez väčších problémov.">
easy
</span>
{% elif item.problem.difficulty == item.problem.ProblemDifficulty.MEDIUM %}
<b>Obtiažnosť:</b>
<span class="bg-orange-900 rounded-md p-2 m-1" data-tippy-content="Úloha nemusí mať úplne priamočiare riešenie.">
medium
</span>
{% elif item.problem.difficulty == item.problem.ProblemDifficulty.HARD %}
<b>Obtiažnosť:</b>
<span class="bg-red-900 rounded-md p-2 m-1" data-tippy-content="Úloha vyžaduje pokročilé vedomosti z iných kurzov.">
hard
</span>
{% endif %}
</div>
{{ item.problem.content|markdownify }}
{% include "problems/_partials/problem_statement.html" with problem=item.problem %}
{% endif %}
</div>

Expand All @@ -122,7 +107,7 @@ <h2 class="text-white font-bold text-2xl mt-10 mb-4">Posledné submity</h2>
{% endif %}
{% else %}
<div class="w-full rounded-md px-4 py-3 bg-red-900 border border-red-600 text-white">
Ak chceš riešiť túto úlohu, musíš sa najprv <a href="{% url 'oidc_authentication_init' %}" class="underline hover:text-red-300">prihlásiť</a>.
Ak chceš odovzdať riešenie tejto úlohy, musíš sa najskôr <a href="{% url 'oidc_authentication_init' %}" class="underline hover:text-red-300">prihlásiť</a>.
</div>
{% endif %}
</div>
Expand Down
6 changes: 3 additions & 3 deletions school/courses/templates/courses/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

{% block body %}
<div class="container mx-auto flex flex-col lg:flex-row py-10 lg:py-16 px-6 lg:items-center">
<div class="lg:max-w-lg">
<div class="lg:max-w-2xl">
<h1 class="tracking-tight text-3xl text-white font-bold lg:text-5xl">Zoznam kurzov</h1>
<p class="mt-6 text-gray-400">
Na tejto stránke sa nachádza zoznam kurzov.
Neskoršie kurzy nadväzujú na poznatky z predchádzajúcich,
preto ich odporúčame absolvovať po poradí.
Pokročilé kurzy predpokladajú znalosti základov,
preto ich odporúčame absolvovať v uvedenom poradí.
</p>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions school/imports/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import frontmatter
from django.conf import settings
from django.db import transaction
from django.http import HttpRequest, JsonResponse
from django.utils.decorators import method_decorator
from django.views import View
Expand All @@ -15,6 +16,7 @@

@method_decorator(csrf_exempt, name="dispatch")
class ImportView(View):
@transaction.atomic()
def dispatch(self, request: HttpRequest, *args, **kwargs):
token = request.headers.get("X-Token", None)
if token != settings.SCHOOL_IMPORT_TOKEN:
Expand Down
2 changes: 1 addition & 1 deletion school/imports/views/courses.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def post(self, request, *args, **kwargs):
if problem is None:
return JsonResponse(
{
"errors": f"Problem '{item['material']}' don't exist.'",
"errors": f"Problem '{item['problem']}' don't exist.'",
"ok": False,
},
status=400,
Expand Down
26 changes: 13 additions & 13 deletions school/pages/templates/pages/home.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'common/base.html' %}
{% load static %}

{% block title %}KSP School &ndash; Online výučba programovania{% endblock %}
{% block title %}KSP School &ndash; Online škola programovania{% endblock %}

{% block meta %}
<meta name="description"
Expand All @@ -14,7 +14,7 @@
<div class="lg:max-w-lg">
<h1 class="tracking-tight text-3xl text-white font-bold lg:text-7xl">Chceš kódiť jak ďábel?</h1>
<p class="mt-6 text-gray-400 lg:text-xl">
KSP School obsahuje texty a úlohy,
KSP School obsahuje materiály a úlohy,
pomocou ktorých sa naučíš programovať aj ty!
</p>
<a href="{% url "course_list" %}" class="inline-block px-4 py-2 mt-6 text-xl font-medium text-white bg-blue-600 hover:bg-blue-500 rounded-md">Poďme na to!</a>
Expand All @@ -30,26 +30,26 @@ <h1 class="tracking-tight text-3xl text-white font-bold lg:text-7xl">Chceš kód
<div class="w-full lg:w-1/2 text-justify">
<h2 class="text-2xl font-bold text-white lg:text-4xl">Učebné materiály</h2>
<p class="mt-4">
V KSP School nájdeš množstvo učebných textov o rôznych témach z informatiky,
ktoré posunú tvoju úroveň programovania na ďalší level.
V KSP School nájdeš množstvo učebných textov z rôznych informatický tém,
ktoré ti vysvetlia nielen základy programovania, ale aj algoritmy a dátové štruktúry, ktoré by mal každý správny programátor poznať.
</p>

<div class="mt-8 space-y-6">
<div class="relative pl-9">
<iconify-icon icon="devicon-plain:python" class="absolute left-1 top-0.5 text-blue-500" width="1.25rem"></iconify-icon>
<b class="text-white mr-2">Python</b>
Či už si nikdy neprogramoval/a, alebo máš veci ako lambda funkcie a dedičnosť v malíčku, máme niečo pre každého.
Nemáš s programovaním zatiaľ žiadne skúsenosti? Alebo máš veci ako lambda funkcie a dedičnosť v malíčku? V Pythone sa nájde niečo pre každého.
</div>
<div class="relative pl-9">
<iconify-icon icon="devicon-plain:cplusplus" class="absolute left-1 top-0.5 text-blue-500" width="1.25rem"></iconify-icon>
<b class="text-white mr-2">C++</b>
Ak sa ti zdá Python príliš pomalý, alebo jednoduchý, máme tu pre teba kurzy C++.
Ak chceš písať bleskovo rýchle programy, C++ je kompilovaný jazyk, ktorý ti to umožní. Naučíme ťa orientovať sa v ňom a správne ho používať.
</div>
<div class="relative pl-9">
<iconify-icon icon="ph:lightning-fill" class="absolute left-1 top-0.5 text-blue-500" width="1.25rem"></iconify-icon>
<b class="text-white mr-2">Algoritmy a dátové štruktúry</b>
Programovací jazyk nie je jediný spôsob, ako zrýchliť program.
Ak sa naučíš dáta správne ukladať a správne s nimi pracovať, budú tvoje programy ešte rýchlejšie.
Žiadny programovací jazyk nie je dostatočne rýchly, pokiaľ ho nepoužívaš s rozumom.
Naučíme ťa dáta ukladať do správnych štruktúr a spracovávať správnymi algoritmami, aby tvoje programy boli čo najefektívnejšie.
</div>
</div>
</div>
Expand All @@ -65,10 +65,9 @@ <h2 class="text-2xl font-bold text-white lg:text-4xl">Učebné materiály</h2>
<div class="w-full lg:w-1/2 text-justify">
<h2 class="text-2xl font-bold text-white lg:text-4xl">Programátorské úlohy</h2>
<p class="mt-4">
Pripravili sme si pre teba aj programátorské úlohy, na ktorých si môžeš otestovať nadobudnuté vedomosti.
Tieto úlohy môžeš riešiť a odovzdávať.
Tvoje riešenia budú po odovzdaní automaticky otestované. Okamžite sa dozvieš,
či sú správne a dostatočne efektívne.
Pripravili sme si pre teba aj programátorské úlohy, na ktorých si môžeš svoje nadobudnuté vedomosti otestovať.
Po prihlásení sa môžeš riešiť a odovzdávať všetky úlohy na stránke.
Riešenia sú automaticky otestované, takže sa okamžite dozvieš, či sú tvoje programy správne a dostatočne efektívne.
</p>
</div>
</div>
Expand All @@ -78,13 +77,14 @@ <h2 class="text-2xl font-bold text-white lg:text-4xl">Programátorské úlohy</h
<h2 class="text-2xl font-bold text-white lg:text-4xl">Dlhoročná tradícia</h2>
<p class="mt-4 text-justify">
KSP School vzniklo v dielňach
<a href="https://www.ksp.sk/" class="text-blue-300 hover:text-blue-400 underline">
<a href="https://www.ksp.sk/" class="text-ksp hover:text-ksp-semi-light underline">
Korešpondenčného seminára z programovania.</a>
V KSP sa venujeme neformálnemu vzdelávaniu a popularizácii informatiky medzi žiakmi stredných škôl už od roku 1983.
V roku 2005 sme spustili náš prvý vzdelávací projekt - Programátorskú liaheň.
Novšia verzia Programátorskej liahne bola spustená v roku 2010.
Od roku 2015 každé leto organizujeme Letnú školu,
kde počas intenzívnych dvoch letných týždňov učíme stredoškolákov programovať.
Najnovšou súčasťou Letnej školy je práve táto online škola programovania - KSP School.
</p>
</div>
<div class="w-full lg:w-1/2 flex items-center justify-center">
Expand Down
30 changes: 20 additions & 10 deletions school/pages/templates/pages/home_history.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<li>
<div class="relative pb-8">
<span class="absolute left-2.5 top-2.5 -ml-px h-full w-0.5 bg-gray-600" aria-hidden="true"></span>
<div class="relative flex space-x-3 text-sm">
<div class="relative flex space-x-4 text-sm">
<div class="h-5 w-5 rounded-full bg-gray-600 flex items-center justify-center ring-8 ring-gray-800"></div>
<p class="text-gray-200 font-bold">1974</p>
<p class="text-gray-400">Počítač Altair 8800</p>
<p class="text-gray-400">Prvý osobý počítač Altair 8800</p>
</div>
</div>
</li>
<li>
<div class="relative pb-8">
<span class="absolute left-2.5 top-2.5 -ml-px h-full w-0.5 bg-gray-600" aria-hidden="true"></span>
<div class="relative flex space-x-3 text-sm">
<div class="h-5 w-5 rounded-full bg-blue-600 flex items-center justify-center ring-8 ring-gray-800"></div>
<div class="relative flex space-x-4 text-sm">
<div class="h-5 w-5 rounded-full bg-ksp flex items-center justify-center ring-8 ring-gray-800"></div>
<p class="text-gray-200 font-bold">1983</p>
<p class="text-gray-400">Vznik Korešpondenčného seminára z programovania</p>
</div>
Expand All @@ -23,8 +23,8 @@
<li>
<div class="relative pb-8">
<span class="absolute left-2.5 top-2.5 -ml-px h-full w-0.5 bg-gray-600" aria-hidden="true"></span>
<div class="relative flex space-x-3 text-sm">
<div class="h-5 w-5 rounded-full bg-blue-600 flex items-center justify-center ring-8 ring-gray-800"></div>
<div class="relative flex space-x-4 text-sm">
<div class="h-5 w-5 rounded-full bg-ksp flex items-center justify-center ring-8 ring-gray-800"></div>
<p class="text-gray-200 font-bold">2005</p>
<p class="text-gray-400">Vzdelávací projekt Programátorská liaheň</p>
</div>
Expand All @@ -33,21 +33,31 @@
<li>
<div class="relative pb-8">
<span class="absolute left-2.5 top-2.5 -ml-px h-full w-0.5 bg-gray-600" aria-hidden="true"></span>
<div class="relative flex space-x-3 text-sm">
<div class="h-5 w-5 rounded-full bg-blue-600 flex items-center justify-center ring-8 ring-gray-800"></div>
<div class="relative flex space-x-4 text-sm">
<div class="h-5 w-5 rounded-full bg-ksp flex items-center justify-center ring-8 ring-gray-800"></div>
<p class="text-gray-200 font-bold">2010</p>
<p class="text-gray-400">Nová Programátorská liaheň</p>
</div>
</div>
</li>
<li>
<div class="relative pb-8">
<div class="relative flex space-x-3 text-sm">
<div class="h-5 w-5 rounded-full bg-blue-600 flex items-center justify-center ring-8 ring-gray-800"></div>
<span class="absolute left-2.5 top-2.5 -ml-px h-full w-0.5 bg-gray-600" aria-hidden="true"></span>
<div class="relative flex space-x-4 text-sm">
<div class="h-5 w-5 rounded-full bg-ksp flex items-center justify-center ring-8 ring-gray-800"></div>
<p class="text-gray-200 font-bold">2015</p>
<p class="text-gray-400">Prvá Letná škola Programovania</p>
</div>
</div>
</li>
<li>
<div class="relative pb-8">
<div class="relative flex space-x-4 text-sm">
<div class="h-5 w-5 rounded-full bg-ksp flex items-center justify-center ring-8 ring-gray-800"></div>
<p class="text-gray-200 font-bold">2022</p>
<p class="text-gray-400">KSP School</p>
</div>
</div>
</li>
</ul>
</div>
2 changes: 1 addition & 1 deletion school/pages/templates/pages/home_text.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="bg-gray-700 p-3 text-sm text-white">
<p class="text-lg font-bold mb-1">Prioritná fronta</p>

<p>Naším hlavným cieľom v tomto článku bude efektívna implementácia takzvanej prioritnej fronty. Toto je dátová štruktúra, ktorá vie efektívne robiť dve operácie:</p>
<p>Hlavným cieľom v tomto článku bude implementácia prioritnej fronty. To je dátová štruktúra, ktorá vie efektívne robiť dve operácie:</p>

<ul class="mt-2 list-outside list-disc ml-6">
<li><code>push(prvok,priorita):</code> vlož nový prvok a nastav mu konkrétnu prioritu</li>
Expand Down
28 changes: 28 additions & 0 deletions school/problems/migrations/0010_alter_problem_difficulty.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 5.2.15 on 2026-06-30 14:28

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("problems", "0009_remove_submit_language_alter_problem_slug"),
]

operations = [
migrations.AlterField(
model_name="problem",
name="difficulty",
field=models.CharField(
choices=[
("basics", "základy"),
("easy", "ľahká"),
("medium", "stredná"),
("hard", "ťažká"),
("very-hard", "veľmi ťažká"),
("unknown", "neznáma"),
],
default="unknown",
verbose_name="obtiažnosť",
),
),
]
Loading
Loading