Merge branch 'master' of edugit.org:enrichment-2024/qivip
This commit is contained in:
@@ -4,7 +4,7 @@ from .models import QivipQuiz, QivipQuestion
|
||||
class QuizForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = QivipQuiz
|
||||
fields = ['name', 'description', 'status', 'category', 'tags']
|
||||
fields = ['name', 'description', 'status', 'category', 'tags',"difficulty"]
|
||||
|
||||
class QuestionForm(forms.ModelForm):
|
||||
class Meta:
|
||||
|
||||
18
core/library/migrations/0002_alter_qivipquiz_status.py
Normal file
18
core/library/migrations/0002_alter_qivipquiz_status.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.3 on 2025-03-08 13:14
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qivipquiz',
|
||||
name='status',
|
||||
field=models.CharField(choices=[('public', 'Öffentlich'), ('hidden', 'Versteckt'), ('private', 'Privat')], default='private', max_length=10),
|
||||
),
|
||||
]
|
||||
18
core/library/migrations/0003_alter_qivipquiz_status.py
Normal file
18
core/library/migrations/0003_alter_qivipquiz_status.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.3 on 2025-03-08 13:16
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0002_alter_qivipquiz_status'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qivipquiz',
|
||||
name='status',
|
||||
field=models.CharField(choices=[('public', 'Öffentlich'), ('hidden', 'Versteckt'), ('private', 'Privat')], default='Privat', max_length=10),
|
||||
),
|
||||
]
|
||||
18
core/library/migrations/0004_alter_qivipquiz_status.py
Normal file
18
core/library/migrations/0004_alter_qivipquiz_status.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.3 on 2025-03-08 13:18
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0003_alter_qivipquiz_status'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qivipquiz',
|
||||
name='status',
|
||||
field=models.CharField(choices=[('public', 'Öffentlich'), ('hidden', 'Versteckt'), ('private', 'Privat')], default='private', max_length=10),
|
||||
),
|
||||
]
|
||||
18
core/library/migrations/0005_alter_qivipquiz_status.py
Normal file
18
core/library/migrations/0005_alter_qivipquiz_status.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.3 on 2025-03-08 13:23
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0004_alter_qivipquiz_status'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qivipquiz',
|
||||
name='status',
|
||||
field=models.CharField(choices=[('public', 'Öffentlich'), ('hidden', 'Versteckt'), ('private', 'Privat')], default='public', max_length=10),
|
||||
),
|
||||
]
|
||||
18
core/library/migrations/0006_alter_qivipquiz_description.py
Normal file
18
core/library/migrations/0006_alter_qivipquiz_description.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.3 on 2025-03-08 13:30
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0005_alter_qivipquiz_status'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qivipquiz',
|
||||
name='description',
|
||||
field=models.TextField(blank=True, default='In dem Quiz geht es um ...', null=True),
|
||||
),
|
||||
]
|
||||
18
core/library/migrations/0007_alter_qivipquiz_description.py
Normal file
18
core/library/migrations/0007_alter_qivipquiz_description.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.3 on 2025-03-08 13:31
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0006_alter_qivipquiz_description'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qivipquiz',
|
||||
name='description',
|
||||
field=models.TextField(blank=True, default='Das Quiz ist ein ... Quiz. In dem Quiz geht es um ...', null=True),
|
||||
),
|
||||
]
|
||||
18
core/library/migrations/0008_alter_qivipquiz_description.py
Normal file
18
core/library/migrations/0008_alter_qivipquiz_description.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.3 on 2025-03-08 13:32
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0007_alter_qivipquiz_description'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qivipquiz',
|
||||
name='description',
|
||||
field=models.TextField(blank=True, default='Das Quiz ist ein ... Quiz. \n In dem Quiz geht es um ...', null=True),
|
||||
),
|
||||
]
|
||||
18
core/library/migrations/0009_alter_qivipquiz_description.py
Normal file
18
core/library/migrations/0009_alter_qivipquiz_description.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.3 on 2025-03-08 13:32
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0008_alter_qivipquiz_description'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qivipquiz',
|
||||
name='description',
|
||||
field=models.TextField(blank=True, default='Das Quiz ist ein ... Quiz. \nIn dem Quiz geht es um ...', null=True),
|
||||
),
|
||||
]
|
||||
18
core/library/migrations/0010_alter_qivipquiz_description.py
Normal file
18
core/library/migrations/0010_alter_qivipquiz_description.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.3 on 2025-03-08 13:33
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0009_alter_qivipquiz_description'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qivipquiz',
|
||||
name='description',
|
||||
field=models.TextField(blank=True, default='In dem Quiz geht es um ...', null=True),
|
||||
),
|
||||
]
|
||||
18
core/library/migrations/0011_qivipquiz_difficulty.py
Normal file
18
core/library/migrations/0011_qivipquiz_difficulty.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.3 on 2025-03-08 13:37
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0010_alter_qivipquiz_description'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='qivipquiz',
|
||||
name='difficulty',
|
||||
field=models.CharField(choices=[('public', 'Öffentlich'), ('hidden', 'Versteckt'), ('private', 'Privat')], default='public', max_length=10),
|
||||
),
|
||||
]
|
||||
18
core/library/migrations/0012_alter_qivipquiz_difficulty.py
Normal file
18
core/library/migrations/0012_alter_qivipquiz_difficulty.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.3 on 2025-03-08 13:39
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0011_qivipquiz_difficulty'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qivipquiz',
|
||||
name='difficulty',
|
||||
field=models.CharField(choices=[('public', 'Öffentlich'), ('hidden', 'Versteckt'), ('private', 'Privat')], default='not defined', max_length=10),
|
||||
),
|
||||
]
|
||||
18
core/library/migrations/0013_alter_qivipquiz_difficulty.py
Normal file
18
core/library/migrations/0013_alter_qivipquiz_difficulty.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.3 on 2025-03-08 13:40
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0012_alter_qivipquiz_difficulty'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qivipquiz',
|
||||
name='difficulty',
|
||||
field=models.CharField(choices=[('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('not defined', 'nicht gesetzt')], default='not defined', max_length=11),
|
||||
),
|
||||
]
|
||||
18
core/library/migrations/0014_alter_qivipquiz_difficulty.py
Normal file
18
core/library/migrations/0014_alter_qivipquiz_difficulty.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.3 on 2025-03-08 13:43
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0013_alter_qivipquiz_difficulty'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qivipquiz',
|
||||
name='difficulty',
|
||||
field=models.CharField(choices=[('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('not defined', 'nicht gesetzt')], default='not defined', help_text='1: niedrigste Schwierigkeit, 2: höchste Schwierigkeit', max_length=11),
|
||||
),
|
||||
]
|
||||
18
core/library/migrations/0015_alter_qivipquiz_difficulty.py
Normal file
18
core/library/migrations/0015_alter_qivipquiz_difficulty.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.3 on 2025-03-08 13:44
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('library', '0014_alter_qivipquiz_difficulty'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='qivipquiz',
|
||||
name='difficulty',
|
||||
field=models.CharField(choices=[('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('not defined', 'nicht gesetzt')], default='not defined', help_text='1: niedrigste Schwierigkeit und 5: höchste Schwierigkeit', max_length=11),
|
||||
),
|
||||
]
|
||||
@@ -9,16 +9,26 @@ class QivipQuiz(models.Model):
|
||||
"hidden": "Versteckt",
|
||||
"private": "Privat",
|
||||
}
|
||||
DIFFICULTY_VALUES = {
|
||||
"1": "1",
|
||||
"2": "2",
|
||||
"3": "3",
|
||||
"4": "4",
|
||||
"5": "5",
|
||||
"not defined":"nicht gesetzt",
|
||||
|
||||
}
|
||||
|
||||
uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
|
||||
user_id = models.ForeignKey(User, on_delete=models.CASCADE, related_name='quiz')
|
||||
creation_date = models.DateTimeField(auto_now_add=True)
|
||||
update_date = models.DateTimeField(auto_now=True)
|
||||
status = models.CharField(max_length=10, choices=STATUS_VALUES.items())
|
||||
status = models.CharField(max_length=10, choices=list(STATUS_VALUES.items()), default="public")
|
||||
category = models.ForeignKey('QuizCategory', related_name='quiz', on_delete=models.CASCADE)
|
||||
tags = models.ManyToManyField('Tag', blank=True)
|
||||
name = models.CharField(max_length=255)
|
||||
description = models.TextField(blank=True, null=True)
|
||||
description = models.TextField(blank=True, null=True, default="In dem Quiz geht es um ...")
|
||||
difficulty= models.CharField(max_length=11, choices=list(DIFFICULTY_VALUES.items()), default="not defined", help_text="1: niedrigste Schwierigkeit und 5: höchste Schwierigkeit")
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
{% for quiz in quizzes %}
|
||||
<div class="bg-white rounded-lg p-4 shadow-md">
|
||||
<h2 class="text-lg font-bold"><a href="{% url 'library:detail_quiz' quiz.id %}">{{ quiz.name }}</a></h2>
|
||||
<p class="text-sm text-gray-600">{{ quiz.description }}</p>
|
||||
<a href="#">Spiel starten</a>
|
||||
<a href="{% url 'library:edit_quiz' quiz.id %}">Bearbeiten</a>
|
||||
<a href="{% url 'library:delete_quiz' quiz.id %}">Löschen</a>
|
||||
<p class="text-sm text-gray-600 my-8">{{ quiz.description }}</p>
|
||||
<a href="#"class="qp-a-button-small bg-green-500">Spiel starten</a>
|
||||
<button><a href="{% url 'library:edit_quiz' quiz.id %}"class="qp-a-button-small bg-indigo-500">Bearbeiten</a></button>
|
||||
<a href="{% url 'library:delete_quiz' quiz.id %}" class="qp-a-button-small bg-purple-500">Löschen</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user