Faqs über DB hinzufügen!

This commit is contained in:
ben8
2025-06-01 19:34:21 +02:00
parent 3bfca331f2
commit aea07295d8
7 changed files with 81 additions and 117 deletions

View File

@@ -1,3 +1,8 @@
from django.contrib import admin from django.contrib import admin
from .models import QivipFaq
# Register your models here. # Register your models here.
class QivipFaqAdmin(admin.ModelAdmin):
list_display = ('question','answer',)
# Registrierung der Modelle im Admin
admin.site.register(QivipFaq, QivipFaqAdmin)

View File

@@ -0,0 +1,22 @@
# Generated by Django 5.1.7 on 2025-06-01 17:16
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='QivipFAQs',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('question', models.CharField(max_length=200)),
('answer', models.CharField(max_length=1000)),
],
),
]

View File

@@ -0,0 +1,17 @@
# Generated by Django 5.1.7 on 2025-06-01 17:30
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('homepage', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_name='QivipFAQs',
new_name='QivipFaq',
),
]

View File

@@ -0,0 +1,23 @@
# Generated by Django 5.1.7 on 2025-06-01 17:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0002_rename_qivipfaqs_qivipfaq'),
]
operations = [
migrations.AlterField(
model_name='qivipfaq',
name='answer',
field=models.TextField(max_length=1000),
),
migrations.AlterField(
model_name='qivipfaq',
name='question',
field=models.TextField(max_length=200),
),
]

View File

@@ -1,3 +1,6 @@
from django.db import models from django.db import models
# Create your models here. # Create your models here.
class QivipFaq(models.Model):
question = models.TextField(max_length=200)
answer = models.TextField(max_length=1000)

View File

@@ -1,7 +1,10 @@
from django.shortcuts import render, redirect from django.shortcuts import render, redirect
from .models import QivipFaq
def home(request): def home(request):
return render(request, 'homepage/home.html') faqs=QivipFaq.objects.all()
context={"faqs": faqs}
return render(request, 'homepage/home.html', context)
def impress(request): def impress(request):
return render(request, 'homepage/impress.html') return render(request, 'homepage/impress.html')

View File

@@ -22,7 +22,7 @@
</style> </style>
{% if faqs %}
<div class="container mx-auto px-4 sm:px-6 lg:px-8 mt-8 mb-6"> <div class="container mx-auto px-4 sm:px-6 lg:px-8 mt-8 mb-6">
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<h2 class="text-2xl font-bold text-gray-900">FAQs</h2> <h2 class="text-2xl font-bold text-gray-900">FAQs</h2>
@@ -42,126 +42,17 @@
</div> </div>
{% for faq in faqs %}
<div class="input-group mt-2.5 !max-w-4xl hover:!bg-gray-50"> <div class="input-group mt-2.5 !max-w-4xl hover:!bg-gray-50">
<details> <details>
<summary class="flex justify-between cursor-pointer font-bold">Was ist qivip? <summary class="flex justify-between cursor-pointer font-bold">{{ faq.question }}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-7"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-7">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" /> <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg> </svg>
</summary> </summary>
<p class="text-blue-600">qivip ist eine Webseite zum Lernen! Es können vor allem Quizze erstellt, bearbeitet, kopiert und auch gespielt werden. </p> <p class="text-blue-600">{{ faq.answer }}</p>
</details> </details>
</div> </div>
{% endfor %}
<div class="input-group mt-2.5 !max-w-4xl hover:!bg-gray-50"> {% endif %}
<details>
<summary class="flex justify-between cursor-pointer font-bold">Was sind die Vorteile von qivip?
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-7">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg>
</summary>
<p class="text-blue-600">
Einige Vorteile von qivip:
<br>
- Sie können Quizze moderieren ohne Account (siehe wie man Quizze mit mehreren Personen gemeinsam spielt)
<br>
- alle öffentlichen Quizze können auch ohne Account gespielt werden
<br>
- qivip ist zu 100% kostenlos
<br>
- es gibt keine Werbung
<br>
- qivip ist Open Source
</p>
</details>
</div>
<div class="input-group mt-2.5 !max-w-4xl hover:!bg-gray-50">
<details>
<summary class="flex justify-between cursor-pointer font-bold">Ist qivip kostenlos?
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-7">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg>
</summary>
<p class="text-blue-600">Ja! qivip ist zu 100% kostenlos und es gibt keine versteckten Kosten.</p>
</details>
</div>
<div class="input-group mt-2.5 !max-w-4xl hover:!bg-gray-50">
<details>
<summary class="flex justify-between cursor-pointer font-bold">Muss ich mich bei qivip registrieren, wenn ich ein Quiz spielen möchte?
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-7">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg>
</summary>
<p class="text-blue-600">Nein! qivip ist so ausgelegt, dass man auch ohne Account alle öffentlichen Quizze spielen kann.</p>
</details>
</div>
<div class="input-group mt-2.5 !max-w-4xl hover:!bg-gray-50">
<details>
<summary class="flex justify-between cursor-pointer font-bold">Kann ich ein Quiz von qivip auch alleine spielen?
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-7">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg>
</summary>
<p class="text-blue-600">Ja! Gehen Sie zur Bibliothek und klicken Sie auf den Button "spielen" (eines von Ihnen ausgewählten Quizzes). Wählen Sie anschließend bei den Spielmodi einfach den Lernmodus aus.</p>
</details>
</div>
<div class="input-group mt-2.5 !max-w-4xl hover:!bg-gray-50">
<details>
<summary class="flex justify-between cursor-pointer font-bold">Wie kann ich ein Quiz erstellen?
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-7">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg>
</summary>
<p class="text-blue-600">Wichtig: Für diese Funktion müssen Sie angemeldet sein. Gehen Sie dafür auf die Startseite und klicken Sie auf "Erstellen". Nun wird Ihnen ein Formular angezeigt, dass Sie dann ausfüllen.
Anschließend können Sie Fragen zu dem Quiz hinzufügen, indem Sie auf den Button eines Fragetyps klicken. </p>
</details>
</div>
<div class="input-group mt-2.5 !max-w-4xl hover:!bg-gray-50">
<details>
<summary class="flex justify-between cursor-pointer font-bold">Wie kann ich mit mehreren Personen ein Quiz gemeinsam spielen?
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-7">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg>
</summary>
<p class="text-blue-600">
Wenn man ein Quiz mit mehreren Personen spielt, gibt es sowohl einen Moderator als auch die Teilnehmer.
<br>
<br>
<b>Moderator: </b>Der Moderator selbst spielt nicht mit. Gehen Sie entweder auf die Startseite und klicken Sie auf "Moderieren" oder klicken einfach auf "spielen" (eines von Ihnen ausgewählten Quizzes) und dann auf Moderiermodus.
Der Moderator kann das Spiel, wenn die Teilnehmer da sind, starten.
<br>
<br>
<b>Teilnehmer: </b>Gehen Sie auf die Startseite und klicken Sie auf "Teilnehmen" und geben Sie dann den beim Moderator angegebenen Zahlencode ein. Anschließlich können Sie noch einen Anzeigenamen eingeben.
</p>
</details>
</div>
<div class="input-group mt-2.5 !max-w-4xl hover:!bg-gray-50">
<details>
<summary class="flex justify-between cursor-pointer font-bold">Wo steht unser Server?
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-7">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg>
</summary>
<p class="text-blue-600">Unser Server befindet sich in Deutschland, genauer gesagt in Nürnberg. </p>
</details>
</div>
<div class="input-group mt-2.5 !max-w-4xl hover:!bg-gray-50">
<details>
<summary class="flex justify-between cursor-pointer font-bold">Wer steckt hinter qivip?
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-7">
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
</svg>
</summary>
<p class="text-blue-600">Wir sind eine kleine Gruppe von Schülern, die sich im Rahmen eines Enrichmenten Projektes zusammengefunden hat. </p>
</details>
</div>
{% endblock %} {% endblock %}