Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 17aa8b49e0 | |||
| a2849da20c | |||
| 54c9373e33 | |||
| e793cbd0b2 |
@@ -1,5 +1,11 @@
|
||||
# CHANGELOG
|
||||
|
||||
## v1.1.4
|
||||
|
||||
- Support for all `o` models
|
||||
- Removed `Clear my choice` in the api call
|
||||
- Code dependencies update
|
||||
|
||||
## v1.1.3
|
||||
|
||||
- Added `base url` and `max token` in config (by dmunozv04)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
href="https://www.flaticon.com/free-icons/mortarboard" target="_blank" rel="noopener noreferrer"
|
||||
title="Mortarboard icons created by itim2101 - Flaticon" ><img src="./extension/icon.png" alt="Mortarboard icons created by itim2101 - Flaticon" width="150" style="display:block; margin:auto;"></a></p>
|
||||
|
||||
# MoodleGPT 1.1.3
|
||||
# MoodleGPT 1.1.4
|
||||
|
||||
This extension allows you to hide CHAT-GPT in a Moodle quiz. You just need to click on the question you want to solve, and CHAT-GPT will automatically provide the answer. However, one needs to be careful because as we know, CHAT-GPT can make errors especially in calculations.
|
||||
|
||||
@@ -12,7 +12,7 @@ Find the extension on the Chrome Webstore right [here](https://chrome.google.com
|
||||
|
||||
## Summary
|
||||
|
||||
- [MoodleGPT 1.1.3](#moodlegpt-113)
|
||||
- [MoodleGPT 1.1.4](#moodlegpt-114)
|
||||
- [Chrome Webstore](#chrome-webstore)
|
||||
- [Summary](#summary)
|
||||
- [Disclaimer !](#disclaimer-)
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "MoodleGPT",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.4",
|
||||
"description": "Hidden chat-gpt for your moodle quiz",
|
||||
"permissions": ["storage"],
|
||||
"action": {
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Generated
+657
-810
File diff suppressed because it is too large
Load Diff
+14
-13
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "moodlegpt",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.4",
|
||||
"description": "This extension allows you to hide CHAT-GPT in a Moodle quiz.",
|
||||
"scripts": {
|
||||
"build": "npm run prettier && npm run lint && npm run fastBuild",
|
||||
@@ -26,21 +26,22 @@
|
||||
},
|
||||
"homepage": "https://github.com/yoannchb-pro/MoodleGPT#readme",
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.22.0",
|
||||
"@rollup/plugin-commonjs": "^28.0.2",
|
||||
"@eslint/js": "^9.32.0",
|
||||
"@rollup/plugin-commonjs": "^28.0.6",
|
||||
"@rollup/plugin-node-resolve": "^16.0.0",
|
||||
"@rollup/plugin-terser": "^0.4.4",
|
||||
"@rollup/plugin-typescript": "^12.1.2",
|
||||
"@types/chrome": "^0.0.309",
|
||||
"@rollup/plugin-typescript": "^12.1.4",
|
||||
"@types/chrome": "^0.1.1",
|
||||
"@types/node": "^24.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
||||
"@typescript-eslint/parser": "^8.26.1",
|
||||
"eslint": "^9.22.0",
|
||||
"eslint-config-prettier": "^10.1.1",
|
||||
"openai": "^4.78.1",
|
||||
"prettier": "^3.2.5",
|
||||
"rollup": "^4.13.0",
|
||||
"@typescript-eslint/parser": "^8.38.0",
|
||||
"eslint": "^9.32.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"openai": "^5.11.0",
|
||||
"prettier": "^3.6.2",
|
||||
"rollup": "^4.46.2",
|
||||
"rollup-plugin-ts": "^3.2.0",
|
||||
"typescript": "^5.4.2",
|
||||
"typescript-eslint": "^8.26.1"
|
||||
"typescript": "^5.8.3",
|
||||
"typescript-eslint": "^8.38.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ function createAndNormalizeQuestion(questionContainer: HTMLElement) {
|
||||
if (attoText) {
|
||||
question = question.replace((attoText as HTMLElement).innerText, '');
|
||||
}
|
||||
const clearMyChoice = questionContainer.querySelector('[role="button"]');
|
||||
if (clearMyChoice) question = question.replace((clearMyChoice as HTMLElement).innerText, '');
|
||||
|
||||
// Make tables more readable for chat-gpt
|
||||
const tables: NodeListOf<HTMLTableElement> = questionContainer.querySelectorAll('.qtext table');
|
||||
|
||||
@@ -3,7 +3,7 @@ import type GPTAnswer from '../types/gpt-answer';
|
||||
import normalizeText from 'background/utils/normalize-text';
|
||||
import getContentWithHistory from './get-content-with-history';
|
||||
import OpenAI from 'openai';
|
||||
import { fixeO1 } from '../utils/fixe-o1';
|
||||
import { fixeO } from '../utils/fixe-o';
|
||||
|
||||
/**
|
||||
* Get the response from chatGPT api
|
||||
@@ -30,7 +30,7 @@ async function getChatGPTResponse(
|
||||
});
|
||||
|
||||
const req = await client.chat.completions.create(
|
||||
fixeO1(config.model, {
|
||||
fixeO(config.model, {
|
||||
model: config.model,
|
||||
messages: contentHandler.messages,
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import { ChatCompletionCreateParamsNonStreaming } from 'openai/resources/chat/co
|
||||
* @param data
|
||||
* @returns
|
||||
*/
|
||||
export function fixeO1(model: string, data: ChatCompletionCreateParamsNonStreaming) {
|
||||
if (!model.startsWith('o1')) return data;
|
||||
export function fixeO(model: string, data: ChatCompletionCreateParamsNonStreaming) {
|
||||
if (model.search(/^o\d+/gi) === -1) return data;
|
||||
|
||||
if (data.max_tokens) {
|
||||
data.max_completion_tokens = data.max_tokens;
|
||||
@@ -40,7 +40,9 @@ export async function populateDatalistWithGptVersions() {
|
||||
|
||||
const models = rep.data.filter(
|
||||
model =>
|
||||
model.id.startsWith('gpt') || model.id.startsWith('o1') || model.id.startsWith('chatgpt')
|
||||
model.id.startsWith('gpt') ||
|
||||
model.id.search(/^o\d+/gi) !== -1 ||
|
||||
model.id.startsWith('chatgpt')
|
||||
);
|
||||
models.sort((a, b) => b.id.localeCompare(a.id)); // we sort the model to get the best chatgpt version first
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const CURRENT_VERSION = '1.1.3';
|
||||
const CURRENT_VERSION = '1.1.4';
|
||||
const versionDisplay = document.querySelector('#version')!;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user