You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: data/quiz-bank.json
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -714,7 +714,7 @@
714
714
"hint": "Think of it as a digital ID badge that's been stamped by the server."
715
715
},
716
716
{
717
-
"belt": "purple",
717
+
"belt": "brown",
718
718
"format": "free_response",
719
719
"question": "Explain why you should never store passwords in plain text. What is 'hashing' and why is it preferred?",
720
720
"expected_understanding": "Hashing is a one-way function that converts passwords into fixed-length strings. You can't reverse a hash back to the password. When a user logs in, you hash their input and compare hashes. If the database is breached, attackers see hashes, not passwords. Bcrypt adds 'salt' for extra security.",
@@ -885,7 +885,7 @@
885
885
"hint": "Think of an assembly line where each station checks something before passing it along."
886
886
},
887
887
{
888
-
"belt": "purple",
888
+
"belt": "brown",
889
889
"format": "free_response",
890
890
"question": "Explain the difference between Continuous Delivery and Continuous Deployment. Why might a team choose one over the other?",
891
891
"expected_understanding": "Continuous Delivery means code is always ready to deploy but requires manual approval for production. Continuous Deployment means every change that passes tests is automatically deployed. Teams handling sensitive data (banking, healthcare) may prefer Delivery for the manual gate, while fast-moving startups may prefer full Deployment.",
@@ -920,15 +920,15 @@
920
920
"hint": "Think of them as 'recipes' that experienced developers have already figured out."
921
921
},
922
922
{
923
-
"belt": "purple",
923
+
"belt": "brown",
924
924
"question": "What is the Observer pattern and where might you see it in everyday web development?",
925
925
"options": ["A pattern for watching files for changes", "A pattern where objects subscribe to events and get notified when something changes", "A pattern for monitoring server performance"],
926
926
"correct": 1,
927
927
"explanation": "The Observer pattern lets objects 'subscribe' to events and react when they happen. You use it constantly in web dev: addEventListener in the DOM, React's state/re-render system, Redux subscriptions, and WebSocket message handlers are all variations of Observer.",
928
928
"hint": "Think about event listeners and how multiple parts of your app react to changes."
929
929
},
930
930
{
931
-
"belt": "purple",
931
+
"belt": "brown",
932
932
"format": "free_response",
933
933
"question": "Explain the Singleton pattern. What problem does it solve, and what are its potential drawbacks?",
934
934
"expected_understanding": "Singleton ensures a class has only one instance (like a database connection pool or config manager). It solves the problem of accidental duplicate instances of shared resources. Drawbacks: it's essentially a global variable (hard to test, tight coupling), can hide dependencies, and makes parallel testing difficult.",
@@ -945,15 +945,15 @@
945
945
"hint": "Think 'scale up' (bigger) versus 'scale out' (more)."
946
946
},
947
947
{
948
-
"belt": "purple",
948
+
"belt": "brown",
949
949
"question": "What is a CDN and how does it improve scalability?",
950
950
"options": ["A type of database", "A network of servers worldwide that caches content close to users", "A programming framework"],
951
951
"correct": 1,
952
952
"explanation": "A CDN (Content Delivery Network) copies your static files (images, CSS, JS) to servers around the world. Users get served from the nearest location, reducing load time. It also takes traffic load off your origin server, improving scalability.",
953
953
"hint": "It's about putting copies of your content closer to where your users are."
954
954
},
955
955
{
956
-
"belt": "purple",
956
+
"belt": "brown",
957
957
"format": "free_response",
958
958
"question": "Explain what 'caching' means in web development and describe two different levels where caching can occur.",
959
959
"expected_understanding": "Caching stores frequently requested data in a faster location to avoid recomputing or refetching it. Browser cache (stores assets locally), CDN cache (stores content at edge servers), server-side cache like Redis (stores database query results in memory), and database query cache are common levels. Each level trades freshness for speed.",
DEFAULT_OUTPUT='{"mode":"dynamic","concept":null,"reason":"No profile data available","static_question":null,"belt":"white","quiz_format":"multiple_choice"}'
24
24
25
+
select_static_question() {
26
+
local concept="$1"
27
+
28
+
jq -c \
29
+
--arg concept "$concept" \
30
+
--arg belt "$BELT" \
31
+
--arg format "$QUIZ_FORMAT"'
32
+
def rank($value):
33
+
if $value == "white" then 0
34
+
elif $value == "yellow" then 1
35
+
elif $value == "orange" then 2
36
+
elif $value == "green" then 3
37
+
elif $value == "blue" then 4
38
+
elif $value == "brown" then 5
39
+
elif $value == "black" then 6
40
+
else -1
41
+
end;
42
+
(.quizzes[$concept] // []) as $questions |
43
+
(($questions | map(select(rank(.belt) >= 0 and rank(.belt) <= rank($belt) and ((.format // "multiple_choice") == $format))) | first) //
if [ "$STATIC_Q"!="null" ] && [ -n"$STATIC_Q" ];then
153
169
echo"{\"mode\":\"static\",\"concept\":\"$UNQUIZZED_CONCEPT\",\"reason\":\"New concept from this session — not yet quizzed.\",\"static_question\":$STATIC_Q,\"belt\":\"$BELT\",\"quiz_format\":\"$QUIZ_FORMAT\"}"
@@ -170,11 +186,7 @@ if [ "$CONCEPTS_SEEN" != "[]" ]; then
0 commit comments