Spaces:
Running
Running
Sync from GitHub 37f011465a0aa2abdfdd94d8bd5f31cfe932c669 (part 2)
Browse files- streamlit_app.py +32 -6
streamlit_app.py
CHANGED
|
@@ -666,9 +666,12 @@ def render_home(exams):
|
|
| 666 |
# 1. ๊ฐ๋
๊ณต๋ถ
|
| 667 |
lessons = lessons_for_track(track_id)
|
| 668 |
quizzes_list = quizzes_for_track(track_id)
|
| 669 |
-
|
|
|
|
|
|
|
|
|
|
| 670 |
c_chip_txt = "โ ์๋ฃ" if concept_done else "ํ์ต ์ค"
|
| 671 |
-
c_desc = f"์ด๋ก {len(lessons)}
|
| 672 |
concept_target = "๊ฐ๋
๊ณต๋ถ" if concept_done else ("์ด๋ก ํ์ต" if "lesson" not in session_done else "ํ์ธ ํด์ฆ")
|
| 673 |
if st.button(
|
| 674 |
f"๐ ๊ฐ๋
๊ณต๋ถ ยท {c_desc} ยท {c_chip_txt} โ",
|
|
@@ -680,13 +683,15 @@ def render_home(exams):
|
|
| 680 |
|
| 681 |
# 2. ์ค์ต / ๋ฌธ์ ์ ์ฉ
|
| 682 |
practices = [t for t in PRACTICE_TASKS if t.track == track_id and t.status == "approved"]
|
|
|
|
|
|
|
| 683 |
if track_id == "azure":
|
| 684 |
-
p_title,
|
|
|
|
| 685 |
p_chip_txt = "โ ์๋ฃ" if practice_done else "ํ์ต ์ค"
|
| 686 |
elif practices:
|
| 687 |
-
p_title = "๐ฅ ์ค์ต"
|
| 688 |
-
p_desc = f"
|
| 689 |
-
p_page = "์ค์ต"
|
| 690 |
p_chip_txt = "โ ์๋ฃ" if practice_done else "ํ์ต ์ค"
|
| 691 |
else:
|
| 692 |
p_title, p_desc, p_page = "๐ฅ ์ค์ต", "์ด Track์ ์ค์ต ๊ณผ์ ๋ฅผ ์ค๋น ์ค์
๋๋ค", "์ค์ต"
|
|
@@ -1405,6 +1410,11 @@ def render_learning_quiz():
|
|
| 1405 |
quiz = ordered_quizzes[index]
|
| 1406 |
is_due = quiz.id in due_ids
|
| 1407 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1408 |
with st.container(border=True):
|
| 1409 |
badge = "๐ ๋ณต์ต" if is_due else quiz.difficulty
|
| 1410 |
st.caption(f"{quiz.track} ยท {quiz.question_type} ยท {badge}")
|
|
@@ -1692,6 +1702,11 @@ def render_lab_practice():
|
|
| 1692 |
index = min(st.session_state.lab_practice_index, len(tasks) - 1)
|
| 1693 |
task = tasks[index]
|
| 1694 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1695 |
with st.container(border=True):
|
| 1696 |
st.caption(f"{task.track} ยท {task.difficulty} ยท {task.status}")
|
| 1697 |
st.markdown(f"### {task.title}")
|
|
@@ -1723,6 +1738,17 @@ def render_lab_practice():
|
|
| 1723 |
st.markdown(task.explanation)
|
| 1724 |
st.markdown("</div>", unsafe_allow_html=True)
|
| 1725 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1726 |
# ์ฑ์ ํ ๋ค์ ์ค์ต ๋ฐ๋ก ์ด๋
|
| 1727 |
is_last_task = index >= len(tasks) - 1
|
| 1728 |
if not is_last_task:
|
|
|
|
| 666 |
# 1. ๊ฐ๋
๊ณต๋ถ
|
| 667 |
lessons = lessons_for_track(track_id)
|
| 668 |
quizzes_list = quizzes_for_track(track_id)
|
| 669 |
+
_cl = st.session_state.lab_completed_lessons
|
| 670 |
+
_cq = st.session_state.lab_completed_quizzes
|
| 671 |
+
done_lessons = len([l for l in lessons if l.id in _cl])
|
| 672 |
+
done_quizzes = len([q for q in quizzes_list if q.id in _cq])
|
| 673 |
c_chip_txt = "โ ์๋ฃ" if concept_done else "ํ์ต ์ค"
|
| 674 |
+
c_desc = f"์ด๋ก {done_lessons}/{len(lessons)} ยท ํด์ฆ {done_quizzes}/{len(quizzes_list)}"
|
| 675 |
concept_target = "๊ฐ๋
๊ณต๋ถ" if concept_done else ("์ด๋ก ํ์ต" if "lesson" not in session_done else "ํ์ธ ํด์ฆ")
|
| 676 |
if st.button(
|
| 677 |
f"๐ ๊ฐ๋
๊ณต๋ถ ยท {c_desc} ยท {c_chip_txt} โ",
|
|
|
|
| 683 |
|
| 684 |
# 2. ์ค์ต / ๋ฌธ์ ์ ์ฉ
|
| 685 |
practices = [t for t in PRACTICE_TASKS if t.track == track_id and t.status == "approved"]
|
| 686 |
+
_cp = st.session_state.lab_completed_practices
|
| 687 |
+
done_practices = len([t for t in practices if t.id in _cp])
|
| 688 |
if track_id == "azure":
|
| 689 |
+
p_title, p_page = "๐ ๋ฌธ์ ์ ์ฉ", "์ํ์ค๋น"
|
| 690 |
+
p_desc = "AZ-104 ์ค์ ๋ฌธ์ ์ ์ฉ"
|
| 691 |
p_chip_txt = "โ ์๋ฃ" if practice_done else "ํ์ต ์ค"
|
| 692 |
elif practices:
|
| 693 |
+
p_title, p_page = "๐ฅ ์ค์ต", "์ค์ต"
|
| 694 |
+
p_desc = f"์ค์ต {done_practices}/{len(practices)}"
|
|
|
|
| 695 |
p_chip_txt = "โ ์๋ฃ" if practice_done else "ํ์ต ์ค"
|
| 696 |
else:
|
| 697 |
p_title, p_desc, p_page = "๐ฅ ์ค์ต", "์ด Track์ ์ค์ต ๊ณผ์ ๋ฅผ ์ค๋น ์ค์
๋๋ค", "์ค์ต"
|
|
|
|
| 1410 |
quiz = ordered_quizzes[index]
|
| 1411 |
is_due = quiz.id in due_ids
|
| 1412 |
|
| 1413 |
+
# ์ ์ฒด ํด์ฆ ์ง๋ ํ์
|
| 1414 |
+
completed_quizzes = st.session_state.lab_completed_quizzes
|
| 1415 |
+
done_q = len([q for q in quizzes if q.id in completed_quizzes])
|
| 1416 |
+
st.progress(done_q / len(quizzes) if quizzes else 0, text=f"ํด์ฆ {done_q}/{len(quizzes)} ์๋ฃ")
|
| 1417 |
+
|
| 1418 |
with st.container(border=True):
|
| 1419 |
badge = "๐ ๋ณต์ต" if is_due else quiz.difficulty
|
| 1420 |
st.caption(f"{quiz.track} ยท {quiz.question_type} ยท {badge}")
|
|
|
|
| 1702 |
index = min(st.session_state.lab_practice_index, len(tasks) - 1)
|
| 1703 |
task = tasks[index]
|
| 1704 |
|
| 1705 |
+
# ์ ์ฒด ์ค์ต ์ง๋ ํ์
|
| 1706 |
+
completed_practices = st.session_state.lab_completed_practices
|
| 1707 |
+
done_p = len([t for t in tasks if t.id in completed_practices])
|
| 1708 |
+
st.progress(done_p / len(tasks) if tasks else 0, text=f"์ค์ต {done_p}/{len(tasks)} ์๋ฃ")
|
| 1709 |
+
|
| 1710 |
with st.container(border=True):
|
| 1711 |
st.caption(f"{task.track} ยท {task.difficulty} ยท {task.status}")
|
| 1712 |
st.markdown(f"### {task.title}")
|
|
|
|
| 1738 |
st.markdown(task.explanation)
|
| 1739 |
st.markdown("</div>", unsafe_allow_html=True)
|
| 1740 |
|
| 1741 |
+
# ์ค๋ต ์ ๊ด๋ จ ๋ ์จ ๋ฐ๋ก๊ฐ๊ธฐ (lesson.related_practices ์ญ๋ฐฉํฅ ๋งคํ)
|
| 1742 |
+
if not all_pass:
|
| 1743 |
+
all_lessons = lessons_for_track(track_id)
|
| 1744 |
+
related_lessons = [l for l in all_lessons if task.id in l.related_practices]
|
| 1745 |
+
if related_lessons:
|
| 1746 |
+
lesson_ids = [l.id for l in all_lessons]
|
| 1747 |
+
matched = related_lessons[0]
|
| 1748 |
+
if st.button(f"๊ด๋ จ ์ด๋ก ๋ค์ ๋ณด๊ธฐ โ {matched.title}", key=f"goto_lesson_from_practice_{task.id}"):
|
| 1749 |
+
st.session_state.lab_lesson_index = lesson_ids.index(matched.id)
|
| 1750 |
+
go_to("์ด๋ก ํ์ต")
|
| 1751 |
+
|
| 1752 |
# ์ฑ์ ํ ๋ค์ ์ค์ต ๋ฐ๋ก ์ด๋
|
| 1753 |
is_last_task = index >= len(tasks) - 1
|
| 1754 |
if not is_last_task:
|