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!

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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."));