Autosolver plugin for Testportal powered by ChatGPT
Version v2 is under active development. It will be packaged as a full-blown Chrome and Firefox extension (which means the plugin will not require Tampermonkey to work anymore). Other planned features are: support for MS Forms & Moodle, adding context information, GUI config menu and much more.
Testportal (https://testportal.net) is a popular site that allows users to create tests containing closed-ended and open-ended questions. The testportal-gpt project provides a browser plugin that enables automatic exercise solving using artificial intelligence.
- You need to obtain your own OpenAI API key:
https://platform.openai.com/account/ - Install the Tampermonkey browser extension
- Click here to call the user script installer
- Install the script by following on-screen instructions
- Edit the imported script and replace OPEN_AI_KEY constant with your OpenAI key.
- Open a test on Testportal - there should be a button with text "Auto-solve". Clicking this button will auto-solve the question using AI.
- You can use those example tests to check whether the plugin works correctly:
You can edit the userscript to change configuration of testportal-gpt-client.
// You have to provide a valid OpenAI key here
const OPEN_AI_KEY = "YOUR KEY HERE";
// Here you can switch from official testportal-gpt-api instance
// to your self-hosted one (see testportal-gpt-api docs for instructions)
const TESTPORTAL_GPT_API = "https://testportal-gpt.danielrogowski.net/questions";
// Please beware that GPT-4 models might not be available on all accounts
// And that GPT-4 calls are usually much slower than GPT-3.5
const TARGET_GPT_MODEL = "gpt-3.5-turbo"
// If true, the plugin will make auto-solve button barely visible
// and won't display the loading indicator.
const INCOGNITO_MODE = false;
- testportal-gpt-client
- Tampermonkey userscript written in JavaScript
- It is injected to Testportal website
- It scrapes current question, sends it to testportal-gpt-api, and selects the correct answer
- testportal-gpt-api
- Simple REST API written in Go
- it takes question, generates prompt for ChatGPT, proxies request to OpenAI API and returns
The plugin is intended to be used for learning purposes only. The owner of the repository is not responsible for any consequences caused by improper use of the plugin (e.g. at school)