Skip to the content.

Sprint_5_final_ipynb_2_

5 things that I did

  • Burndown list
    • show burndown list
  • Kanban Board
    • show updated kanban board
  • Guess Game
  • Faciliatating communicating within group
  • Blind-Trace

Final thoughts and reflection

Struggles During AP CSP Class

  • Time Management: Balancing coding projects, MCQs, and written responses with other AP coursework.
  • Debugging Challenges: Fixing errors in JavaScript/Python code, especially logic errors that aren’t immediately obvious.
  • Understanding Abstract Concepts: Some topics like recursion, data structures, and APIs were difficult to grasp initially.
  • Collaboration Difficulties: Working with a group can be challenging when teammates have different skill levels or schedules.
  • Live Review & Presentations: Explaining code and projects in a structured way under time pressure.

Strengths During AP CSP Class

  • Problem-Solving: Debugging and finding solutions to coding problems efficiently.
  • Creativity in Projects: Coming up with unique ideas and implementing them in web apps and games.
  • Collaboration & Teamwork: Contributing to group projects and helping teammates with debugging.
  • Understanding Big Picture Concepts: Applying algorithms, conditionals, and loops in meaningful ways.
  • Resilience & Adaptability: Overcoming struggles in debugging, time constraints, and new coding challenges.
  • Technical Growth: Improved proficiency in Python, JavaScript, and using APIs.

Self Grade

Self-Grade: 9.5/10

  • 4.5/5 points: In my live review presentation, I will cover five key tasks I worked on over the past 12 weeks, including challenges I faced and how I managed them using my Kanban board’s burndown lists. I met all the project requirements, but I could expand more on the collaborative aspects, as well as the coding and communication skills I developed through both my individual work and group contributions.
  • 2/2 points: My final Tri 2 blog will showcase images of working features and code snippets. I also reflected on the feedback from N@tM and how it will shape future improvements to the website.
  • 1/1 point: I wrote about my Guess Game and Blind Trace project features, incorporating terminology from the CPT requirements and FRQs to explain their functionality.
  • 1/1 point: I completed the MCQ and FRQ, documented my mistakes, identified areas for improvement, and outlined steps to strengthen my understanding.
  • 1/1 point: In my final blog, I discussed several presentations I watched, highlighting what I found interesting. I also reflected on my future in Computer Science, plans for further development of my website, and my personal strengths and weaknesses. Additionally, I prepared for the live review by practicing with another student from a different period and project (Zafeer).

CPT Requirement

Program Function & Purpose (Big Idea 1.1 & 1.2)

  • Guessing Game: Users input guesses based on images; backend verifies correctness and stores attempts.
  • Blind Trace Game: Users trace an image blindly; frontend evaluates similarity and records scores.
  • Implemented Agile & SCRUM: Used Kanban boards to track progress, address issues, and iterate on feedback.

    Program Design & Development (Big Idea 1.3)

  • Frontend-Backend Integration:
    • Guessing Game: User submits guesses; backend processes correctness.
    • Blind Trace Game: User submits drawings; frontend scores similarity and stores results.
  • Design Documentation: Used flowcharts, UML diagrams, and planning docs for structured development.
  • Code Style & Documentation: Followed PEP 8, added comments, and maintained modular code.

    Debugging & Testing (Big Idea 1.4)

  • Backend Debugging: Used Postman to test API functionality for guesses and submissions.
  • Frontend Debugging: Used browser DevTools for UI troubleshooting and error resolution.
  • Error Handling: Implemented validation for user inputs and API request responses.

    Data & Storage (Big Idea 2)

  • Database (SQLite):
    • Guessing Game: Stored guesses, player attempts, and correctness.
    • Blind Trace Game: Recorded player scores, submissions, and past game history.
  • Data Retrieval: Used optimized queries to fetch and display game results efficiently.
  • Data Security: Ensured data integrity and protected stored records.

    Internet & Deployment (Big Idea 4)

  • Hosting: Deployed using AWS, Nginx, and Docker for scalability and reliability.
  • RESTful API: Used GET, POST, DELETE requests to manage game interactions.
  • Security & Authentication: Implemented JWT for user verification and data protection.
  • Performance Optimization: Reduced unnecessary frontend re-renders and optimized backend queries.
  • Monitoring & Logging: Tracked user activity and application errors post-deployment.

N@TM Feedback

Question 35 Image

Question 35 Image

Question 35 Image

Question 35 Image

Feedback for Improving Both Games

Guessing Game

What Works Well:

  • The game is simple and easy to understand.
  • The guessing system works correctly, and responses update in real-time.
  • The stats table allows users to track their past guesses, which is a nice touch.

🔧 Improvements:

  • Add a hint system to help players when they’re stuck.
  • Improve UI design to make the game look more engaging.
  • Display correct answers after a few failed attempts.
  • Add a timer or scoring system to make it more competitive.

Blind Trace Game

What Works Well:

  • The similarity grading system is a cool feature.
  • Storing past drawings and scores makes the game feel more interactive.
  • The ability to compare scores from past attempts adds a challenge.

🔧 Improvements:

  • Improve grading accuracy—sometimes scores don’t feel fair.
  • Add a replay or undo button in case of accidental mistakes.
  • Allow players to compare their trace with the original image side-by-side.
  • Make the drawing tools smoother for a better tracing experience.

Future

 - **Classes & Learning:** Planning to take advanced CS courses, such as AP CSA or college-level data structures & algorithms.  
- **College & Career:** Interested in pursuing a major in engineering (likely aerospace, robotics, or control systems).  
- **Internships & Experience:** Actively looking for research or internship opportunities related to optimization, computational mechanics, or AI applications in engineering.  
- **Personal Projects:** Continue improving my web development skills and work on AI-related projects, possibly integrating machine learning into future applications.  

Individual Strengths & Weaknesses

Strengths:

  • Strong problem-solving and debugging skills, especially in backend development.
  • Good understanding of API design and database management.
  • Able to integrate frontend and backend smoothly.
  • Willingness to learn and apply new tools/methods quickly.

🔧 Weaknesses:

  • UI/UX design skills need improvement—making things look visually appealing is a challenge.
  • Could improve communication and collaboration in group projects.
  • Need to practice writing cleaner, more efficient code.

Project Strengths and Weaknesses

Project Reflection & Next Steps

Project Strengths:

  • Successfully implemented API endpoints and database management.
  • Games work as intended with functional features.
  • Integrated a stats tracking system, making the game more interactive.

🔧 Areas to Improve:

  • UI needs enhancements to make the game feel more polished and engaging.
  • More feedback mechanisms (hints, scoring improvements) could improve user experience.
  • Need to add more features for long-term engagement, like multiplayer functionality or a ranking system.

📌 Next Steps:

  • Polish frontend design to improve user interaction.
  • Fine-tune the grading algorithm for the Blind Trace Game to be more accurate.
  • Explore adding real-time collaboration features.
  • Look into AI-driven enhancements, like automatic feedback on drawings or smarter hint suggestions.

Collaboration with Zafeer for Live Review & MC Corrections

📌 Live Review Preparation:

  • Zafeer and I practiced our live reviews together, ensuring we could present all required points within the 3-minute limit.
  • We provided each other with feedback on clarity, pacing, and organization, refining our presentations to make them more effective.
  • We discussed how to connect our projects to CPT requirements, ensuring our explanations were aligned with AP CSP expectations.

📌 Multiple-Choice Corrections:

  • We went over MCQ mistakes together, discussing why the correct answers were right and identifying patterns in our errors.
  • We focused on improving understanding of concepts rather than memorizing answers, making sure we could apply our knowledge to similar problems.
  • By explaining concepts to each other, we reinforced our understanding and helped fill gaps in each other’s knowledge.

📌 General Collaboration & Support:

  • We shared project insights and feedback, helping each other improve both our presentations and overall understanding of our code.
  • Encouraged each other to think critically about our strengths and weaknesses, leading to better self-reflection for our live review.
  • Practicing together helped us gain confidence, ensuring we were prepared to present effectively and respond to any questions.

This collaboration made the preparation process more efficient and engaging, ultimately improving our understanding, communication skills, and project presentations.

Question 35 Image

Fullstack Demo

Guess

Question 35 Image

Question 35 Image

Blind-Trace

Question 35 Image

Question 35 Image

API code with CRUD operations

  • Blind-trace:

lass BlindTraceAPI: class _Submission(Resource): @token_required() def post(self): “"”Submit a drawing, grade it using SSIM, and store the result””” current_user = g.current_user data = request.get_json()

        # Validate request data
        if not data or "image_url" not in data or "drawing" not in data:
            return {"message": "Missing required fields", "error": "Bad Request"}, 400

        try:
            # Decode base64 drawing
            drawing_data = base64.b64decode(data["drawing"].split(",")[1])
            drawing_img = Image.open(io.BytesIO(drawing_data)).convert("L")  # Convert to grayscale

            # Fetch reference image
            reference_img = Image.open(io.BytesIO(requests.get(data["image_url"]).content)).convert("L")

            # Resize to match dimensions
            reference_img = reference_img.resize(drawing_img.size)

            # Convert images to numpy arrays
            drawing_arr = np.array(drawing_img)
            reference_arr = np.array(reference_img)

            # Compute Mean Squared Error (MSE)
            mse = np.mean((drawing_arr - reference_arr) ** 2)
            max_mse = np.prod(drawing_arr.shape) * 255**2  # Max possible MSE for 8-bit images
            score = round(100 * (1 - mse / max_mse), 2)  # Normalize to percentage

            # Save submission
            submission = BlindTraceSubmission(
                user_id=current_user.id,
                image_url=data["image_url"],
                drawing=data["drawing"],
                score=score,
                submission_time=datetime.utcnow()
            )
            db.session.add(submission)
            db.session.commit()

            return {
                "message": "Submission graded",
                "score": score,
                "submission": submission.read()
            }, 201

        except Exception as e:
            db.session.rollback()
            traceback.print_exc()
            return {"message": "Internal Server Error", "error": str(e)}, 500

    @token_required()
    def get(self):
        """Retrieve all past submissions for the current user"""
        current_user = g.current_user
        try:
            submissions = BlindTraceSubmission.query.filter_by(user_id=current_user.id).all()
            return {
                "message": "Submissions retrieved successfully",
                "submissions": [sub.read() for sub in submissions]
            }, 200
        except Exception as e:
            traceback.print_exc()
            return {"message": "Internal Server Error", "error": str(e)}, 500

    @token_required()
    def delete(self):
        """Delete a submission by ID"""
        current_user = g.current_user
        data = request.get_json()

        if not data or "id" not in data:
            return {"message": "Missing required fields", "error": "Bad Request"}, 400

        try:
            submission = BlindTraceSubmission.query.get(data["id"])
            if not submission:
                return {"message": "Submission not found", "error": "Not Found"}, 404
            
            if submission.user_id != current_user.id:
                return {"message": "Unauthorized to delete this submission", "error": "Forbidden"}, 403

            db.session.delete(submission)
            db.session.commit()

            return {"message": "Submission deleted successfully"}, 200

        except Exception as e:
            db.session.rollback()
            traceback.print_exc()
            return {"message": "Internal Server Error", "error": str(e)}, 500

# Register API endpoint
api.add_resource(_Submission, '/submission')
  • Guess Game

class GuessAPI: “”” API CRUD endpoints for the Guess model. All endpoints require JWT authentication. “””

class _CRUD(Resource):

    @token_required()
    def post(self):
        """Submit a guess and store it with user and correctness status"""
        try:
            current_user = g.current_user
            data = request.get_json()

            if not data or "user_guess" not in data or "correct_word" not in data:
                return jsonify({"message": "Missing required fields", "error": "Bad Request"}), 400

            guess = data["user_guess"].strip().lower()
            correct_word = data["correct_word"].strip().lower()
            is_correct = (guess == correct_word)

            word_guess = Guess(
                guesser_name=current_user.name,
                guess=guess,
                correct_answer=correct_word,
                is_correct=is_correct,
                created_by=current_user.id,
                date_created=datetime.utcnow()
            )

            db.session.add(word_guess)
            db.session.commit()  # Commit to database

            return jsonify({
                "message": "Guess submitted successfully",
                "guess": word_guess.read(),
                "correct": is_correct
            }), 201

        except Exception as e:
            db.session.rollback()  # Rollback any failed transactions
            print("Error occurred while submitting guess:", str(e))
            traceback.print_exc()  # Debugging
            return jsonify({"message": "Internal Server Error", "error": str(e)}), 500
            
    @token_required()
    def get(self):
        """Fetch all guesses for the current user"""
        try:
            current_user = g.current_user
            guesses = Guess.query.filter_by(created_by=current_user.id).all()

            if not guesses:
                return jsonify({"message": "No guesses found", "recent_guesses": []}), 200  

            return jsonify({
                "message": "Guesses fetched successfully",
                "recent_guesses": [guess.read() for guess in guesses]
            }), 200

        except Exception as e:
            print("Error occurred while fetching guesses:", str(e))
            traceback.print_exc()
            return jsonify({"message": "Internal Server Error", "error": str(e)}), 500

    @token_required()
    def put(self):
        """Update an existing guess"""
        try:
            current_user = g.current_user
            data = request.get_json()

            if not data or "id" not in data or "user_guess" not in data or "correct_word" not in data:
                return jsonify({"message": "Missing required fields", "error": "Bad Request"}), 400

            guess = Guess.query.get(data["id"])
            if not guess:
                return jsonify({"message": "Guess not found", "error": "Not Found"}), 404

            if guess.created_by != current_user.id:
                return jsonify({"message": "Unauthorized to update this guess", "error": "Forbidden"}), 403

            guess.guess = data["user_guess"].strip().lower()
            guess.correct_answer = data["correct_word"].strip().lower()
            guess.is_correct = (guess.guess == guess.correct_answer)
            db.session.commit()  # Commit update

            return jsonify({"message": "Guess updated successfully", "guess": guess.read()}), 200

        except Exception as e:
            db.session.rollback()
            print("Error occurred while updating guess:", str(e))
            traceback.print_exc()
            return jsonify({"message": "Internal Server Error", "error": str(e)}), 500

    @token_required()
    def delete(self):
        """Delete a guess"""
        try:
            current_user = g.current_user
            data = request.get_json()

            if not data or "id" not in data:
                return jsonify({"message": "Missing required fields", "error": "Bad Request"}), 400

            guess = Guess.query.get(data["id"])
            if not guess:
                return jsonify({"message": "Guess not found", "error": "Not Found"}), 404

            if guess.created_by != current_user.id:
                return jsonify({"message": "Unauthorized to delete this guess", "error": "Forbidden"}), 403

            db.session.delete(guess)
            db.session.commit()  # Commit delete

            return jsonify({"message": "Guess deleted successfully"}), 200

        except Exception as e:
            db.session.rollback()
            print("Error occurred while deleting guess:", str(e))
            traceback.print_exc()
            return jsonify({"message": "Internal Server Error", "error": str(e)}), 500

# Register API endpoints
api.add_resource(_CRUD, '/guess')