|
| 1 | +# Generated by Django 4.2.14 on 2025-09-16 07:56 |
| 2 | + |
| 3 | +from django.conf import settings |
| 4 | +from django.db import migrations, models |
| 5 | +import django.db.models.deletion |
| 6 | + |
| 7 | + |
| 8 | +class Migration(migrations.Migration): |
| 9 | + |
| 10 | + dependencies = [ |
| 11 | + ('home', '0001_initial'), |
| 12 | + ] |
| 13 | + |
| 14 | + operations = [ |
| 15 | + migrations.CreateModel( |
| 16 | + name='Quiz', |
| 17 | + fields=[ |
| 18 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 19 | + ('category', models.CharField(choices=[('network', 'Network Security'), ('web', 'Web Application Security'), ('crypto', 'Cryptography'), ('general', 'General Knowledge'), ('python', 'Python'), ('javascript', 'JavaScript'), ('html_css', 'HTML & CSS'), ('web_security', 'Web Security'), ('reverse_engineering', 'Reverse Engineering'), ('forensics', 'Forensics'), ('binary_exploitation', 'Binary Exploitation'), ('linux', 'Linux'), ('algorithms', 'Algorithms'), ('data_structures', 'Data Structures'), ('databases', 'Databases'), ('regex', 'Regex'), ('secure_coding', 'Secure Coding'), ('logic_reasoning', 'Logic & Reasoning'), ('misc', 'Miscellaneous')], max_length=20)), |
| 20 | + ('started_at', models.DateTimeField(auto_now_add=True)), |
| 21 | + ('completed_at', models.DateTimeField(blank=True, null=True)), |
| 22 | + ('is_completed', models.BooleanField(default=False)), |
| 23 | + ('total_score', models.IntegerField(default=0)), |
| 24 | + ('questions_answered', models.IntegerField(default=0)), |
| 25 | + ('current_question_index', models.IntegerField(default=0)), |
| 26 | + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), |
| 27 | + ], |
| 28 | + options={ |
| 29 | + 'unique_together': {('user', 'category')}, |
| 30 | + }, |
| 31 | + ), |
| 32 | + migrations.CreateModel( |
| 33 | + name='QuizQuestion', |
| 34 | + fields=[ |
| 35 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 36 | + ('question_order', models.IntegerField()), |
| 37 | + ('user_answer', models.CharField(blank=True, max_length=200, null=True)), |
| 38 | + ('is_correct', models.BooleanField(default=False)), |
| 39 | + ('answered_at', models.DateTimeField(blank=True, null=True)), |
| 40 | + ('challenge', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='home.cyberchallenge')), |
| 41 | + ('quiz', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='questions', to='home.quiz')), |
| 42 | + ], |
| 43 | + options={ |
| 44 | + 'ordering': ['question_order'], |
| 45 | + 'unique_together': {('quiz', 'question_order')}, |
| 46 | + }, |
| 47 | + ), |
| 48 | + ] |
0 commit comments