feat: update web Interface

This commit is contained in:
Yao Wang 2022-07-29 14:22:57 +02:00
parent d5d633b6c7
commit f9844dba10
1111 changed files with 171093 additions and 0 deletions

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
14185

View file

@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()

View file

@ -0,0 +1,16 @@
"""
ASGI config for mysite project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
application = get_asgi_application()

View file

@ -0,0 +1,153 @@
"""
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 3.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib import Path
import os
from corsheaders.defaults import default_headers
CORS_ALLOW_HEADERS = list(default_headers) + [
"Connection",
]
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-&fz4ma9qu*#=qrl%ehc@x)5fyn3m0ejpfl2$6ca8@uupo3@fwp'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = ['*']
CORS_ALLOW_ALL_ORIGINS = True
# Application definition
INSTALLED_APPS = [
'corsheaders',
'new10.apps.New10Config',
'new9.apps.New9Config',
'new8.apps.New8Config',
'new7.apps.New7Config',
'new6.apps.New6Config',
'new5.apps.New5Config',
'new4.apps.New4Config',
'new3.apps.New3Config',
'new2.apps.New2Config',
'new1.apps.New1Config',
'qa3.apps.Qa3Config',
'qa2.apps.Qa2Config',
'qa1.apps.Qa1Config',
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
#CORS_ALLOWED_ORIGINS = [
#"http://amt.hackpku.com",
#"http://localhost:9090",
#"http://127.0.0.1:9090",
#]
ROOT_URLCONF = 'mysite.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'mysite.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.2/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, "static/")
# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

View file

@ -0,0 +1,35 @@
"""mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import include,path
urlpatterns = [
path('polls/', include('polls.urls')),
path('qa1/', include('qa1.urls')),
path('qa2/', include('qa2.urls')),
path('qa3/', include('qa3.urls')),
path('new1/', include('new1.urls')),
path('new2/', include('new2.urls')),
path('new3/', include('new3.urls')),
path('new4/', include('new4.urls')),
path('new5/', include('new5.urls')),
path('new6/', include('new6.urls')),
path('new7/', include('new7.urls')),
path('new8/', include('new8.urls')),
path('new9/', include('new9.urls')),
path('new10/', include('new10.urls')),
path('admin/', admin.site.urls),
]

View file

@ -0,0 +1,16 @@
"""
WSGI config for mysite project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
application = get_wsgi_application()

View file

@ -0,0 +1,5 @@
from django.contrib import admin
from .models import Question
admin.site.register(Question)

View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class New1Config(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'new1'

View file

@ -0,0 +1,27 @@
# Generated by Django 3.2.6 on 2021-08-16 20:18
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)),
('QA_results', models.CharField(max_length=20000)),
('reco_results', models.CharField(max_length=20000)),
('timeing', models.CharField(max_length=20000)),
('surveyData', models.CharField(max_length=20000)),
('tasks', models.CharField(max_length=20000)),
('workerId', models.CharField(max_length=20000)),
('assId', models.CharField(max_length=20000)),
],
),
]

View file

@ -0,0 +1,16 @@
from django.db import models
class Question(models.Model):
ID = models.IntegerField(primary_key=True)
QA_results = models.CharField(max_length=20000)
reco_results = models.CharField(max_length=20000)
timeing = models.CharField(max_length=20000)
surveyData = models.CharField(max_length=20000)
tasks = models.CharField(max_length=20000)
workerId = models.CharField(max_length=20000)
assId = models.CharField(max_length=20000)
def __str__(self):
return self.ID

View file

@ -0,0 +1,5 @@
from django.contrib import admin
from .models import Question
admin.site.register(Question)

View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class New2Config(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'new2'

View file

@ -0,0 +1,27 @@
# Generated by Django 3.2.6 on 2021-08-16 20:18
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)),
('QA_results', models.CharField(max_length=20000)),
('reco_results', models.CharField(max_length=20000)),
('timeing', models.CharField(max_length=20000)),
('surveyData', models.CharField(max_length=20000)),
('tasks', models.CharField(max_length=20000)),
('workerId', models.CharField(max_length=20000)),
('assId', models.CharField(max_length=20000)),
],
),
]

View file

@ -0,0 +1,16 @@
from django.db import models
class Question(models.Model):
ID = models.IntegerField(primary_key=True)
QA_results = models.CharField(max_length=20000)
reco_results = models.CharField(max_length=20000)
timeing = models.CharField(max_length=20000)
surveyData = models.CharField(max_length=20000)
tasks = models.CharField(max_length=20000)
workerId = models.CharField(max_length=20000)
assId = models.CharField(max_length=20000)
def __str__(self):
return self.ID

View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View file

@ -0,0 +1,7 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]

View file

@ -0,0 +1,27 @@
from django.shortcuts import render
import simplejson
# Create your views here.
from django.http import HttpResponse
from .models import Question
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def index(request):
if request.method == 'POST':
print(request.POST)
req = simplejson.loads(request.body)
print(req)
QA_results = req['results']["outputs"]['qa_answers']
reco_results = req['results']["outputs"]["re_answers"]
timeing = req['results']["outputs"]["timing"]
surveyData = req['results']["outputs"]["surveyData"]
tasks = req['results']["outputs"]["tasks"]
workerId = req['workerId']
assId = req['assignmentId']
Question.objects.create(QA_results = QA_results, reco_results = reco_results, timeing = timeing, surveyData = surveyData, tasks = tasks, workerId = workerId, assId = assId)
return HttpResponse("receive")
else:
return HttpResponse("Hello, world. You're at the new2 index.")

View file

@ -0,0 +1,5 @@
from django.contrib import admin
from .models import Question
admin.site.register(Question)

View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class New3Config(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'new3'

View file

@ -0,0 +1,27 @@
# Generated by Django 3.2.6 on 2021-08-16 20:18
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)),
('QA_results', models.CharField(max_length=20000)),
('reco_results', models.CharField(max_length=20000)),
('timeing', models.CharField(max_length=20000)),
('surveyData', models.CharField(max_length=20000)),
('tasks', models.CharField(max_length=20000)),
('workerId', models.CharField(max_length=20000)),
('assId', models.CharField(max_length=20000)),
],
),
]

View file

@ -0,0 +1,16 @@
from django.db import models
class Question(models.Model):
ID = models.IntegerField(primary_key=True)
QA_results = models.CharField(max_length=20000)
reco_results = models.CharField(max_length=20000)
timeing = models.CharField(max_length=20000)
surveyData = models.CharField(max_length=20000)
tasks = models.CharField(max_length=20000)
workerId = models.CharField(max_length=20000)
assId = models.CharField(max_length=20000)
def __str__(self):
return self.ID

View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View file

@ -0,0 +1,7 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]

View file

@ -0,0 +1,27 @@
from django.shortcuts import render
import simplejson
# Create your views here.
from django.http import HttpResponse
from .models import Question
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def index(request):
if request.method == 'POST':
print(request.POST)
req = simplejson.loads(request.body)
print(req)
QA_results = req['results']["outputs"]['qa_answers']
reco_results = req['results']["outputs"]["re_answers"]
timeing = req['results']["outputs"]["timing"]
surveyData = req['results']["outputs"]["surveyData"]
tasks = req['results']["outputs"]["tasks"]
workerId = req['workerId']
assId = req['assignmentId']
Question.objects.create(QA_results = QA_results, reco_results = reco_results, timeing = timeing, surveyData = surveyData, tasks = tasks, workerId = workerId, assId = assId)
return HttpResponse("receive")
else:
return HttpResponse("Hello, world. You're at the new3 index.")

View file

@ -0,0 +1,5 @@
from django.contrib import admin
from .models import Question
admin.site.register(Question)

View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class New4Config(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'new4'

View file

@ -0,0 +1,27 @@
# Generated by Django 3.2.6 on 2021-08-16 20:18
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)),
('QA_results', models.CharField(max_length=20000)),
('reco_results', models.CharField(max_length=20000)),
('timeing', models.CharField(max_length=20000)),
('surveyData', models.CharField(max_length=20000)),
('tasks', models.CharField(max_length=20000)),
('workerId', models.CharField(max_length=20000)),
('assId', models.CharField(max_length=20000)),
],
),
]

View file

@ -0,0 +1,16 @@
from django.db import models
class Question(models.Model):
ID = models.IntegerField(primary_key=True)
QA_results = models.CharField(max_length=20000)
reco_results = models.CharField(max_length=20000)
timeing = models.CharField(max_length=20000)
surveyData = models.CharField(max_length=20000)
tasks = models.CharField(max_length=20000)
workerId = models.CharField(max_length=20000)
assId = models.CharField(max_length=20000)
def __str__(self):
return self.ID

View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View file

@ -0,0 +1,7 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]

View file

@ -0,0 +1,27 @@
from django.shortcuts import render
import simplejson
# Create your views here.
from django.http import HttpResponse
from .models import Question
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def index(request):
if request.method == 'POST':
print(request.POST)
req = simplejson.loads(request.body)
print(req)
QA_results = req['results']["outputs"]['qa_answers']
reco_results = req['results']["outputs"]["re_answers"]
timeing = req['results']["outputs"]["timing"]
surveyData = req['results']["outputs"]["surveyData"]
tasks = req['results']["outputs"]["tasks"]
workerId = req['workerId']
assId = req['assignmentId']
Question.objects.create(QA_results = QA_results, reco_results = reco_results, timeing = timeing, surveyData = surveyData, tasks = tasks, workerId = workerId, assId = assId)
return HttpResponse("receive")
else:
return HttpResponse("Hello, world. You're at the new4 index.")

View file

@ -0,0 +1,5 @@
from django.contrib import admin
from .models import Question
admin.site.register(Question)

View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class New5Config(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'new5'

View file

@ -0,0 +1,27 @@
# Generated by Django 3.2.6 on 2021-08-16 20:18
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)),
('QA_results', models.CharField(max_length=20000)),
('reco_results', models.CharField(max_length=20000)),
('timeing', models.CharField(max_length=20000)),
('surveyData', models.CharField(max_length=20000)),
('tasks', models.CharField(max_length=20000)),
('workerId', models.CharField(max_length=20000)),
('assId', models.CharField(max_length=20000)),
],
),
]

View file

@ -0,0 +1,16 @@
from django.db import models
class Question(models.Model):
ID = models.IntegerField(primary_key=True)
QA_results = models.CharField(max_length=20000)
reco_results = models.CharField(max_length=20000)
timeing = models.CharField(max_length=20000)
surveyData = models.CharField(max_length=20000)
tasks = models.CharField(max_length=20000)
workerId = models.CharField(max_length=20000)
assId = models.CharField(max_length=20000)
def __str__(self):
return self.ID

View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View file

@ -0,0 +1,7 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]

View file

@ -0,0 +1,27 @@
from django.shortcuts import render
import simplejson
# Create your views here.
from django.http import HttpResponse
from .models import Question
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def index(request):
if request.method == 'POST':
print(request.POST)
req = simplejson.loads(request.body)
print(req)
QA_results = req['results']["outputs"]['qa_answers']
reco_results = req['results']["outputs"]["re_answers"]
timeing = req['results']["outputs"]["timing"]
surveyData = req['results']["outputs"]["surveyData"]
tasks = req['results']["outputs"]["tasks"]
workerId = req['workerId']
assId = req['assignmentId']
Question.objects.create(QA_results = QA_results, reco_results = reco_results, timeing = timeing, surveyData = surveyData, tasks = tasks, workerId = workerId, assId = assId)
return HttpResponse("receive")
else:
return HttpResponse("Hello, world. You're at the new5 index.")

View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View file

@ -0,0 +1,7 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]

View file

@ -0,0 +1,27 @@
from django.shortcuts import render
import simplejson
# Create your views here.
from django.http import HttpResponse
from .models import Question
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def index(request):
if request.method == 'POST':
print(request.POST)
req = simplejson.loads(request.body)
print(req)
QA_results = req['results']["outputs"]['qa_answers']
reco_results = req['results']["outputs"]["re_answers"]
timeing = req['results']["outputs"]["timing"]
surveyData = req['results']["outputs"]["surveyData"]
tasks = req['results']["outputs"]["tasks"]
workerId = req['workerId']
assId = req['assignmentId']
Question.objects.create(QA_results = QA_results, reco_results = reco_results, timeing = timeing, surveyData = surveyData, tasks = tasks, workerId = workerId, assId = assId)
return HttpResponse("receive")
else:
return HttpResponse("Hello, world. You're at the new1 index.")

View file

@ -0,0 +1,5 @@
from django.contrib import admin
from .models import Question
admin.site.register(Question)

View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class New10Config(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'new10'

View file

@ -0,0 +1,27 @@
# Generated by Django 3.2.6 on 2021-08-16 20:18
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)),
('QA_results', models.CharField(max_length=20000)),
('reco_results', models.CharField(max_length=20000)),
('timeing', models.CharField(max_length=20000)),
('surveyData', models.CharField(max_length=20000)),
('tasks', models.CharField(max_length=20000)),
('workerId', models.CharField(max_length=20000)),
('assId', models.CharField(max_length=20000)),
],
),
]

View file

@ -0,0 +1,16 @@
from django.db import models
class Question(models.Model):
ID = models.IntegerField(primary_key=True)
QA_results = models.CharField(max_length=20000)
reco_results = models.CharField(max_length=20000)
timeing = models.CharField(max_length=20000)
surveyData = models.CharField(max_length=20000)
tasks = models.CharField(max_length=20000)
workerId = models.CharField(max_length=20000)
assId = models.CharField(max_length=20000)
def __str__(self):
return self.ID

View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View file

@ -0,0 +1,7 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]

View file

@ -0,0 +1,27 @@
from django.shortcuts import render
import simplejson
# Create your views here.
from django.http import HttpResponse
from .models import Question
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def index(request):
if request.method == 'POST':
print(request.POST)
req = simplejson.loads(request.body)
print(req)
QA_results = req['results']["outputs"]['qa_answers']
reco_results = req['results']["outputs"]["re_answers"]
timeing = req['results']["outputs"]["timing"]
surveyData = req['results']["outputs"]["surveyData"]
tasks = req['results']["outputs"]["tasks"]
workerId = req['workerId']
assId = req['assignmentId']
Question.objects.create(QA_results = QA_results, reco_results = reco_results, timeing = timeing, surveyData = surveyData, tasks = tasks, workerId = workerId, assId = assId)
return HttpResponse("receive")
else:
return HttpResponse("Hello, world. You're at the new10 index.")

View file

@ -0,0 +1,5 @@
from django.contrib import admin
from .models import Question
admin.site.register(Question)

View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class New2Config(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'new2'

View file

@ -0,0 +1,27 @@
# Generated by Django 3.2.6 on 2021-08-16 20:18
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)),
('QA_results', models.CharField(max_length=20000)),
('reco_results', models.CharField(max_length=20000)),
('timeing', models.CharField(max_length=20000)),
('surveyData', models.CharField(max_length=20000)),
('tasks', models.CharField(max_length=20000)),
('workerId', models.CharField(max_length=20000)),
('assId', models.CharField(max_length=20000)),
],
),
]

View file

@ -0,0 +1,16 @@
from django.db import models
class Question(models.Model):
ID = models.IntegerField(primary_key=True)
QA_results = models.CharField(max_length=20000)
reco_results = models.CharField(max_length=20000)
timeing = models.CharField(max_length=20000)
surveyData = models.CharField(max_length=20000)
tasks = models.CharField(max_length=20000)
workerId = models.CharField(max_length=20000)
assId = models.CharField(max_length=20000)
def __str__(self):
return self.ID

View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View file

@ -0,0 +1,7 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]

View file

@ -0,0 +1,27 @@
from django.shortcuts import render
import simplejson
# Create your views here.
from django.http import HttpResponse
from .models import Question
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def index(request):
if request.method == 'POST':
print(request.POST)
req = simplejson.loads(request.body)
print(req)
QA_results = req['results']["outputs"]['qa_answers']
reco_results = req['results']["outputs"]["re_answers"]
timeing = req['results']["outputs"]["timing"]
surveyData = req['results']["outputs"]["surveyData"]
tasks = req['results']["outputs"]["tasks"]
workerId = req['workerId']
assId = req['assignmentId']
Question.objects.create(QA_results = QA_results, reco_results = reco_results, timeing = timeing, surveyData = surveyData, tasks = tasks, workerId = workerId, assId = assId)
return HttpResponse("receive")
else:
return HttpResponse("Hello, world. You're at the new2 index.")

View file

@ -0,0 +1,5 @@
from django.contrib import admin
from .models import Question
admin.site.register(Question)

View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class New3Config(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'new3'

View file

@ -0,0 +1,27 @@
# Generated by Django 3.2.6 on 2021-08-16 20:18
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)),
('QA_results', models.CharField(max_length=20000)),
('reco_results', models.CharField(max_length=20000)),
('timeing', models.CharField(max_length=20000)),
('surveyData', models.CharField(max_length=20000)),
('tasks', models.CharField(max_length=20000)),
('workerId', models.CharField(max_length=20000)),
('assId', models.CharField(max_length=20000)),
],
),
]

View file

@ -0,0 +1,16 @@
from django.db import models
class Question(models.Model):
ID = models.IntegerField(primary_key=True)
QA_results = models.CharField(max_length=20000)
reco_results = models.CharField(max_length=20000)
timeing = models.CharField(max_length=20000)
surveyData = models.CharField(max_length=20000)
tasks = models.CharField(max_length=20000)
workerId = models.CharField(max_length=20000)
assId = models.CharField(max_length=20000)
def __str__(self):
return self.ID

View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View file

@ -0,0 +1,7 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]

View file

@ -0,0 +1,27 @@
from django.shortcuts import render
import simplejson
# Create your views here.
from django.http import HttpResponse
from .models import Question
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def index(request):
if request.method == 'POST':
print(request.POST)
req = simplejson.loads(request.body)
print(req)
QA_results = req['results']["outputs"]['qa_answers']
reco_results = req['results']["outputs"]["re_answers"]
timeing = req['results']["outputs"]["timing"]
surveyData = req['results']["outputs"]["surveyData"]
tasks = req['results']["outputs"]["tasks"]
workerId = req['workerId']
assId = req['assignmentId']
Question.objects.create(QA_results = QA_results, reco_results = reco_results, timeing = timeing, surveyData = surveyData, tasks = tasks, workerId = workerId, assId = assId)
return HttpResponse("receive")
else:
return HttpResponse("Hello, world. You're at the new3 index.")

View file

@ -0,0 +1,5 @@
from django.contrib import admin
from .models import Question
admin.site.register(Question)

View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class New4Config(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'new4'

View file

@ -0,0 +1,27 @@
# Generated by Django 3.2.6 on 2021-08-16 20:18
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)),
('QA_results', models.CharField(max_length=20000)),
('reco_results', models.CharField(max_length=20000)),
('timeing', models.CharField(max_length=20000)),
('surveyData', models.CharField(max_length=20000)),
('tasks', models.CharField(max_length=20000)),
('workerId', models.CharField(max_length=20000)),
('assId', models.CharField(max_length=20000)),
],
),
]

View file

@ -0,0 +1,16 @@
from django.db import models
class Question(models.Model):
ID = models.IntegerField(primary_key=True)
QA_results = models.CharField(max_length=20000)
reco_results = models.CharField(max_length=20000)
timeing = models.CharField(max_length=20000)
surveyData = models.CharField(max_length=20000)
tasks = models.CharField(max_length=20000)
workerId = models.CharField(max_length=20000)
assId = models.CharField(max_length=20000)
def __str__(self):
return self.ID

View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View file

@ -0,0 +1,7 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]

View file

@ -0,0 +1,27 @@
from django.shortcuts import render
import simplejson
# Create your views here.
from django.http import HttpResponse
from .models import Question
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def index(request):
if request.method == 'POST':
print(request.POST)
req = simplejson.loads(request.body)
print(req)
QA_results = req['results']["outputs"]['qa_answers']
reco_results = req['results']["outputs"]["re_answers"]
timeing = req['results']["outputs"]["timing"]
surveyData = req['results']["outputs"]["surveyData"]
tasks = req['results']["outputs"]["tasks"]
workerId = req['workerId']
assId = req['assignmentId']
Question.objects.create(QA_results = QA_results, reco_results = reco_results, timeing = timeing, surveyData = surveyData, tasks = tasks, workerId = workerId, assId = assId)
return HttpResponse("receive")
else:
return HttpResponse("Hello, world. You're at the new4 index.")

View file

@ -0,0 +1,5 @@
from django.contrib import admin
from .models import Question
admin.site.register(Question)

View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class New5Config(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'new5'

View file

@ -0,0 +1,27 @@
# Generated by Django 3.2.6 on 2021-08-16 20:18
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)),
('QA_results', models.CharField(max_length=20000)),
('reco_results', models.CharField(max_length=20000)),
('timeing', models.CharField(max_length=20000)),
('surveyData', models.CharField(max_length=20000)),
('tasks', models.CharField(max_length=20000)),
('workerId', models.CharField(max_length=20000)),
('assId', models.CharField(max_length=20000)),
],
),
]

View file

@ -0,0 +1,16 @@
from django.db import models
class Question(models.Model):
ID = models.IntegerField(primary_key=True)
QA_results = models.CharField(max_length=20000)
reco_results = models.CharField(max_length=20000)
timeing = models.CharField(max_length=20000)
surveyData = models.CharField(max_length=20000)
tasks = models.CharField(max_length=20000)
workerId = models.CharField(max_length=20000)
assId = models.CharField(max_length=20000)
def __str__(self):
return self.ID

View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View file

@ -0,0 +1,7 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]

View file

@ -0,0 +1,27 @@
from django.shortcuts import render
import simplejson
# Create your views here.
from django.http import HttpResponse
from .models import Question
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def index(request):
if request.method == 'POST':
print(request.POST)
req = simplejson.loads(request.body)
print(req)
QA_results = req['results']["outputs"]['qa_answers']
reco_results = req['results']["outputs"]["re_answers"]
timeing = req['results']["outputs"]["timing"]
surveyData = req['results']["outputs"]["surveyData"]
tasks = req['results']["outputs"]["tasks"]
workerId = req['workerId']
assId = req['assignmentId']
Question.objects.create(QA_results = QA_results, reco_results = reco_results, timeing = timeing, surveyData = surveyData, tasks = tasks, workerId = workerId, assId = assId)
return HttpResponse("receive")
else:
return HttpResponse("Hello, world. You're at the new5 index.")

View file

@ -0,0 +1,5 @@
from django.contrib import admin
from .models import Question
admin.site.register(Question)

Some files were not shown because too many files have changed in this diff Show more