Sparx Maths Pro

This is Sparx Maths Pro, a tool for cheating on sparx math! This allows for more xp and auto answers. Currently Beta 1.0 is under development, check back soon!

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @match sparxmaths.uk
// @name Sparx Maths Pro
// @description This is Sparx Maths Pro, a tool for cheating on sparx math! This allows for more xp and auto answers. Currently Beta 1.0 is under development, check back soon!
// @version 1.0
// @namespace https://greasyfork.org/users/1580737
// ==/UserScript==
const VERSION_NUMBER = "01.0";

// SPARX MATH – Learning Helper Script
// Supports understanding, gives hints, breaks down maths questions safely.

const sparxMathHelper = {

    // Break down a maths question into thinking steps
    breakdownQuestion(question) {
        return [
            "Identify the maths topic (fractions, algebra, ratio, area, etc).",
            "Underline keywords that tell you what to do.",
            "Check if the question wants you to simplify, solve, calculate, or describe.",
            "Find the formula or rule that matches the topic."
        ];
    },

    // Topic explanations (short + safe)
    explainTopic(topic) {
        const t = topic.toLowerCase();

        if (t.includes("fractions")) {
            return "Fractions represent parts of a whole. Think about simplifying, common denominators, or multiplying.";
        }
        if (t.includes("algebra")) {
            return "Algebra uses letters to represent numbers. Focus on balancing equations and simplifying expressions.";
        }
        if (t.includes("ratio")) {
            return "Ratios compare quantities. Think about scaling up/down or sharing in a ratio.";
        }
        if (t.includes("percent")) {
            return "Percentages are out of 100. Think about increase, decrease, or finding a percentage of an amount.";
        }
        if (t.includes("area")) {
            return "Area measures the space inside a shape. Use the correct formula for the shape.";
        }
        if (t.includes("perimeter")) {
            return "Perimeter is the distance around a shape. Add all the side lengths.";
        }
        if (t.includes("equation")) {
            return "Equations show two equal values. Use inverse operations to isolate the variable.";
        }

        return "Think about the core rule or formula for this topic.";
    },

    // Calculation scaffolding (no answers)
    calculationSteps(type) {
        const t = type.toLowerCase();

        if (t.includes("fraction")) {
            return [
                "Check if you need to simplify first.",
                "Find a common denominator if adding or subtracting.",
                "Multiply numerators and denominators if multiplying.",
                "Flip the second fraction if dividing."
            ];
        }
        if (t.includes("ratio")) {
            return [
                "Identify the parts of the ratio.",
                "Find the total number of parts if sharing.",
                "Divide the amount by total parts.",
                "Multiply by each part of the ratio."
            ];
        }
        if (t.includes("percentage")) {
            return [
                "Convert the percentage to a decimal (e.g., 20% → 0.20).",
                "Multiply the decimal by the amount.",
                "For increase/decrease, add or subtract the result."
            ];
        }
        if (t.includes("area")) {
            return [
                "Identify the shape.",
                "Recall the correct formula (e.g., rectangle = length × width).",
                "Substitute the values into the formula.",
                "Check units (cm², m²)."
            ];
        }
        if (t.includes("perimeter")) {
            return [
                "List all side lengths.",
                "Add them together.",
                "Check if any sides are missing or equal."
            ];
        }
        if (t.includes("equation")) {
            return [
                "Identify the variable.",
                "Use inverse operations to isolate it.",
                "Do the same to both sides.",
                "Check your solution by substituting back in."
            ];
        }

        return ["Identify the rule or formula.", "List known values.", "Substitute them into the formula."];
    },

    // General maths hints
    generalHints() {
        return [
            "Underline keywords like simplify, solve, calculate, express.",
            "Check if the question gives units — they often hint at the method.",
            "Draw a diagram if the problem involves shapes or geometry.",
            "Rewrite the question in your own words to understand it better."
        ];
    },

    // Generate a hint based on question wording
    generateHint(question) {
        const q = question.toLowerCase();

        if (q.includes("simplify")) {
            return "Look for like terms or common factors.";
        }
        if (q.includes("solve")) {
            return "Use inverse operations to isolate the variable.";
        }
        if (q.includes("work out") || q.includes("calculate")) {
            return "Identify the formula or rule needed.";
        }
        if (q.includes("express")) {
            return "Rewrite the value in the form the question asks for.";
        }

        return "Focus on the key maths idea behind the question.";
    }
};

// Example usage:
console.log(sparxMathHelper.explainTopic("Fractions"));
console.log(sparxMathHelper.calculationSteps("percentage"));
console.log(sparxMathHelper.generateHint("Simplify the expression 3x + 2x."));