diff --git a/.idea/modules.xml b/.idea/modules.xml index 8303c7f..fde5125 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VCPBayern_eLearning/eLearning/admin.py b/VCPBayern_eLearning/eLearning/admin.py deleted file mode 100644 index 8c38f3f..0000000 --- a/VCPBayern_eLearning/eLearning/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/VCPBayern_eLearning/eLearning/migrations/0001_initial.py b/VCPBayern_eLearning/eLearning/migrations/0001_initial.py deleted file mode 100644 index 19f9c89..0000000 --- a/VCPBayern_eLearning/eLearning/migrations/0001_initial.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.1 on 2016-01-20 22:54 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='questions', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('questionId', models.IntegerField()), - ('questionTitle', models.CharField(max_length=100)), - ('questionText', models.TextField()), - ('questionAnswer', models.TextField()), - ], - ), - ] diff --git a/VCPBayern_eLearning/eLearning/models.py b/VCPBayern_eLearning/eLearning/models.py deleted file mode 100644 index 7499dec..0000000 --- a/VCPBayern_eLearning/eLearning/models.py +++ /dev/null @@ -1,14 +0,0 @@ -from __future__ import unicode_literals - -from django.db import models - -# Create your models here. - -class questions(models.Model): - - questionId = models.IntegerField() - questionTitle = models.CharField(max_length=100) - questionText = models.TextField() - questionAnswer = models.TextField() - - diff --git a/VCPBayern_eLearning/eLearning/views.py b/VCPBayern_eLearning/eLearning/views.py deleted file mode 100644 index 2c095e2..0000000 --- a/VCPBayern_eLearning/eLearning/views.py +++ /dev/null @@ -1,13 +0,0 @@ -from django.shortcuts import render_to_response - - -# Create your views here. - -def home(request): - - content = { - 'questionId': 1, - 'questionTitle': 'titleOne', - 'questionText': 'Lorem ipsum dolor sit amet' - } - return render_to_response('index.html', content) diff --git a/db.sqlite3 b/db.sqlite3 index 746f855..67f9cb1 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/manage.py b/manage.py index c9f5656..6870008 100755 --- a/manage.py +++ b/manage.py @@ -3,7 +3,7 @@ import os import sys if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "VCPBayern_eLearning.settings") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tkupek_elearning.settings") from django.core.management import execute_from_command_line diff --git a/vcpby-elearning.iml b/tkupek-elearning.iml similarity index 100% rename from vcpby-elearning.iml rename to tkupek-elearning.iml diff --git a/VCPBayern_eLearning/__init__.py b/tkupek_elearning/__init__.py similarity index 100% rename from VCPBayern_eLearning/__init__.py rename to tkupek_elearning/__init__.py diff --git a/VCPBayern_eLearning/eLearning/__init__.py b/tkupek_elearning/elearning/__init__.py similarity index 100% rename from VCPBayern_eLearning/eLearning/__init__.py rename to tkupek_elearning/elearning/__init__.py diff --git a/tkupek_elearning/elearning/admin.py b/tkupek_elearning/elearning/admin.py new file mode 100644 index 0000000..0258562 --- /dev/null +++ b/tkupek_elearning/elearning/admin.py @@ -0,0 +1,5 @@ +from django.contrib import admin + +from tkupek_elearning.elearning.models import question + +admin.site.register(question) \ No newline at end of file diff --git a/VCPBayern_eLearning/eLearning/apps.py b/tkupek_elearning/elearning/apps.py similarity index 82% rename from VCPBayern_eLearning/eLearning/apps.py rename to tkupek_elearning/elearning/apps.py index a43859a..5a81f69 100644 --- a/VCPBayern_eLearning/eLearning/apps.py +++ b/tkupek_elearning/elearning/apps.py @@ -4,4 +4,4 @@ from django.apps import AppConfig class ElearningConfig(AppConfig): - name = 'eLearning' + name = 'elearning' diff --git a/tkupek_elearning/elearning/exampledata.sql b/tkupek_elearning/elearning/exampledata.sql new file mode 100644 index 0000000..62e16e7 --- /dev/null +++ b/tkupek_elearning/elearning/exampledata.sql @@ -0,0 +1,3 @@ +INSERT INTO elearning_question (id, title, text, options, answer, explanation) VALUES (0, 'Bananen', 'Warum ist die Banane krumm?', 'eins zwei oder drei', 1, 'darum'); +INSERT INTO elearning_question (id, title, text, options, answer, explanation) VALUES (1, 'Einstein', 'Wie lautet die Relativitätstheorie?', 'oben unten rechts links', 2, 'ich nehm die drei'); +INSERT INTO elearning_question (id, title, text, options, answer, explanation) VALUES (2, 'Wetter', 'Wie wird das Wetter?', 'gut schlecht dramatisch', 3, 'darum'); \ No newline at end of file diff --git a/tkupek_elearning/elearning/migrations/0001_initial.py b/tkupek_elearning/elearning/migrations/0001_initial.py new file mode 100644 index 0000000..2d45283 --- /dev/null +++ b/tkupek_elearning/elearning/migrations/0001_initial.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.1 on 2016-01-31 15:12 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='question', + fields=[ + ('id', models.IntegerField(primary_key=True, serialize=False)), + ('title', models.CharField(max_length=100)), + ('text', models.TextField()), + ('options', models.TextField()), + ('answer', models.IntegerField()), + ('explanation', models.TextField()), + ], + ), + ] diff --git a/VCPBayern_eLearning/eLearning/migrations/__init__.py b/tkupek_elearning/elearning/migrations/__init__.py similarity index 100% rename from VCPBayern_eLearning/eLearning/migrations/__init__.py rename to tkupek_elearning/elearning/migrations/__init__.py diff --git a/tkupek_elearning/elearning/models.py b/tkupek_elearning/elearning/models.py new file mode 100644 index 0000000..283ebf1 --- /dev/null +++ b/tkupek_elearning/elearning/models.py @@ -0,0 +1,12 @@ +from __future__ import unicode_literals + +from django.db import models + +class question(models.Model): + + id = models.IntegerField(primary_key=True) + title = models.CharField(max_length=100) + text = models.TextField() + options = models.TextField() + answer = models.IntegerField() + explanation = models.TextField() \ No newline at end of file diff --git a/VCPBayern_eLearning/eLearning/templates/index.html b/tkupek_elearning/elearning/templates/index.html similarity index 55% rename from VCPBayern_eLearning/eLearning/templates/index.html rename to tkupek_elearning/elearning/templates/index.html index 13d8e20..470ea2f 100644 --- a/VCPBayern_eLearning/eLearning/templates/index.html +++ b/tkupek_elearning/elearning/templates/index.html @@ -13,8 +13,14 @@

VCP Bayern - eLearning

-

{{ questionTitle }}

-

{{ questionText }}

+ + {% for question in questions %} +

{{ question.id }}: {{ question.title }}

+

{{ question.text }}

+

{{ question.options }} : {{ question.answer }}

+

{{ question.explanation}}

+ {% endfor %} +
diff --git a/tkupek_elearning/elearning/tests.py b/tkupek_elearning/elearning/tests.py new file mode 100644 index 0000000..4d66077 --- /dev/null +++ b/tkupek_elearning/elearning/tests.py @@ -0,0 +1,3 @@ +#from django.test import TestCase + +# Create your tests here. diff --git a/tkupek_elearning/elearning/views.py b/tkupek_elearning/elearning/views.py new file mode 100644 index 0000000..ab2a4ee --- /dev/null +++ b/tkupek_elearning/elearning/views.py @@ -0,0 +1,9 @@ +from django.shortcuts import render_to_response + +from tkupek_elearning.elearning.models import question + +def home(request): + + questions = question.objects.all() + + return render_to_response('index.html', {'questions': questions}) \ No newline at end of file diff --git a/VCPBayern_eLearning/settings.py b/tkupek_elearning/settings.py similarity index 94% rename from VCPBayern_eLearning/settings.py rename to tkupek_elearning/settings.py index f95d293..931e928 100644 --- a/VCPBayern_eLearning/settings.py +++ b/tkupek_elearning/settings.py @@ -1,5 +1,5 @@ """ -Django settings for VCPBayern_eLearning project. +Django settings for tkupek_elearning project. Generated by 'django-admin startproject' using Django 1.9.1. @@ -37,7 +37,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'VCPBayern_eLearning.eLearning' + 'tkupek_elearning.elearning' ] MIDDLEWARE_CLASSES = [ @@ -51,7 +51,7 @@ MIDDLEWARE_CLASSES = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] -ROOT_URLCONF = 'VCPBayern_eLearning.urls' +ROOT_URLCONF = 'tkupek_elearning.urls' TEMPLATES = [ { @@ -69,7 +69,7 @@ TEMPLATES = [ }, ] -WSGI_APPLICATION = 'VCPBayern_eLearning.wsgi.application' +WSGI_APPLICATION = 'tkupek_elearning.wsgi.application' # Database diff --git a/VCPBayern_eLearning/urls.py b/tkupek_elearning/urls.py similarity index 84% rename from VCPBayern_eLearning/urls.py rename to tkupek_elearning/urls.py index b457092..7c14265 100644 --- a/VCPBayern_eLearning/urls.py +++ b/tkupek_elearning/urls.py @@ -1,4 +1,4 @@ -"""VCPBayern_eLearning URL Configuration +"""tkupek_elearning URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ @@ -16,8 +16,9 @@ Including another URLconf from django.conf.urls import url from django.contrib import admin +import tkupek_elearning.elearning.views urlpatterns = [ url(r'^admin/', admin.site.urls), - url(r'', 'VCPBayern_eLearning.eLearning.views.home', name='home') + url(r'', tkupek_elearning.elearning.views.home) ] diff --git a/VCPBayern_eLearning/wsgi.py b/tkupek_elearning/wsgi.py similarity index 69% rename from VCPBayern_eLearning/wsgi.py rename to tkupek_elearning/wsgi.py index a1706e3..692dba2 100644 --- a/VCPBayern_eLearning/wsgi.py +++ b/tkupek_elearning/wsgi.py @@ -1,5 +1,5 @@ """ -WSGI config for VCPBayern_eLearning project. +WSGI config for tkupek_elearning project. It exposes the WSGI callable as a module-level variable named ``application``. @@ -11,6 +11,6 @@ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "VCPBayern_eLearning.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tkupek_elearning.settings") application = get_wsgi_application()