NPTEL Auto Answer

Auto selects answers on NPTEL assignments

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         NPTEL Auto Answer
// @namespace    http://tampermonkey.net/
// @version      2.1
// @description  Auto selects answers on NPTEL assignments
// @license      MIT
// @match        https://onlinecourses.nptel.ac.in/*
// @match        http://onlinecourses.nptel.ac.in/*
// @match        *://onlinecourses.nptel.ac.in/*
// @grant        GM_xmlhttpRequest
// @connect      gist.githubusercontent.com
// ==/UserScript==

function runAnswers() {
  GM_xmlhttpRequest({
    method: 'GET',
    url: 'https://gist.githubusercontent.com/yousuff22/582ff81d350af302a2609a233dd60aea/raw/nptel-answers.js',
    onload: function(res) {
      var fn = new Function(res.responseText);
      fn();
      alert('Done! Answers selected.');
    }
  });
}

function addButton() {
  // Don't add if already exists
  if (document.getElementById('nptel-auto-btn')) return;

  var btn = document.createElement('button');
  btn.id = 'nptel-auto-btn';
  btn.innerText = '▶ NPTEL Auto';
  btn.style.position = 'fixed';
  btn.style.bottom = '30px';
  btn.style.right = '30px';
  btn.style.zIndex = '99999';
  btn.style.background = '#7c3aed';
  btn.style.color = 'white';
  btn.style.border = 'none';
  btn.style.padding = '12px 20px';
  btn.style.borderRadius = '10px';
  btn.style.fontSize = '14px';
  btn.style.fontWeight = 'bold';
  btn.style.cursor = 'pointer';
  btn.style.boxShadow = '0 4px 20px rgba(124,58,237,0.5)';
  btn.addEventListener('click', runAnswers);
  document.body.appendChild(btn);
}

// Wait for page to fully load then add button
window.addEventListener('load', function() {
  setTimeout(addButton, 2000);
});

// Also try immediately in case page already loaded
setTimeout(addButton, 2000);

// Keyboard shortcut Alt+Q
document.addEventListener('keydown', function(e) {
  if (e.altKey && e.key === 'q') runAnswers();
});