diff --git a/db/migration.sql b/db/migration.sql
index 423391b..106bf40 100644
--- a/db/migration.sql
+++ b/db/migration.sql
@@ -407,11 +407,6 @@ DO $$ BEGIN
ALTER TABLE entries ADD CONSTRAINT entries_rating_check CHECK (rating BETWEEN 1 AND 10);
EXCEPTION WHEN duplicate_object THEN NULL; END $$;
CREATE INDEX IF NOT EXISTS idx_entries_module_id ON entries(module_id);
-UPDATE entries
- SET rating = (7 + mod(abs(hashtext(to_char(created_at AT TIME ZONE 'UTC', 'YYYYMMDDHH24MISSMS'))::bigint), 4))::smallint
- WHERE module_id IS NOT NULL
- AND created_at IS NOT NULL
- AND rating IS NULL;
CREATE TABLE IF NOT EXISTS student_photos (
id SERIAL PRIMARY KEY,
diff --git a/public/index.html b/public/index.html
index bbd070a..1a8e722 100644
--- a/public/index.html
+++ b/public/index.html
@@ -189,7 +189,7 @@ nav a:hover{color:var(--text)}
-
Рейтинг занятия
+
Оценка занятию
1
2
diff --git a/public/journal.html b/public/journal.html
index 2159208..4da7f43 100644
--- a/public/journal.html
+++ b/public/journal.html
@@ -141,6 +141,12 @@
.cpu-enhance-actions { grid-template-columns: 1fr; }
}
.photo-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
+.edit-rating { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
+.edit-rate-opt { position: relative; display: block; }
+.edit-rate-opt input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; padding: 0; cursor: pointer; }
+.edit-rate-opt span { display: flex; align-items: center; justify-content: center; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: .82rem; font-weight: 600; color: var(--muted); transition: border-color .15s, background .15s, color .15s; pointer-events: none; }
+.edit-rate-opt input:checked + span { border-color: var(--accent); background: var(--accent); color: #fff; }
+.edit-rate-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 800px) {
.enhance-body { flex-direction: column; }
.enhance-sliders { flex: 1 1 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@@ -212,6 +218,21 @@
+
Что делала(а) *
✨
diff --git a/public/js/journal.js b/public/js/journal.js
index e29d4ee..227a492 100644
--- a/public/js/journal.js
+++ b/public/js/journal.js
@@ -888,6 +888,7 @@ async function openEdit(id) {
document.getElementById('editName').value = e.student_name;
document.getElementById('editDesc').value = e.description;
renderEditAiStatus(e);
+ setEditRating(e.rating);
const sel = document.getElementById('editGroup');
if (!editGroups.length) {
const res = await fetch(`${API}/api/groups`, { headers: hdr() });
@@ -901,6 +902,11 @@ async function openEdit(id) {
document.getElementById('editModal').classList.add('open');
}
+function setEditRating(v) {
+ const val = v === null || v === undefined ? '' : String(v);
+ document.querySelectorAll('input[name="editRating"]').forEach(r => { r.checked = r.value === val; });
+}
+
function renderEditPhotos(photos, mainPath) {
const preview = document.getElementById('editPhotoPreview');
preview.innerHTML = '';
@@ -974,6 +980,7 @@ function closeEdit() {
document.getElementById('editPhoto').value = '';
document.getElementById('editPhotoPreview').innerHTML = '';
document.getElementById('editAiStatus').style.display = 'none';
+ setEditRating('');
editId = null;
editDeletePhoto = false;
}
@@ -2652,6 +2659,8 @@ async function saveEdit() {
formData.append('group_id', group_id);
formData.append('description', description);
formData.append('module_id', moduleId);
+ const ratingInput = document.querySelector('input[name="editRating"]:checked');
+ formData.append('rating', ratingInput ? ratingInput.value : '');
formData.append('edit_source', editSourceFor(description));
const photoFiles = document.getElementById('editPhoto').files;