NPTEL Auto Answer

Auto selects answers on NPTEL assignments

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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();
});