Skip to content

Commit a1fa63a

Browse files
committed
feat: Update Python version, fix frontend paths, and enhance exam instructions
- Update GitHub Actions to use Python 3.13 - Fix frontend API paths to use relative URLs instead of hardcoded localhost - Add audio-test.mp3 to PyInstaller bundle and resource copying - Update exam instructions with proper TTS audio test message - Add completed_exams.json to .gitignore - Fix file permissions for portable Linux builds
1 parent 76e6b44 commit a1fa63a

File tree

8 files changed

+20
-7
lines changed

8 files changed

+20
-7
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ubuntu-latest, windows-latest]
17-
python-version: ['3.11']
17+
python-version: ['3.13']
1818

1919
steps:
2020
- uses: actions/checkout@v4
@@ -60,6 +60,7 @@ jobs:
6060
run: |
6161
mkdir -p dist/Echo-Portable
6262
cp dist/Echo dist/Echo-Portable/
63+
chmod +x dist/Echo dist/Echo-Portable/Echo
6364
cp README.md dist/Echo-Portable/ 2>/dev/null || true
6465
6566
- name: Create portable package (Windows)

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ audio_cache/tts/*
6868
# Secrets
6969
config.yaml
7070
!config.yaml.example
71+
completed_exams.json
7172

7273
# Development files
7374
test_files

audio_cache/tts/audio-test.mp3

242 KB
Binary file not shown.

backend/paths.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ def copy_default_files(self, source_base: Path):
9999
import shutil
100100
shutil.copy(exam_file, self.exams_dir)
101101

102+
# Copy audio-test.mp3 if it doesn't exist
103+
audio_test_file = self.tts_cache / "audio-test.mp3"
104+
if not audio_test_file.exists():
105+
source_audio_test = source_base / "audio_cache" / "tts" / "audio-test.mp3"
106+
if source_audio_test.exists():
107+
import shutil
108+
shutil.copy(source_audio_test, audio_test_file)
109+
print(f"Copied audio-test.mp3 to {audio_test_file}")
110+
102111
def get_bundled_path(self, relative_path: str) -> Path:
103112
"""Get path to bundled resources (for PyInstaller)."""
104113
if getattr(sys, 'frozen', False):

echo.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ a = Analysis(
1313
('config.yaml.example', '.'),
1414
('prompts', 'prompts'),
1515
('exams', 'exams'),
16+
# Audio files
17+
('audio_cache/tts/audio-test.mp3', 'audio_cache/tts'),
1618
# Include audio_cache directory structure (empty directories will be created)
1719
('audio_cache', 'audio_cache'),
1820
],

exams/exam-2098.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exam:
55
section_instructions:
66
read_aloud:
77
text: "For read aloud questions, you should read displayed English sentences aloud."
8-
tts: "For read aloud questions, you should read displayed English sentences aloud"
8+
tts: "Can you hear this clearly? This is a test to make sure your audio is working perfectly. Please listen carefully and get ready for your English exam!Can you hear this clearly? This is a test to make sure your audio is working perfectly. Please listen carefully and get ready for your English exam!Can you hear this clearly? This is a test to make sure your audio is working perfectly. Please listen carefully and get ready for your English exam!"
99

1010
multiple_choice:
1111
text: "For multiple choice questions, read the question carefully and choose the best answer from A, B, C or D."

frontend/src/components/FileConverter.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export default {
274274
const filenames = selectedFiles.value.map(file => file.name)
275275
276276
// Send to backend
277-
const response = await fetch('http://localhost:8000/convert/file', {
277+
const response = await fetch('/convert/file', {
278278
method: 'POST',
279279
headers: {
280280
'Content-Type': 'application/json',
@@ -365,7 +365,7 @@ export default {
365365
}
366366
367367
try {
368-
const renameResponse = await fetch('http://localhost:8000/rename-exam', {
368+
const renameResponse = await fetch('/rename-exam', {
369369
method: 'POST',
370370
headers: {
371371
'Content-Type': 'application/json',

frontend/src/components/Settings.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export default {
194194
195195
const loadSettings = async () => {
196196
try {
197-
const response = await fetch('http://localhost:8000/settings')
197+
const response = await fetch('/settings')
198198
const data = await response.json()
199199
200200
if (data.success) {
@@ -216,7 +216,7 @@ export default {
216216
apiTestResult.value = null
217217
218218
try {
219-
const response = await fetch('http://localhost:8000/test-api', {
219+
const response = await fetch('/test-api', {
220220
method: 'POST',
221221
headers: {
222222
'Content-Type': 'application/json'
@@ -251,7 +251,7 @@ export default {
251251
saveResult.value = null
252252
253253
try {
254-
const response = await fetch('http://localhost:8000/settings', {
254+
const response = await fetch('/settings', {
255255
method: 'POST',
256256
headers: {
257257
'Content-Type': 'application/json'

0 commit comments

Comments
 (0)