6 Commits

Author SHA1 Message Date
yoannchb-pro 921e2bba4e Merge branch 'dev' 2025-10-01 09:30:19 +02:00
yoannchb-pro 3591aceba1 v1.1.5 2025-10-01 09:28:48 +02:00
yoannchb-pro 17aa8b49e0 Merge pull request #61 from yoannchb-pro/dev
Dev
2025-07-30 11:14:23 -04:00
yoannchb-pro a2849da20c v1.1.4 2025-07-30 11:12:44 -04:00
yoannchb-pro 54c9373e33 Merge pull request #58 from LuckyForce/main
Solves #57 for o3
2025-07-30 10:52:03 -04:00
Adrian Schauer e793cbd0b2 #57 addtion of o3 2025-07-10 17:01:10 +02:00
15 changed files with 701 additions and 849 deletions
+10
View File
@@ -1,5 +1,15 @@
# CHANGELOG
## v1.1.5
- Support for gpt-5
## 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 -2
View File
@@ -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.5
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.5](#moodlegpt-115)
- [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 -1
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "MoodleGPT",
"version": "1.1.3",
"version": "1.1.5",
"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
+657 -810
View File
File diff suppressed because it is too large Load Diff
+14 -13
View File
@@ -1,6 +1,6 @@
{
"name": "moodlegpt",
"version": "1.1.3",
"version": "1.1.5",
"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.23.2",
"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"
}
}
+2
View File
@@ -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 -6
View File
@@ -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,14 +30,11 @@ async function getChatGPTResponse(
});
const req = await client.chat.completions.create(
fixeO1(config.model, {
fixeO(config.model, {
model: config.model,
messages: contentHandler.messages,
temperature: 0.1, // Controls the randomness of the generated responses, with lower values producing more deterministic and predictable outputs. With set to 0.1 instead of 0 for more creativity.
top_p: 0.6, // Determines the diversity of the generated responses
presence_penalty: 0, // Encourages the model to introduce new concepts by penalizing words that have already appeared in the text.
max_tokens: config.maxTokens || 2000 // Maximum length of the response,
max_completion_tokens: config.maxTokens || 2000 // Maximum length of the response,
}),
{ signal: config.timeout ? controller.signal : null }
);
@@ -6,13 +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;
if (data.max_tokens) {
data.max_completion_tokens = data.max_tokens;
delete data.max_tokens;
}
export function fixeO(model: string, data: ChatCompletionCreateParamsNonStreaming) {
if (model.search(/^o\d+/gi) === -1) return data;
if (data.temperature) delete data.temperature;
+3 -1
View File
@@ -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 -1
View File
@@ -1,4 +1,4 @@
const CURRENT_VERSION = '1.1.3';
const CURRENT_VERSION = '1.1.5';
const versionDisplay = document.querySelector('#version')!;
/**
+2 -4
View File
@@ -2,15 +2,13 @@
"compilerOptions": {
"strict": true,
"baseUrl": "src",
"module": "ESNext",
"module": "esnext",
"target": "ES6",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"target": "ES6",
"noImplicitAny": true,
"moduleResolution": "node",
"sourceMap": true,
"outDir": "extension",
"resolveJsonModule": true,
"types": ["node", "chrome"],
"typeRoots": ["node_modules/@types"],
"strictBindCallApply": true