Skip to content

Commit

Permalink
v1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yoannchb-pro committed Jan 14, 2025
1 parent ea57a31 commit 16a82fe
Show file tree
Hide file tree
Showing 50 changed files with 404 additions and 243 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ module.exports = {
overrides: [
{
files: ['extension/popup/*.js', 'src/**/*.ts'],
rules: {}
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'no-constant-condition': 'off'
}
}
]
};
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## v1.1.2

- Advanced settings
- Added OpenAI SDK for better support
- o1 model support

## v1.1.1

- Bugs correction
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.1
# MoodleGPT 1.1.2

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.

Expand All @@ -12,7 +12,7 @@ Find the extension on the Chrome Webstore right [here](https://chrome.google.com

## Summary

- [MoodleGPT 1.1.1](#moodlegpt-111)
- [MoodleGPT 1.1.2](#moodlegpt-112)
- [Chrome Webstore](#chrome-webstore)
- [Summary](#summary)
- [Disclaimer !](#disclaimer-)
Expand Down
2 changes: 1 addition & 1 deletion extension/MoodleGPT.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion extension/MoodleGPT.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "MoodleGPT",
"version": "1.1.1",
"version": "1.1.2",
"description": "Hidden chat-gpt for your moodle quiz",
"permissions": ["storage"],
"action": {
Expand Down
50 changes: 30 additions & 20 deletions extension/popup/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@
<title>MoodleGPT</title>
<link rel="stylesheet" href="style.css" />

<!-- Should always be at the top -->
<script src="./js/utils.js" defer></script>

<script src="./js/index.js" defer></script>
<script src="./js/modeHandler.js" defer></script>
<script src="./js/gptVersion.js" defer></script>
<script src="./js/version.js" defer></script>
<script src="./popup.js" defer></script>

<link rel="icon" type="image/png" href="../icon.png" />
<link
Expand Down Expand Up @@ -41,20 +35,35 @@ <h1>MoodleGPT</h1>
<p id="version"></p>
</div>
</div>
<div class="line center">
<label for="apiKey" class="textLabel">Api Key<span class="required">*</span>:</label>
<input id="apiKey" type="text" />

<!-- SETTINGS -->
<div class="settings" id="settings">
<div class="line center">
<label for="apiKey" class="textLabel">Api Key<span class="required">*</span>:</label>
<input id="apiKey" type="text" />
</div>
<div class="line center">
<label for="model" class="textLabel">GPT Model<span class="required">*</span>:</label>
<input type="text" id="model" list="models" />
<datalist id="models"></datalist>
<i id="check-model" title="Test" style="cursor: pointer" class="fa-solid fa-play"></i>
</div>
</div>
<div class="line center">
<label for="model" class="textLabel">GPT Model<span class="required">*</span>:</label>
<input type="text" id="model" list="models" />
<datalist id="models"></datalist>

<!-- ADVANCED SETTINGS -->
<div class="settings" id="advanced-settings" style="display: none">
<div class="line center">
<label for="code" class="textLabel">Code:</label>
<input id="code" type="text" />
</div>
</div>
<div class="line center">
<label for="code" class="textLabel">Code:</label>
<input id="code" type="text" />

<!-- SWITCH SETTINGS MODE -->
<div class="line center mt">
<a id="switch-settings" href="#">Advanced settings</a>
</div>
<div class="line mt">

<div class="line center-y mt">
<i class="fa-solid fa-robot"></i>
<p>Mode:</p>
</div>
Expand All @@ -69,9 +78,9 @@ <h1>MoodleGPT</h1>
</li>
</ul>
</div>
<div class="line mt">
<div class="line mt center-y">
<i class="fa-solid fa-gear"></i>
<p>Settings:</p>
<p>Options:</p>
</div>
<div class="line center" style="gap: 2rem">
<div class="col">
Expand Down Expand Up @@ -122,6 +131,7 @@ <h1>MoodleGPT</h1>
</div>
<div class="line center">
<a
class="donate"
href="https://www.buymeacoffee.com/yoannchbpro"
target="_blank"
rel="noopener noreferrer"
Expand Down
54 changes: 0 additions & 54 deletions extension/popup/js/gptVersion.js

This file was deleted.

25 changes: 0 additions & 25 deletions extension/popup/js/utils.js

This file was deleted.

2 changes: 2 additions & 0 deletions extension/popup/popup.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions extension/popup/popup.js.map

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions extension/popup/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ main {
width: 22rem;
}

.settings {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.4rem;
text-align: center;
width: 100%;
}

img {
width: 5rem;
}
Expand All @@ -56,6 +65,10 @@ a {
align-items: center;
}

.center-y {
align-items: center;
}

.line .textLabel {
width: 5rem;
text-align: left;
Expand Down Expand Up @@ -148,3 +161,33 @@ a {
cursor: not-allowed;
opacity: 0.75;
}

.donate {
color: white;
animation: infinite donate 5s linear;
font-weight: bold;
}

@keyframes donate {
0% {
transform: translateX(0);
}
3.57% {
transform: translateY(-9px);
}
7.14% {
transform: translateY(-9px) rotate(17deg);
}
10.78% {
transform: translateY(-9px) rotate(-17deg);
}
14% {
transform: translateY(-9px) rotate(17deg);
}
18% {
transform: translateY(-9px) rotate(-17deg);
}
22% {
transform: translateY(0) rotate(0);
}
}
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moodlegpt",
"version": "1.1.1",
"version": "1.1.2",
"description": "This extension allows you to hide CHAT-GPT in a Moodle quiz.",
"scripts": {
"build": "npm run prettier && npm run lint && npm run fastBuild",
Expand All @@ -26,12 +26,16 @@
},
"homepage": "https://github.com/yoannchb-pro/MoodleGPT#readme",
"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-terser": "^0.4.4",
"@types/chrome": "^0.0.263",
"@rollup/plugin-typescript": "^12.1.2",
"@types/chrome": "^0.0.294",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"openai": "^4.78.1",
"prettier": "^3.2.5",
"rollup": "^4.13.0",
"rollup-plugin-ts": "^3.2.0",
Expand Down
31 changes: 22 additions & 9 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
const ts = require('rollup-plugin-ts');
const ts = require('@rollup/plugin-typescript');
const terser = require('@rollup/plugin-terser');
const { nodeResolve } = require('@rollup/plugin-node-resolve');

const config = require('./tsconfig.json');

module.exports = {
input: './src/index.ts',
output: [
{
module.exports = [
{
input: './src/background/index.ts',
output: {
file: './extension/MoodleGPT.js',
format: 'umd',
sourcemap: true
}
],
plugins: [ts(config), terser()]
};
},
onwarn() {},
plugins: [nodeResolve(), ts(config), terser()]
},

{
input: './src/popup/index.ts',
output: {
file: './extension/popup/popup.js',
format: 'umd',
sourcemap: true
},
onwarn() {},
plugins: [nodeResolve(), ts(config), terser()]
}
];
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type Config from '@typing/config';
import titleIndications from '@utils/title-indications';
import type Config from '../types/config';
import titleIndications from 'background/utils/title-indications';
import reply from './reply';

type Listener = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import normalizeText from '@utils/normalize-text';
import htmlTableToString from '@utils/html-table-to-string';
import normalizeText from 'background/utils/normalize-text';
import htmlTableToString from 'background/utils/html-table-to-string';

/**
* Normalize the question as text and add sub informations
Expand Down
Loading

0 comments on commit 16a82fe

Please sign in to comment.