AI-Powered Quiz Assistant (Chrome Extension)
This commit is contained in:
+172
@@ -0,0 +1,172 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
body {
|
||||
width: 320px;
|
||||
padding: 15px;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
h3 {
|
||||
margin: 0 0 10px 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
.toggle-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 50px;
|
||||
height: 24px;
|
||||
}
|
||||
.switch input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
.slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #ccc;
|
||||
transition: .4s;
|
||||
border-radius: 24px;
|
||||
}
|
||||
.slider:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 18px;
|
||||
width: 18px;
|
||||
left: 3px;
|
||||
bottom: 3px;
|
||||
background-color: white;
|
||||
transition: .4s;
|
||||
border-radius: 50%;
|
||||
}
|
||||
input:checked + .slider {
|
||||
background-color: #4CAF50;
|
||||
}
|
||||
input:checked + .slider:before {
|
||||
transform: translateX(26px);
|
||||
}
|
||||
#status {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.info {
|
||||
font-size: 11px;
|
||||
color: #888;
|
||||
margin-top: 10px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.api-section {
|
||||
margin-top: 15px;
|
||||
padding-top: 15px;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
.api-section label {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
margin-bottom: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.api-section input[type="text"] {
|
||||
width: 100%;
|
||||
padding: 6px;
|
||||
font-size: 11px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.api-section button {
|
||||
width: 100%;
|
||||
padding: 6px;
|
||||
font-size: 11px;
|
||||
background: #0078d4;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.api-section button:hover {
|
||||
background: #106ebe;
|
||||
}
|
||||
.api-status {
|
||||
font-size: 11px;
|
||||
margin-top: 5px;
|
||||
padding: 5px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.api-status.success {
|
||||
background: #d4edda;
|
||||
color: #155724;
|
||||
}
|
||||
.api-status.error {
|
||||
background: #f8d7da;
|
||||
color: #721c24;
|
||||
}
|
||||
.warning {
|
||||
background: #fff3cd;
|
||||
border: 1px solid #ffc107;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
font-size: 11px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.warning strong {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h3>Quiz Helper</h3>
|
||||
|
||||
<div class="warning">
|
||||
<strong>⚠️ API Key Required</strong>
|
||||
This extension requires an OpenAI API key to work. Add your key below to get started.
|
||||
</div>
|
||||
|
||||
<div class="api-section">
|
||||
<label>OpenAI API Key (Required):</label>
|
||||
<input type="text" id="apiKey" placeholder="sk-..." />
|
||||
<button id="saveApiKey">Save API Key</button>
|
||||
<div id="apiStatus" class="api-status" style="display: none;"></div>
|
||||
<div class="info">
|
||||
Get a free API key at <a href="https://platform.openai.com/api-keys" target="_blank">platform.openai.com</a>.
|
||||
New accounts get $5 in free credits. Cost per question: ~$0.001 (1/10th of a cent).
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="toggle-container">
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="toggleSwitch">
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
<span id="toggleLabel">Off</span>
|
||||
</div>
|
||||
|
||||
<div id="status"></div>
|
||||
|
||||
<div class="info">
|
||||
When enabled, ChatGPT will analyze quiz questions and highlight answers:
|
||||
<ul style="margin: 5px 0; padding-left: 20px; font-size: 11px;">
|
||||
<li><strong style="color: #28a745;">Green</strong> = ChatGPT identified correct answer(s)</li>
|
||||
<li><strong style="color: #dc3545;">Red</strong> = ChatGPT failed, you need to guess</li>
|
||||
</ul>
|
||||
Check the browser console (F12) for detailed logs.
|
||||
</div>
|
||||
|
||||
<script src="popup.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user