Student starter code (30% baseline)
index.html- Main HTML pagescript.js- JavaScript logicstyles.css- Styling and layoutpackage.json- Dependenciessetup.sh- Setup scriptREADME.md- Instructions (below)๐ก Download the ZIP, extract it, and follow the instructions below to get started!
# Option 1: Using VS Code Live Server
# 1. Open this folder in VS Code
# 2. Install Live Server extension if not installed
# 3. Right-click on index.html โ "Open with Live Server"
# Option 2: Using Python
cd project-03-smart-farm-assistant
python3 -m http.server 8000
# Then open: http://localhost:8000
# Option 3: Just open the file
# Simply double-click index.html to open in your browser!
Location: script.js - Line ~101
Success Criteria:
Hints:
// Saving data
localStorage.setItem('userPreferences', JSON.stringify(appState.user));
// Loading data
const saved = localStorage.getItem('userPreferences');
if (saved) {
appState.user = JSON.parse(saved);
}
Location: script.js - Line ~119
Success Criteria:
Location: script.js - Line ~151
Success Criteria:
Current Implementation:
Needs Enhancement:
Location: script.js - Line ~165
Success Criteria:
Enhancement Ideas:
Location: script.js - Line ~189
Success Criteria:
Location: script.js - Line ~194
Success Criteria:
Example Enhancement:
if (appState.user.experience === 'beginner') {
response += '\n\n๐ก As a beginner, start simple!';
} else if (appState.user.experience === 'advanced') {
response += '\n\n๐ For advanced techniques, consider...';
}
Location: script.js - Line ~216
Success Criteria:
Location: script.js - Line ~238
Success Criteria:
Location: script.js - Line ~269
Success Criteria:
Location: script.js - Line ~277
Success Criteria:
Location: script.js - Line ~289
Success Criteria:
Location: script.js - Line ~306
Success Criteria:
Location: script.js - Line ~313
Success Criteria:
Example Calculator:
function calculateGardenSpace(length, width, plantSpacing) {
const area = length * width;
const plantsPerRow = Math.floor(width / plantSpacing);
const numberOfRows = Math.floor(length / plantSpacing);
return plantsPerRow * numberOfRows;
}
For students who finish early or want to go beyond:
Solution: Check browser console for errors. Ensure knowledge.js is loaded before script.js.
Solution: Some browsers block localStorage in incognito mode. Test in normal browsing mode.
Solution: Verify JSON.stringify() and JSON.parse() are used correctly. Check for typos in localStorage keys.
Solution: Ensure chatMessages.scrollTop = chatMessages.scrollHeight executes after adding messages.
To complete this project successfully, you should have:
โ Core Features (Required)
โ Enhanced Features (Recommended)
โ Advanced Features (Optional)
Students who excel in this project often:
Before submitting:
Remember: This project is about learning conversational AI and browser APIs. Start with the basics, test thoroughly, and have fun building something that could genuinely help people grow food! ๐ฑ
Good luck, and happy coding! If you get stuck, remember that every professional developer uses documentation, AI assistants, and asks for help. You're not alone in this journey!