AIbyKaindu commited on
Commit
889b45d
Β·
verified Β·
1 Parent(s): 2ff8877

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +60 -0
app.py CHANGED
@@ -129,3 +129,63 @@ if topic:
129
 
130
  st.markdown("---")
131
  st.caption("Created with ❀️ by CoreQuest Galaxy πŸš€ Powered by Hugging Face + Learning Galaxy ✨")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
 
130
  st.markdown("---")
131
  st.caption("Created with ❀️ by CoreQuest Galaxy πŸš€ Powered by Hugging Face + Learning Galaxy ✨")
132
+ # --- πŸ”₯ Galactic Upgrades Section ---
133
+
134
+ st.markdown("## πŸš€ Galactic Upgrades")
135
+ st.info("Explore extra challenges and boosters to earn even more XP and become a true CoreQuest legend!")
136
+
137
+ # --- 🌟 Daily Challenge System ---
138
+ import random
139
+ daily_challenges = [
140
+ "Explain Newton's First Law with a real-world example.",
141
+ "Solve a basic derivative problem using the power rule.",
142
+ "Describe the concept of kinetic and potential energy.",
143
+ "Draw and label a free body diagram for a falling object.",
144
+ "Write the difference between electric current and voltage.",
145
+ "Sketch how a convex lens focuses light.",
146
+ "Describe Special Relativity in one sentence."
147
+ ]
148
+ today_challenge = random.choice(daily_challenges)
149
+
150
+ st.subheader("🧩 Daily Challenge")
151
+ st.success(today_challenge)
152
+
153
+ if st.button("βœ… Complete Challenge (Claim 15 XP)"):
154
+ update_xp(15)
155
+ st.balloons()
156
+ st.success("You completed today's challenge! 15 XP awarded.")
157
+
158
+ # --- πŸ›Έ Galactic XP Boosts (Random Event!) ---
159
+ boost_active = random.choice([True, False])
160
+
161
+ if boost_active:
162
+ st.markdown("### 🌌 **Galactic XP Boost Active!**")
163
+ st.info("All actions give **+5 bonus XP** for the next 10 minutes!")
164
+
165
+ def update_xp_boost(points):
166
+ bonus_points = points + 5
167
+ st.session_state.xp += bonus_points
168
+ if st.session_state.xp >= 100:
169
+ st.balloons()
170
+ st.success("🌟 LEVEL UP! Congratulations!")
171
+ st.session_state.level += 1
172
+ st.session_state.xp = 0
173
+
174
+ # If you want, replace update_xp(points) with update_xp_boost(points) during boost time
175
+ else:
176
+ st.caption("β˜„οΈ No Galactic Boost right now. Check back later!")
177
+
178
+ # --- πŸ† Hall of Fame (Top 3 Players Auto-Show) ---
179
+ st.markdown("---")
180
+ st.subheader("πŸ† Hall of Fame - Top 3 Explorers")
181
+
182
+ # Sort and display top 3 leaderboard players
183
+ if "leaderboard" in st.session_state and st.session_state.leaderboard:
184
+ top_players = st.session_state.leaderboard[:3]
185
+ for idx, player in enumerate(top_players, start=1):
186
+ st.success(f"πŸ… {idx}. {player['name']} - {player['xp']} XP")
187
+ else:
188
+ st.info("No top players yet β€” be the first to reach the Hall of Fame!")
189
+
190
+ st.markdown("---")
191
+ st.caption("🌌 CoreQuest Galaxy | Built with ❀️ and Science Magic ✨")