📲 Download Utility Tools Apps

EMI Calculator

Download EMI Calculator

SOA Games

Download SOA Games

SOA Technology App

Download SOA Technology

BMI Checker

Download BMI Checker

Task Jira

Download Task Jira

Laughing Adda

Download Laughing Adda

📅 हिंदी कैलेंडर ऐप डाउनलोड करें

Download Shubhcalendar App

Auto grading system (PHP)

I’ve created a basic auto-grading PHP system for you in the canvas.

🔍 What this system does:

  • Takes student answers via form
  • Compares with correct answers
  • Assigns marks automatically
  • Displays total score

🚀 How to use it:

  1. Copy the code into a file like:
    auto-grade.php
  2. Run in:
    • XAMPP (localhost/auto-grade.php)
    • Your website (SOA Technology 😉)
  3. Students enter answers → system checks instantly ✅
<?php
// ==============================
// PHP Auto Grading System
// ==============================

$totalMarks = 0;

// Function to check answer
function check($studentAnswer, $correctAnswer, $marks) {
    global $totalMarks;
    if ($studentAnswer == $correctAnswer) {
        $totalMarks += $marks;
        return "Correct (+$marks)";
    } else {
        return "Wrong (0)";
    }
}

// ==============================
// Student Answers (via form)
// ==============================
$q1 = $_POST['q1'] ?? '';
$q2 = $_POST['q2'] ?? '';
$q3 = $_POST['q3'] ?? '';
$q4 = $_POST['q4'] ?? '';
$q5 = $_POST['q5'] ?? '';

// ==============================
// Correct Answers (Expected Output)
// ==============================
$answers = [
    "q1" => "150",      // sum of numbers
    "q2" => "5",        // count of fruits
    "q3" => "Aditya",   // name output
    "q4" => "90",       // highest marks
    "q5" => "3"         // total students
];

// ==============================
// Checking Answers
// ==============================
$result = [];
$result['q1'] = check($q1, $answers['q1'], 10);
$result['q2'] = check($q2, $answers['q2'], 10);
$result['q3'] = check($q3, $answers['q3'], 10);
$result['q4'] = check($q4, $answers['q4'], 10);
$result['q5'] = check($q5, $answers['q5'], 10);

// ==============================
// Display Result
// ==============================
echo "<h2>Result</h2>";

foreach ($result as $q => $res) {
    echo strtoupper($q) . ": " . $res . "<br>";
}

echo "<h3>Total Marks: $totalMarks / 50</h3>";
?>


<!-- ==============================
Student Form
============================== -->

<form method="POST">
    <h3>PHP Arrays Test</h3>

    Q1: Sum of array = <input type="text" name="q1"><br><br>
    Q2: Total fruits = <input type="text" name="q2"><br><br>
    Q3: Student name = <input type="text" name="q3"><br><br>
    Q4: Highest marks = <input type="text" name="q4"><br><br>
    Q5: Total students = <input type="text" name="q5"><br><br>

    <button type="submit">Submit</button>
</form>

⚠️ Important Note (Realistic Limitation)

This system checks final answers only, not full code.

👉 If you want real coding evaluation, you need:

  • Code execution sandbox
  • Output comparison system
  • Or manual checking


AI Spiritual Tools & Interactive Experiences

Explore powerful AI-driven tools for daily guidance, spirituality, fun quizzes, and self-discovery.

Today’s Quote

Get inspiring daily quotes powered by AI to motivate and guide your day.

Explore Now

AI Tarot Card Reader

Reveal insights about your future, love, and career with AI tarot readings.

Read Tarot

Love Match Calculator

Check compatibility and love predictions using AI-based analysis.

Check Match

Fortune Cookie

Open an AI fortune cookie and receive wisdom, luck, and fun messages.

Open Cookie

Quiz Categories

Engage with knowledge-based and fun quizzes across multiple categories.

Start Quiz

Panchang Calendar

View daily Panchang, auspicious timings, tithi, nakshatra, and festivals.

View Panchang

Online Numerology

Discover your destiny number, life path, and numerology predictions.

Calculate Now

Spiritual Feeds

Stay connected with spiritual thoughts, mantras, and divine content.

View Feeds

Quiz Hub

Attempt trending quizzes on GK, spirituality, festivals, and more.

Explore Quizzes