vault backup: 2025-12-26 02:09:22
All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 2m29s
All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 2m29s
This commit is contained in:
63
stroma/quiz/migrations/0001_initial.py
Normal file
63
stroma/quiz/migrations/0001_initial.py
Normal file
@@ -0,0 +1,63 @@
|
||||
# Generated by Django
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='User',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('session_key', models.CharField(max_length=40, unique=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Question',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('file_path', models.CharField(max_length=500, unique=True)),
|
||||
('text', models.TextField()),
|
||||
('correct_answer', models.CharField(max_length=1)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='QuizResult',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('selected_answer', models.CharField(max_length=1)),
|
||||
('is_correct', models.BooleanField()),
|
||||
('answered_at', models.DateTimeField(auto_now_add=True)),
|
||||
('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='quiz.question')),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='results', to='quiz.user')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Option',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('letter', models.CharField(max_length=1)),
|
||||
('text', models.TextField()),
|
||||
('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='options', to='quiz.question')),
|
||||
],
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='quizresult',
|
||||
unique_together={('user', 'question')},
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='option',
|
||||
unique_together={('question', 'letter')},
|
||||
),
|
||||
]
|
||||
|
||||
18
stroma/quiz/migrations/0002_alter_question_correct_answer.py
Normal file
18
stroma/quiz/migrations/0002_alter_question_correct_answer.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 6.0 on 2025-12-21 19:25
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('quiz', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='question',
|
||||
name='correct_answer',
|
||||
field=models.CharField(max_length=50),
|
||||
),
|
||||
]
|
||||
18
stroma/quiz/migrations/0003_question_file_mtime.py
Normal file
18
stroma/quiz/migrations/0003_question_file_mtime.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 6.0 on 2025-12-21 19:32
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('quiz', '0002_alter_question_correct_answer'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='question',
|
||||
name='file_mtime',
|
||||
field=models.FloatField(blank=True, null=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,21 @@
|
||||
# Generated by Django 6.0 on 2025-12-21 19:46
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('quiz', '0003_question_file_mtime'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameModel(
|
||||
old_name='User',
|
||||
new_name='QuizUser',
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='quizuser',
|
||||
options={'verbose_name': 'Quiz User', 'verbose_name_plural': 'Quiz Users'},
|
||||
),
|
||||
]
|
||||
44
stroma/quiz/migrations/0005_course_exam_question_exam.py
Normal file
44
stroma/quiz/migrations/0005_course_exam_question_exam.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# Generated by Django 6.0 on 2025-12-21 20:10
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('quiz', '0004_rename_user_quizuser_alter_quizuser_options'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Course',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=200, unique=True)),
|
||||
('code', models.CharField(blank=True, max_length=50)),
|
||||
('description', models.TextField(blank=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Exam',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('date', models.DateField()),
|
||||
('name', models.CharField(blank=True, max_length=200)),
|
||||
('folder_path', models.CharField(blank=True, max_length=500)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='exams', to='quiz.course')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-date'],
|
||||
'unique_together': {('course', 'date')},
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='question',
|
||||
name='exam',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='questions', to='quiz.exam'),
|
||||
),
|
||||
]
|
||||
26
stroma/quiz/migrations/0006_tag_question_tags.py
Normal file
26
stroma/quiz/migrations/0006_tag_question_tags.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Generated by Django 6.0 on 2025-12-22 01:55
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('quiz', '0005_course_exam_question_exam'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Tag',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=50, unique=True)),
|
||||
('slug', models.SlugField(unique=True)),
|
||||
],
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='question',
|
||||
name='tags',
|
||||
field=models.ManyToManyField(blank=True, related_name='questions', to='quiz.tag'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,34 @@
|
||||
# Generated by Django 6.0 on 2025-12-22 11:06
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('quiz', '0006_tag_question_tags'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='QuizSession',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('course', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='quiz.course')),
|
||||
('exams', models.ManyToManyField(blank=True, to='quiz.exam')),
|
||||
('tags', models.ManyToManyField(blank=True, to='quiz.tag')),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quiz_sessions', to='quiz.quizuser')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-created_at'],
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='quizresult',
|
||||
name='quiz_session',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='results', to='quiz.quizsession'),
|
||||
),
|
||||
]
|
||||
18
stroma/quiz/migrations/0008_quizsession_question_types.py
Normal file
18
stroma/quiz/migrations/0008_quizsession_question_types.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 6.0 on 2025-12-22 11:07
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('quiz', '0007_quizsession_quizresult_quiz_session'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='quizsession',
|
||||
name='question_types',
|
||||
field=models.JSONField(blank=True, default=list),
|
||||
),
|
||||
]
|
||||
18
stroma/quiz/migrations/0009_quizresult_difficulty.py
Normal file
18
stroma/quiz/migrations/0009_quizresult_difficulty.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 6.0 on 2025-12-22 11:14
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('quiz', '0008_quizsession_question_types'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='quizresult',
|
||||
name='difficulty',
|
||||
field=models.CharField(blank=True, choices=[('again', 'Again'), ('hard', 'Hard'), ('good', 'Good'), ('easy', 'Easy')], max_length=10, null=True),
|
||||
),
|
||||
]
|
||||
23
stroma/quiz/migrations/0010_add_matching_question_fields.py
Normal file
23
stroma/quiz/migrations/0010_add_matching_question_fields.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 6.0 on 2025-12-22 14:36
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('quiz', '0009_quizresult_difficulty'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='question',
|
||||
name='matching_data',
|
||||
field=models.JSONField(blank=True, help_text='JSON data for matching questions: {left_items: [...], top_items: [...], correct_pairs: [[0,1], [1,2], ...]}', null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='question',
|
||||
name='question_type',
|
||||
field=models.CharField(choices=[('mcq', 'Multiple Choice'), ('scq', 'Single Choice'), ('matching', 'Matching'), ('textalternativ', 'Text Alternative'), ('textfält', 'Text Field')], default='mcq', max_length=20),
|
||||
),
|
||||
]
|
||||
34
stroma/quiz/migrations/0011_file.py
Normal file
34
stroma/quiz/migrations/0011_file.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# Generated by Django 6.0 on 2025-12-25 11:35
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('quiz', '0010_add_matching_question_fields'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='File',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(help_text='Display name or filename', max_length=500)),
|
||||
('path', models.CharField(blank=True, help_text='Path relative to content root', max_length=1000)),
|
||||
('mime_type', models.CharField(help_text='MIME type of the entity (e.g. application/pdf, application/x-folder)', max_length=100)),
|
||||
('text', models.TextField(blank=True, help_text='Text content, OCR, or embedded query')),
|
||||
('external_url', models.URLField(blank=True, help_text='External link (e.g. YouTube)')),
|
||||
('metadata', models.JSONField(blank=True, default=dict, help_text='Frontmatter (created_at, user, etc.)')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('parent', models.ForeignKey(blank=True, help_text='Parent folder or parent document (for sidecars/sub-entries)', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='quiz.file')),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='files', to='quiz.quizuser')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'File',
|
||||
'verbose_name_plural': 'Files',
|
||||
},
|
||||
),
|
||||
]
|
||||
18
stroma/quiz/migrations/0012_file_file_content.py
Normal file
18
stroma/quiz/migrations/0012_file_file_content.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 6.0 on 2025-12-25 12:26
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('quiz', '0011_file'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='file',
|
||||
name='file_content',
|
||||
field=models.FileField(blank=True, help_text='Uploaded file content', null=True, upload_to='uploads/'),
|
||||
),
|
||||
]
|
||||
16
stroma/quiz/migrations/0013_delete_file.py
Normal file
16
stroma/quiz/migrations/0013_delete_file.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Generated by Django 6.0 on 2025-12-25 13:14
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('quiz', '0012_file_file_content'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.DeleteModel(
|
||||
name='File',
|
||||
),
|
||||
]
|
||||
1
stroma/quiz/migrations/__init__.py
Normal file
1
stroma/quiz/migrations/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# Migrations
|
||||
Reference in New Issue
Block a user