[
  {
    "path": ".deepsource.toml",
    "content": "version = 1\n\n[[analyzers]]\nname = \"python\"\nenabled = true\n\n  [analyzers.meta]\n  runtime_version = \"3.x.x\"\n\n[[analyzers]]\nname = \"javascript\"\nenabled = true\n\n  [analyzers.meta]\n  environment = [\"browser\"]\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "ko_fi: kimlimjustin"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n**Desktop (please complete the following information):**\n - OS: [e.g. iOS]\n - Browser [e.g. chrome, safari]\n - Version [e.g. 22]\n\n**Smartphone (please complete the following information):**\n - Device: [e.g. iPhone6]\n - OS: [e.g. iOS8.1]\n - Browser [e.g. stock browser, safari]\n - Version [e.g. 22]\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Is your feature request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm always frustrated when [...]\n\n**Describe the solution you'd like**\nA clear and concise description of what you want to happen.\n\n**Describe alternatives you've considered**\nA clear and concise description of any alternative solutions or features you've considered.\n\n**Additional context**\nAdd any other context or screenshots about the feature request here.\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n- package-ecosystem: pip\n  directory: \"/\"\n  schedule:\n    interval: daily\n    time: \"22:00\"\n  open-pull-requests-limit: 10\n"
  },
  {
    "path": ".gitignore",
    "content": "*.sqlite3\n*.sqlite3-journal\n*.pyo\n*.pyc\ndata"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as\ncontributors and maintainers pledge to making participation in our project and\nour community a harassment-free experience for everyone, regardless of age, body\nsize, disability, ethnicity, sex characteristics, gender identity and expression,\nlevel of experience, education, socio-economic status, nationality, personal\nappearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment\ninclude:\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n* The use of sexualized language or imagery and unwelcome sexual attention or\n advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic\n address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a\n professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable\nbehavior and are expected to take appropriate and fair corrective action in\nresponse to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or\nreject comments, commits, code, wiki edits, issues, and other contributions\nthat are not aligned to this Code of Conduct, or to ban temporarily or\npermanently any contributor for other behaviors that they deem inappropriate,\nthreatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces\nwhen an individual is representing the project or its community. Examples of\nrepresenting a project or community include using an official project e-mail\naddress, posting via an official social media account, or acting as an appointed\nrepresentative at an online or offline event. Representation of a project may be\nfurther defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be\nreported by contacting the project team at kimlimjustin@gmail.com. All\ncomplaints will be reviewed and investigated and will result in a response that\nis deemed necessary and appropriate to the circumstances. The project team is\nobligated to maintain confidentiality with regard to the reporter of an incident.\nFurther details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good\nfaith may face temporary or permanent repercussions as determined by other\nmembers of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,\navailable at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\n\n[homepage]: https://www.contributor-covenant.org\n\nFor answers to common questions about this code of conduct, see\nhttps://www.contributor-covenant.org/faq\n"
  },
  {
    "path": "Dockerfile",
    "content": "# syntax=docker/dockerfile:1\nFROM python:3\nENV PYTHONUNBUFFERED=1\nWORKDIR /code\nCOPY requirements.txt /code/\nRUN pip install -r requirements.txt\nCOPY . /code/"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2020 Justin Maximillian Kimlim\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# Google Forms CLONE\n\n### Demo application and feedback [here](https://google-forms-clone.herokuapp.com/form/in60XZ4GWUswvkaKEOxONvIKkhy4gl/viewform)\n\n![Google Forms clone demo](https://drive.google.com/uc?export=view&id=1GEApyE6aRP74zf2ltmTqpr97NDMHOHbP) \n\n<details>\n<summary>\nMore screenshots\n</summary>\n\n![Google Forms clone demo](https://drive.google.com/uc?export=view&id=1QhPVWHXKApcv5V6FzrHRzut7a5-1Mgp4)\n![Google Forms clone demo](https://drive.google.com/uc?export=view&id=1Nwz642ORdTCd6KdsaN28Tt142K3wH-pt)\n##### For the best experience, please use a device with a width of at least 350px\n- Note that this Google Forms CLONE don't support image uploading due to [Heroku policy](https://help.heroku.com/K1PPS2WM/why-are-my-file-uploads-missing-deleted)\n\n</details>\n## Built using:\n- Python with Django framework and Jinja templating language\n- Vanilla Javascript\n\n## Getting started:\n- Clone this repository or fork it\n    - To clone this repository type git clone `https://github.com/kimlimjustin/google-form-clone.git` on your command line\n    - To fork this repository, click fork button of this repository then type git clone `https://github.com/<your username>/google-form-clone.git`\n- Install all the dependencies of this project by typing `pip install -r requirements.txt`\n- Migrate the database by typing `python manage.py migrate` on the command line\n- Run the project locally by typing `python manage.py runserver` on the command line\n    - NB: to run it on your local network, type `python manage.py runserver 0.0.0.0:8000`\n- You project will be accessible in your localhost or local network.\n\n## Deployment\nFor deployment, open `form/settings.py` file and uncomment code from line 131 to 159.\n\n## License\nDistributed under the [MIT](https://github.com/kimlimjustin/google-form-clone/blob/master/LICENSE) License. See [`LICENSE`](https://github.com/kimlimjustin/google-form-clone/blob/master/LICENSE) for more information.\n\n## Contact\n- Justin Maximillian Kimlim - [kimlimjustin@gmail.com](mailto:kimlimjustin@gmail.com)\n- Project link: https://github.com/kimlimjustin/google-form-clone\n\n## Love my work?\n\n<a href='https://ko-fi.com/kimlimjustin' target='_blank'><img height='35' style='border:0px;height:34px;' src='https://az743702.vo.msecnd.net/cdn/kofi3.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' />"
  },
  {
    "path": "docker-compose.yml",
    "content": "version: \"3.9\"\n   \nservices:\n  db:\n    image: postgres\n    volumes:\n      - ./data/db:/var/lib/postgresql/data\n    environment:\n      - POSTGRES_DB=postgres\n      - POSTGRES_USER=postgres\n      - POSTGRES_PASSWORD=postgres\n  web:\n    build: .\n    command: python manage.py runserver 0.0.0.0:8000\n    volumes:\n      - .:/code\n    ports:\n      - \"8000:8000\"\n    depends_on:\n      - db\n  migration:\n    build: .\n    command: python manage.py migrate --noinput\n    volumes:\n      - .:/code\n    depends_on:\n      - db"
  },
  {
    "path": "form/__init__.py",
    "content": ""
  },
  {
    "path": "form/asgi.py",
    "content": "\"\"\"\nASGI config for form project.\n\nIt exposes the ASGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/3.1/howto/deployment/asgi/\n\"\"\"\n\nimport os\n\nfrom django.core.asgi import get_asgi_application\n\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'form.settings')\n\napplication = get_asgi_application()\n"
  },
  {
    "path": "form/settings.py",
    "content": "\"\"\"\nDjango settings for form project.\n\nGenerated by 'django-admin startproject' using Django 3.1.3.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/3.1/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/3.1/ref/settings/\n\"\"\"\n\nfrom pathlib import Path\n\n# Build paths inside the project like this: BASE_DIR / 'subdir'.\nBASE_DIR = Path(__file__).resolve().parent.parent\n\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = '5&41du-&cv-cazt$r@k84h*gz-s!*jk2b)131ek^2-lpou#2y4'\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = True\n\nimport socket\n\ns = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\ns.connect((\"8.8.8.8\", 80))\n\nALLOWED_HOSTS = [s.getsockname()[0], '127.0.0.1', 'localhost']\ns.close()\n\n\n# Application definition\n\nINSTALLED_APPS = [\n    'index',\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n]\n\nMIDDLEWARE = [\n    'django.middleware.security.SecurityMiddleware',\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    'django.middleware.clickjacking.XFrameOptionsMiddleware',\n]\n\nROOT_URLCONF = 'form.urls'\n\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': [],\n        'APP_DIRS': True,\n        'OPTIONS': {\n            'context_processors': [\n                'django.template.context_processors.debug',\n                'django.template.context_processors.request',\n                'django.contrib.auth.context_processors.auth',\n                'django.contrib.messages.context_processors.messages',\n            ],\n        },\n    },\n]\n\nWSGI_APPLICATION = 'form.wsgi.application'\n\n\n# Database\n# https://docs.djangoproject.com/en/3.1/ref/settings/#databases\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.sqlite3',\n        'NAME': BASE_DIR / 'db.sqlite3',\n    }\n}\n\n\n# Password validation\n# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators\n\nAUTH_PASSWORD_VALIDATORS = [\n    {\n        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',\n    },\n    {\n        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',\n    },\n]\n\n\nAUTH_USER_MODEL = \"index.User\"\n\n# Internationalization\n# https://docs.djangoproject.com/en/3.1/topics/i18n/\n\nLANGUAGE_CODE = 'en-us'\n\nTIME_ZONE = 'UTC'\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/3.1/howto/static-files/\n\nSTATIC_URL = '/static/'\n\n'''SECURE_SSL_REDIRECT = True\nSESSION_COOKIE_SECURE = True\nCSRF_COOKIE_SECURE = True\nSECURE_HSTS_SECONDS = 31536000\nSECURE_HSTS_INCLUDE_SUBDOMAINS = True\nSECURE_HSTS_PRELOAD = True\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/3.1/howto/static-files/\n\nMEDIA_ROOT =  os.path.join(BASE_DIR, 'media') \nMEDIA_URL = '/media/'\n\n\nPROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nSTATIC_ROOT  =   os.path.join(PROJECT_ROOT, 'staticfiles')\nSTATIC_URL = '/static/'\nCOMPRESS_ENABLED = os.environ.get('COMPRESS_ENABLED', False)\n# Extra lookup directories for collectstatic to find static files\nSTATICFILES_DIRS = (\n    os.path.join(PROJECT_ROOT, 'static'),\n)\n\n#  Add configuration for static files storage using whitenoise\nSTATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'\n\nprod_db  =  dj_database_url.config(conn_max_age=500)\nDATABASES['default'].update(prod_db)\n'''"
  },
  {
    "path": "form/urls.py",
    "content": "\"\"\"form URL Configuration\n\nThe `urlpatterns` list routes URLs to views. For more information please see:\n    https://docs.djangoproject.com/en/3.1/topics/http/urls/\nExamples:\nFunction views\n    1. Add an import:  from my_app import views\n    2. Add a URL to urlpatterns:  path('', views.home, name='home')\nClass-based views\n    1. Add an import:  from other_app.views import Home\n    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')\nIncluding another URLconf\n    1. Import the include() function: from django.urls import include, path\n    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))\n\"\"\"\nfrom django.contrib import admin\nfrom django.urls import path, include\nfrom django.contrib.staticfiles.storage import staticfiles_storage\nfrom django.views.generic.base import RedirectView\n\nurlpatterns = [\n    path('admin/', admin.site.urls),\n    path('', include('index.urls')),\n    path('favicon.ico', RedirectView.as_view(url = staticfiles_storage.url('favicon.ico')))\n]\n"
  },
  {
    "path": "form/wsgi.py",
    "content": "\"\"\"\nWSGI config for form project.\n\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/\n\"\"\"\n\nimport os\n\nfrom django.core.wsgi import get_wsgi_application\n\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'form.settings')\n\napplication = get_wsgi_application()\n"
  },
  {
    "path": "index/__init__.py",
    "content": ""
  },
  {
    "path": "index/admin.py",
    "content": "from django.contrib import admin\n\n# Register your models here.\n"
  },
  {
    "path": "index/apps.py",
    "content": "from django.apps import AppConfig\n\n\nclass IndexConfig(AppConfig):\n    name = 'index'\n"
  },
  {
    "path": "index/migrations/0001_initial.py",
    "content": "# Generated by Django 3.1.3 on 2020-11-28 13:29\n\nfrom django.conf import settings\nimport django.contrib.auth.models\nimport django.contrib.auth.validators\nfrom django.db import migrations, models\nimport django.db.models.deletion\nimport django.utils.timezone\n\n\nclass Migration(migrations.Migration):\n\n    initial = True\n\n    dependencies = [\n        ('auth', '0012_alter_user_first_name_max_length'),\n    ]\n\n    operations = [\n        migrations.CreateModel(\n            name='User',\n            fields=[\n                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),\n                ('password', models.CharField(max_length=128, verbose_name='password')),\n                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),\n                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),\n                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),\n                ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),\n                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),\n                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),\n                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),\n                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),\n                ('email', models.EmailField(max_length=254, unique=True)),\n                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),\n                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),\n            ],\n            options={\n                'verbose_name': 'user',\n                'verbose_name_plural': 'users',\n                'abstract': False,\n            },\n            managers=[\n                ('objects', django.contrib.auth.models.UserManager()),\n            ],\n        ),\n        migrations.CreateModel(\n            name='Answer',\n            fields=[\n                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),\n                ('answer', models.CharField(max_length=5000)),\n            ],\n        ),\n        migrations.CreateModel(\n            name='Choices',\n            fields=[\n                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),\n                ('choice', models.CharField(max_length=5000)),\n                ('is_answer', models.BooleanField(default=False)),\n            ],\n        ),\n        migrations.CreateModel(\n            name='Form',\n            fields=[\n                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),\n                ('code', models.CharField(max_length=30)),\n                ('title', models.CharField(max_length=200)),\n                ('description', models.CharField(blank=True, max_length=10000)),\n                ('background_color', models.CharField(default='#d9efed', max_length=20)),\n                ('text_color', models.CharField(default='#272124', max_length=20)),\n                ('collect_email', models.BooleanField(default=False)),\n                ('authenticated_responder', models.BooleanField(default=False)),\n                ('edit_after_submit', models.BooleanField(default=False)),\n                ('see_response', models.BooleanField(default=False)),\n                ('confirmation_message', models.CharField(default='Your response has been recorded.', max_length=10000)),\n                ('is_quiz', models.BooleanField(default=False)),\n                ('allow_view_score', models.BooleanField(default=True)),\n                ('createdAt', models.DateTimeField(auto_now_add=True)),\n                ('updatedAt', models.DateTimeField(auto_now=True)),\n                ('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='creator', to=settings.AUTH_USER_MODEL)),\n            ],\n        ),\n        migrations.CreateModel(\n            name='Responses',\n            fields=[\n                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),\n                ('response_code', models.CharField(max_length=20)),\n                ('responder_ip', models.CharField(max_length=30)),\n                ('responder_email', models.EmailField(max_length=254)),\n                ('responder', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='responder', to=settings.AUTH_USER_MODEL)),\n                ('response', models.ManyToManyField(related_name='response', to='index.Answer')),\n                ('response_to', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='response_to', to='index.form')),\n            ],\n        ),\n        migrations.CreateModel(\n            name='Questions',\n            fields=[\n                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),\n                ('question', models.CharField(max_length=10000)),\n                ('question_type', models.CharField(max_length=20)),\n                ('required', models.BooleanField(default=False)),\n                ('answer_key', models.CharField(blank=True, max_length=5000)),\n                ('score', models.IntegerField(blank=True, default=0)),\n                ('feedback', models.CharField(max_length=5000, null=True)),\n                ('choices', models.ManyToManyField(related_name='choices', to='index.Choices')),\n            ],\n        ),\n        migrations.AddField(\n            model_name='form',\n            name='questions',\n            field=models.ManyToManyField(related_name='questions', to='index.Questions'),\n        ),\n        migrations.AddField(\n            model_name='answer',\n            name='answer_to',\n            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='answer_to', to='index.questions'),\n        ),\n    ]\n"
  },
  {
    "path": "index/migrations/0002_auto_20201128_2040.py",
    "content": "# Generated by Django 3.1.3 on 2020-11-28 13:40\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n    dependencies = [\n        ('index', '0001_initial'),\n    ]\n\n    operations = [\n        migrations.AlterField(\n            model_name='responses',\n            name='responder_email',\n            field=models.EmailField(blank=True, max_length=254),\n        ),\n    ]\n"
  },
  {
    "path": "index/migrations/0003_remove_form_see_response.py",
    "content": "# Generated by Django 3.1.3 on 2020-11-28 14:58\n\nfrom django.db import migrations\n\n\nclass Migration(migrations.Migration):\n\n    dependencies = [\n        ('index', '0002_auto_20201128_2040'),\n    ]\n\n    operations = [\n        migrations.RemoveField(\n            model_name='form',\n            name='see_response',\n        ),\n    ]\n"
  },
  {
    "path": "index/migrations/__init__.py",
    "content": ""
  },
  {
    "path": "index/models.py",
    "content": "from django.db import models\nfrom django.contrib.auth.models import AbstractUser\n\n# Create your models here.\nclass User(AbstractUser, models.Model):\n    email = models.EmailField(unique = True)\n\nclass Choices(models.Model):\n    choice = models.CharField(max_length=5000)\n    is_answer = models.BooleanField(default=False)\n\nclass Questions(models.Model):\n    question = models.CharField(max_length= 10000)\n    question_type = models.CharField(max_length=20)\n    required = models.BooleanField(default= False)\n    answer_key = models.CharField(max_length = 5000, blank = True)\n    score = models.IntegerField(blank = True, default=0)\n    feedback = models.CharField(max_length = 5000, null = True)\n    choices = models.ManyToManyField(Choices, related_name = \"choices\")\n\nclass Answer(models.Model):\n    answer = models.CharField(max_length=5000)\n    answer_to = models.ForeignKey(Questions, on_delete = models.CASCADE ,related_name = \"answer_to\")\n\nclass Form(models.Model):\n    code = models.CharField(max_length=30)\n    title = models.CharField(max_length=200)\n    description = models.CharField(max_length=10000, blank = True)\n    creator = models.ForeignKey(User, on_delete = models.CASCADE, related_name = \"creator\")\n    background_color = models.CharField(max_length=20, default = \"#d9efed\")\n    text_color = models.CharField(max_length=20, default=\"#272124\")\n    collect_email = models.BooleanField(default=False)\n    authenticated_responder = models.BooleanField(default = False)\n    edit_after_submit = models.BooleanField(default=False)\n    confirmation_message = models.CharField(max_length = 10000, default = \"Your response has been recorded.\")\n    is_quiz = models.BooleanField(default=False)\n    allow_view_score = models.BooleanField(default= True)\n    createdAt = models.DateTimeField(auto_now_add = True)\n    updatedAt = models.DateTimeField(auto_now = True)\n    questions = models.ManyToManyField(Questions, related_name = \"questions\")\n\nclass Responses(models.Model):\n    response_code = models.CharField(max_length=20)\n    response_to = models.ForeignKey(Form, on_delete = models.CASCADE, related_name = \"response_to\")\n    responder_ip = models.CharField(max_length=30)\n    responder = models.ForeignKey(User, on_delete = models.CASCADE, related_name = \"responder\", blank = True, null = True)\n    responder_email = models.EmailField(blank = True)\n    response = models.ManyToManyField(Answer, related_name = \"response\")"
  },
  {
    "path": "index/static/index/HurlUI.css",
    "content": "@import url(\"https://fonts.googleapis.com/css?family=Roboto+Condensed\");\n@import url(\"https://fonts.googleapis.com/css?family=Poppins\");\n@import url(\"https://fonts.googleapis.com/css?family=Montserrat\");\n@import url(\"https://fonts.googleapis.com/css?family=Times+New+Roman\");\nbody{\n\tmargin: 0;\n\tpadding: 0;\n\tfont-family: \"Times New Roman\",\"Roboto Condensed\", \"Poppins\",\"Arial\";\n}\n\n.center{\n\ttext-align: center;\n}\n\n.link{\n    color: #000;\n    text-decoration: none;\n    opacity: .7;\n}\n.link:hover{opacity: .4;}\n\n.margin{\n\tmargin: 20px;\n}\n\n.margin-top-bottom{\n\tmargin: 20px 0;\n}\n\n.margin-left-right{\n\tmargin: 0 20px;\n}\n\n.text-link{\n\topacity: .8;\n}\n\n.text-link:hover{\n\topacity: .4;\n}\n.container {\n\tpadding-right: 15px;\n\tpadding-left: 15px;\n\tmargin-right: auto;\n\tmargin-left: auto;\n}\n.container-fluid {\n  \twidth: 100%;\n}\n[class*=\"col-\"] {\n  float: left;\n}\n.row{\n\tgrid-row-gap: 5px;\n\tgrid-column-gap: 5px;\n\tfloat: left;\n}\n.bg-dark, .btn-dark{\n\tbackground-color: #1c1e1f !important;\n\tcolor: #FFF !important;\n}\n\n.bg-light, .btn-light{\n\tbackground-color: #DAE0E2 !important;\n\tcolor: #000 !important;\n}\n\n.bg-black{\n\tbackground-color: #000 !important;\n\tcolor: #FFF !important;\n}\n\n.bg-white{\n\tbackground-color: #FFF !important;\n\tcolor: #000 !important;\n}\n\nbody[theme=\"dark\"]{\n\tbackground-color: #080808;\n\tcolor: #FFF;\n}\nbody[theme=\"light\"]{\n\tbackground-color: #F5F5F5;\n\tcolor: #000;\n}\n.text-dark{color: #1c1e1f !important;}\n.text-light{color: #DAE0E2 !important;}\n.text-danger{color: #E71C23 !important;}\n.text-success{color: #6AB04A !important;}\n.text-warning{color: #FFF222 !important;}\n.text-blur{opacity: .7;}\n.text-red{color : #e60000 !important;}\n.text-darkblue{color : #000066 !important;}\n.text-blue{color : #0000ff !important;}\n.text-green{color: #00b300 !important;}\n.text-darkgreen{color: #004d00 !important;}\n.text-lightgreen{color: #00e600 !important;}\n.text-orange{color: #ff9900 !important;}\n.text-cyan{color: #33ffff !important;} \n.text-gray{color: #ccccb3 !important;}\n\n.col-1 , .col-ex-1{width: 8.33%;}\n.col-2 , .col-ex-2{width: 16.66%;}\n.col-3 , .col-ex-3{width: 25%;}\n.col-4 , .col-ex-4{width: 33.33%;}\n.col-5 , .col-ex-5{width: 41.66%;}\n.col-6 , .col-ex-6{width: 50%;}\n.col-7 , .col-ex-7{width: 58.33%;}\n.col-8 , .col-ex-8{width: 66.66%;}\n.col-9 , .col-ex-9{width: 75%;}\n.col-10, .col-ex-10 {width: 83.33%;}\n.col-11, .col-ex-11 {width: 91.66%;}\n.col-12, .col-ex-1 {width: 100%;}\n\n.btn{\n\tpadding: 10px;\n\tborder: 1px solid black;\n\tborder-radius: 5px;\n\ttext-decoration: none;\n\tfont-size: 1rem;\n\tcolor: black;\n\tfont-family: \"Poppins\";\n}\n.btn-hover:hover{\n\tbox-shadow: 5px 2px 8px;\n\topacity: .7;\n}\n.btn-danger{background-color: #E71C23; color: #FFF;}\n.btn-success{background-color: #6AB04A; color: #FFF;}\n.btn-warning{background-color: #FFF222; color: #000;}\n\n.box{\n\tpadding: 10px;\n\tborder: 1px solid #999;\n\tborder-radius: 5px;\n\twidth: -webkit-fill-available;\n\twidth: -moz-available;\n}\n\n.box-image img, .box-image{\n\twidth: 100%;\n}\n.box-title, .heading-title{\n\tfont-weight: bold;\n\ttext-align: center;\n\tfont-family: \"Montserrat\";\n\tpadding: 2px 5px;\n\tborder-bottom: 0.5px solid #e6e6e6; \n}\n\n.box-text{\n\tfont-family: \"Roboto Condensed\";\n}\n\n.box-shadow{\n\tbox-shadow: 3px 5px 11px;\n}\n\n.form-label, .text-label{\n\tfont-family: \"Poppins\", \"Arial\";\n\tmargin: 10px 0;\n}\n\n.form-group{\n\tmargin: 16px 14px;\n}\n\n.form-control{\n\tcolor: black;\n\tborder: 1px solid #bfbfbf;\n\twidth: -webkit-fill-available;\n\twidth: -moz-available;\n\tborder-radius: 5px;\n\tpadding: 8px;\n\n}\n.form-hover:hover{\n\topacity: .7;\n\tbox-shadow: 2px 2px 3px;\n}\n.navbar{\n\tmargin: 0;\n\tpadding: 0;\n\toverflow: hidden;\n\tbackground-color: white;\n\twidth: 100%;\n}\n\n.nav-list{\n\tmargin: 0;\n\tlist-style-type: none;\n}\n.nav-logo, .nav-logo a{\n\tfloat: left;\n\tmax-width: 200px;\n\tmargin: 10px;\n\ttext-decoration: none;\n\tcolor: black;\n\tfont-size: 1.5rem;\n}\n.navbar .nav-item{\n\tdisplay: block;\n\ttext-align: center;\n\tpadding: 14px 16px;\n\tfont-size: 17px;\n\tfloat: right;\n}\n\n.navbar .nav-item a{\n\ttext-decoration: none;\n\tcolor: black;\n}\n.navbar .nav-item a:hover{\n\topacity: .7;\n}\n\n.nav-icon{\n\tdisplay: none !important;\n}\n\n.fixed-top{\n\ttop: 0px;\n\tposition: fixed;\n}\n\n.fixed-bottom{\n\tbottom: 0;\n\tposition: fixed;\n}\n\n.text-center{\n\ttext-align: center;\n}\n\nfooter, .footer{\n\twidth: 100%;\n\tfloat: left;\n}\n\n.copyright{\n\ttext-align: center;\n\tfont-size: 20px;\n\tborder-top: 1px solid;\n\tpadding: 10px;\n\tbackground-color: #000;\n\tcolor: #FFF;\n\tmargin: 0;\n}\n\ncode{\n\ttext-align: center;\n\tpadding: 10px 20px;\n\tborder-radius: 5px;\n}\n\n.img-frame{\n\tborder: 1px solid #ddd;\n\tborder-radius: 4px;\n\tpadding: 5px;\n}\n\n.img-hover:hover{\n\t opacity: .4;\n}\ntable{\n\twidth: 100%;\n}\n\nth{\n\theight: 40px;\n}\n\ntd{padding: 8px;}\n.table-border, .table-border table, .table-border th, .table-border tr, .table-border td{\n\tborder: 1px solid;\n}\n\n.table-white-black tr:nth-child(even){background-color: #000; color: #FFF;}\n.table-white-black tr:nth-child(odd){background-color: #FFF; color: #000;}\n.table-black-white tr:nth-child(odd){background-color: #000; color: #FFF;}\n.table-black-white tr:nth-child(even){background-color: #FFF; color: #000;}\n@media only screen and (max-width: 600px){\n\t.nav-icon{\n\t\tdisplay: block !important;\n\t\tposition: absolute;\n\t\tright: 20px;\n\t\ttop: 20px;\n\t}\n\n\t.nav-item{\n\t\tfloat: left;\n\t\twidth: 100vw;\n\t}\n\t.nav-responsive{\n\t\tdisplay: block !important;\n\t}\n\t.nav-list-responsive{\n\t\tdisplay: none;\n\t}\n}\n@media only screen and (max-width: 600px) {\n\t[class*=\"col-\"] {\n\t\twidth: 100% !important;\n\t}\n}\n@media only screen and (max-width: 768px){\n\t.col-1{\n\t\twidth: 16.66%;\n\t}\n\t.col-2{\n\t\twidth: 25%;\n\t}\n\t.col-3, .col-4, .col-5, .col-6{\n\t\twidth: 50%;\n\t}\n\t.col-7, .col-8, .col-9, .col-10, .col-11, .col-12{\n\t\twidth: 100%;\n\t}\n\t[class*=\"col-ex-\"]{\n\t\twidth: 100%;\n\t}\n}\n@media only screen and (min-width: 768px) {\n\t.container {\n\t\twidth: 750px;\n\t}\n}\n@media only screen and (min-width: 992px) {\n\t.container {\n\t\twidth: 970px;\n\t}\n}\n@media only screen and (min-width: 1200px) {\n\t.container {\n\t\twidth: 1170px;\n\t}\n}"
  },
  {
    "path": "index/static/index/form.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", () => {\n    const csrf = Cookies.get('csrftoken');\n    document.body.style.backgroundColor =  document.querySelector(\"#bg-color\").innerHTML;\n    document.body.style.color =  document.querySelector(\"#text-color\").innerHTML;\n    document.querySelectorAll(\".txt-clr\").forEach(element => {\n        element.style.color = document.querySelector(\"#text-color\").innerHTML;\n    })\n    document.querySelectorAll(\".input-form-title\").forEach(title => {\n        title.addEventListener(\"input\", function(){\n            fetch(`edit_title`, {\n                method: \"POST\",\n                headers: {'X-CSRFToken': csrf},\n                body: JSON.stringify({\n                    \"title\": this.value\n                })\n\n            })\n            document.title = `${this.value} - Google Forms CLONE`\n            document.querySelectorAll(\".input-form-title\").forEach(ele => {\n                ele.value = this.value;\n            })\n        })\n    })\n    document.querySelector(\"#input-form-description\").addEventListener(\"input\", function(){\n        fetch('edit_description', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({\n                \"description\": this.value\n            })\n        })\n    })\n    document.querySelectorAll(\".textarea-adjust\").forEach(tx => {\n        tx.style.height = \"auto\";\n        tx.style.height = (10 + tx.scrollHeight)+\"px\";\n        tx.addEventListener('input', e => {\n            tx.style.height = \"auto\";\n            tx.style.height = (10 + tx.scrollHeight)+\"px\";\n        })\n    })\n    document.querySelector(\"#customize-theme-btn\").addEventListener('click', () => {\n        document.querySelector(\"#customize-theme\").style.display = \"block\";\n        document.querySelector(\"#close-customize-theme\").addEventListener('click', () => {\n            document.querySelector(\"#customize-theme\").style.display = \"none\";\n        })\n        window.onclick = e => {\n            if(e.target == document.querySelector(\"#customize-theme\")) document.querySelector(\"#customize-theme\").style.display = \"none\";\n        }\n    })\n    document.querySelector(\"#input-bg-color\").addEventListener(\"input\", function(){\n        document.body.style.backgroundColor = this.value;\n        fetch('edit_background_color', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({\n                \"bgColor\": this.value\n            })\n        })\n    })\n    document.querySelector(\"#input-text-color\").addEventListener(\"input\", function(){\n        document.querySelectorAll(\".txt-clr\").forEach(element => {\n            element.style.color = this.value;\n        })\n        fetch('edit_text_color', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({\n                \"textColor\": this.value\n            })\n        })\n    })\n    document.querySelectorAll(\".open-setting\").forEach(ele => {\n        ele.addEventListener('click', () => {\n            document.querySelector(\"#setting\").style.display = \"block\";\n        })\n        document.querySelector(\"#close-setting\").addEventListener('click', () => {\n            document.querySelector(\"#setting\").style.display = \"none\";\n        })\n        window.onclick = e => {\n            if(e.target == document.querySelector(\"#setting\")) document.querySelector(\"#setting\").style.display = \"none\";\n        }\n    })\n    document.querySelectorAll(\"#send-form-btn\").forEach(btn => {\n        btn.addEventListener(\"click\", () => {\n            document.querySelector(\"#send-form\").style.display = \"block\";\n        })\n        document.querySelector(\"#close-send-form\").addEventListener(\"click\", () => {\n            document.querySelector(\"#send-form\").style.display = \"none\";\n        })\n        window.onclick = e => {\n            if(e.target == document.querySelector(\"#send-form\")) document.querySelector(\"#send-form\").style.display = \"none\";\n        }\n    })\n    document.querySelectorAll(\"[copy-btn]\").forEach(btn => {\n        btn.addEventListener(\"click\", () => {\n            var url = document.getElementById(\"copy-url\");\n            navigator.clipboard.writeText(url.value);\n            document.querySelector(\"#send-form\").style.display = \"none\";\n        })\n    })\n    document.querySelector(\"#setting-form\").addEventListener(\"submit\", e => {\n        e.preventDefault();\n        fetch('edit_setting', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({\n                \"collect_email\": document.querySelector(\"#collect_email\").checked,\n                \"is_quiz\": document.querySelector(\"#is_quiz\").checked,\n                \"authenticated_responder\": document.querySelector(\"#authenticated_responder\").checked,\n                \"confirmation_message\": document.querySelector(\"#comfirmation_message\").value,\n                \"edit_after_submit\": document.querySelector(\"#edit_after_submit\").checked,\n                \"allow_view_score\": document.querySelector(\"#allow_view_score\").checked,\n            })\n        })\n        document.querySelector(\"#setting\").style.display = \"none\";\n        if(!document.querySelector(\"#collect_email\").checked){\n            if(document.querySelector(\".collect-email\")) document.querySelector(\".collect-email\").parentNode.removeChild(document.querySelector(\".collect-email\"))\n        }else{\n            if(!document.querySelector(\".collect-email\")){\n                let collect_email = document.createElement(\"div\");\n                collect_email.classList.add(\"collect-email\")\n                collect_email.innerHTML = `<h3 class=\"question-title\">Email address <span class=\"require-star\">*</span></h3>\n                <input type=\"text\" autoComplete=\"off\" aria-label=\"Valid email address\" disabled dir = \"auto\" class=\"require-email-edit\"\n                placeholder = \"Valid email address\" />\n                <p class=\"collect-email-desc\">This form is collecting email addresses. <span class=\"open-setting\">Change settings</span></p>`\n                document.querySelector(\"#form-head\").appendChild(collect_email)\n            }\n        }\n        if(document.querySelector(\"#is_quiz\").checked){\n            if(!document.querySelector(\"#add-score\")){\n                let is_quiz = document.createElement('a')\n                is_quiz.setAttribute(\"href\", \"score\");\n                is_quiz.setAttribute(\"id\", \"add-score\");\n                is_quiz.innerHTML = `<img src = \"/static/Icon/score.png\" id=\"add-score\" class = \"form-option-icon\" title = \"Add score\" alt = \"Score icon\" />`;\n                document.querySelector(\".question-options\").appendChild(is_quiz)\n            }\n            if(!document.querySelector(\".score\")){\n                let quiz_nav = document.createElement(\"span\");\n                quiz_nav.classList.add(\"col-4\");\n                quiz_nav.classList.add(\"navigation\");\n                quiz_nav.classList.add('score');\n                quiz_nav.innerHTML =   `<a href = \"score\" class=\"link\">Scores</a>`;\n                [...document.querySelector(\".form-navigation\").children].forEach(element => {\n                    element.classList.remove(\"col-6\")\n                    element.classList.add('col-4')\n                })\n                document.querySelector(\".form-navigation\").insertBefore(quiz_nav, document.querySelector(\".form-navigation\").childNodes[2])\n            }\n        }else{\n            if(document.querySelector(\"#add-score\")) document.querySelector(\"#add-score\").parentNode.removeChild(document.querySelector(\"#add-score\"))\n            if(document.querySelector(\".score\")){\n                [...document.querySelector(\".form-navigation\").children].forEach(element => {\n                    element.classList.remove(\"col-4\")\n                    element.classList.add('col-6')\n                })\n                document.querySelector(\".score\").parentNode.removeChild(document.querySelector(\".score\"))\n            }\n        }\n    })\n    document.querySelector(\"#delete-form\").addEventListener(\"submit\", e => {\n        e.preventDefault();\n        if(window.confirm(\"Are you sure? This action CANNOT be undone.\")){\n            fetch('delete', {\n                method: \"DELETE\",\n                headers: {'X-CSRFToken': csrf}\n            })\n            .then(() => window.location = \"/\")\n        }\n    })\n    const editQuestion = () => {\n        document.querySelectorAll(\".input-question\").forEach(question => {\n            question.addEventListener('input', function(){\n                let question_type;\n                let required;\n                document.querySelectorAll(\".input-question-type\").forEach(qp => {\n                    if(qp.dataset.id === this.dataset.id) question_type = qp.value\n                })\n                document.querySelectorAll('.required-checkbox').forEach(rc => {\n                    if(rc.dataset.id === this.dataset.id) required = rc.checked;\n                })\n                fetch('edit_question', {\n                    method: \"POST\",\n                    headers: {'X-CSRFToken': csrf},\n                    body: JSON.stringify({\n                        id: this.dataset.id,\n                        question: this.value,\n                        question_type: question_type,\n                        required: required\n                    })\n                })\n            })\n        })\n    }\n    editQuestion();\n    \n    const editRequire = () => {\n        document.querySelectorAll(\".required-checkbox\").forEach(checkbox => {\n            checkbox.addEventListener('input', function(){\n                let question;\n                let question_type;\n                document.querySelectorAll(\".input-question-type\").forEach(qp => {\n                    if(qp.dataset.id === this.dataset.id) question_type = qp.value\n                })\n                document.querySelectorAll('.input-question').forEach(q => {\n                    if(q.dataset.id === this.dataset.id) question = q.value\n                })\n                fetch('edit_question', {\n                    method: \"POST\",\n                    headers: {'X-CSRFToken': csrf},\n                    body: JSON.stringify({\n                        id: this.dataset.id,\n                        question: question,\n                        question_type: question_type,\n                        required: this.checked\n                    })\n                })\n            })\n        })\n    }\n    editRequire()\n    const editChoice = () => {\n        document.querySelectorAll(\".edit-choice\").forEach(choice => {\n            choice.addEventListener(\"input\", function(){\n                fetch('edit_choice', {\n                    method: \"POST\",\n                    headers: {'X-CSRFToken': csrf},\n                    body: JSON.stringify({\n                        \"id\": this.dataset.id,\n                        \"choice\": this.value\n                    })\n                })\n            })\n        })\n    }\n    editChoice()\n    const removeOption = () => {\n        document.querySelectorAll(\".remove-option\").forEach(ele => {\n            ele.addEventListener(\"click\",function(){\n                fetch('remove_choice', {\n                    method: \"POST\",\n                    headers: {'X-CSRFToken': csrf},\n                    body: JSON.stringify({\n                        \"id\": this.dataset.id\n                    })\n                })\n                .then(() => {\n                    this.parentNode.parentNode.removeChild(this.parentNode)\n                })\n            })\n        })\n    }\n    removeOption()\n    const addOption = () => {\n        document.querySelectorAll(\".add-option\").forEach(question =>{\n            question.addEventListener(\"click\", function(){\n                fetch('add_choice', {\n                    method: \"POST\",\n                    headers: {'X-CSRFToken': csrf},\n                    body: JSON.stringify({\n                        \"question\": this.dataset.question\n                    })\n                })\n                .then(response => response.json())\n                .then(result => {\n                    let element = document.createElement(\"div\");\n                    element.classList.add('choice');\n                    if(this.dataset.type === \"multiple choice\"){\n                        element.innerHTML = `<input type=\"radio\" id=\"${result[\"id\"]}\" disabled>\n                        <label for=\"${result[\"id\"]}\">\n                            <input type=\"text\" value=\"${result[\"choice\"]}\" class=\"edit-choice\" data-id=\"${result[\"id\"]}\">\n                        </label>\n                        <span class=\"remove-option\" title = \"Remove\" data-id=\"${result[\"id\"]}\">&times;</span>`;\n                    }else if(this.dataset.type === \"checkbox\"){\n                        element.innerHTML = `<input type=\"checkbox\" id=\"${result[\"id\"]}\" disabled>\n                        <label for=\"${result[\"id\"]}\">\n                            <input type=\"text\" value=\"${result[\"choice\"]}\" class=\"edit-choice\" data-id=\"${result[\"id\"]}\">\n                        </label>\n                        <span class=\"remove-option\" title = \"Remove\" data-id=\"${result[\"id\"]}\">&times;</span>`;\n                    }\n                    document.querySelectorAll(\".choices\").forEach(choices => {\n                        if(choices.dataset.id === this.dataset.question){\n                            choices.insertBefore(element, choices.childNodes[choices.childNodes.length -2]);\n                            editChoice()\n                            removeOption()\n                        }\n                    });\n                })\n            })\n        })\n    }\n    addOption()\n    const deleteQuestion = () => {\n        document.querySelectorAll(\".delete-question\").forEach(question => {\n            question.addEventListener(\"click\", function(){\n                fetch(`delete_question/${this.dataset.id}`, {\n                    method: \"DELETE\",\n                    headers: {'X-CSRFToken': csrf},\n                })\n                .then(() => {\n                    document.querySelectorAll(\".question\").forEach(q =>{\n                        if(q.dataset.id === this.dataset.id){\n                            q.parentNode.removeChild(q)\n                        }\n                    })\n                })\n            })\n        })\n    }\n    deleteQuestion()\n    const changeType = () => {\n        document.querySelectorAll(\".input-question-type\").forEach(ele => {\n            ele.addEventListener('input', function(){\n                let required;\n                let question;\n                document.querySelectorAll('.required-checkbox').forEach(rc => {\n                    if(rc.dataset.id === this.dataset.id) required = rc.checked;\n                })\n                document.querySelectorAll('.input-question').forEach(q => {\n                    if(q.dataset.id === this.dataset.id) question = q.value\n                })\n                fetch('edit_question', {\n                    method: \"POST\",\n                    headers: {'X-CSRFToken': csrf},\n                    body: JSON.stringify({\n                        id: this.dataset.id,\n                        question: question,\n                        question_type: this.value,\n                        required: required\n                    })\n                })\n\n                if(this.dataset.origin_type === \"multiple choice\" || this.dataset.origin_type === \"checkbox\"){\n                    document.querySelectorAll(\".choices\").forEach(choicesElement => {\n                        if(choicesElement.dataset.id === this.dataset.id){\n                            if(this.value === \"multiple choice\" || this.value === \"checkbox\"){\n                                fetch(`get_choice/${this.dataset.id}`, {\n                                    method: \"GET\"\n                                })\n                                .then(response => response.json())\n                                .then(result => {\n                                    let ele = document.createElement(\"div\");\n                                    ele.classList.add('choices');\n                                    ele.setAttribute(\"data-id\", result[\"question_id\"])\n                                    let choices = '';\n                                    if(this.value === \"multiple choice\"){\n                                        for(let i in result[\"choices\"]){\n                                            if(i){ choices += `<div class=\"choice\">\n                                            <input type=\"radio\" id=\"${result[\"choices\"][i].id}\" disabled>\n                                            <label for=\"${result[\"choices\"][i].id}\">\n                                                <input type=\"text\" data-id=\"${result[\"choices\"][i].id}\" class=\"edit-choice\" value=\"${result[\"choices\"][i].choice}\">\n                                            </label>\n                                            <span class=\"remove-option\" title=\"Remove\" data-id=\"${result[\"choices\"][i].id}\">&times;</span></div>`}\n                                        }\n                                    }else if(this.value === \"checkbox\"){\n                                        for(let i in result[\"choices\"]){\n                                            if(i){choices += `<div class=\"choice\">\n                                            <input type=\"checkbox\" id=\"${result[\"choices\"][i].id}\" disabled>\n                                            <label for=\"${result[\"choices\"][i].id}\">\n                                                <input type=\"text\" data-id=\"${result[\"choices\"][i].id}\" class=\"edit-choice\" value=\"${result[\"choices\"][i].choice}\">\n                                            </label>\n                                            <span class=\"remove-option\" title=\"Remove\" data-id=\"${result[\"choices\"][i].id}\">&times;</span></div>`}\n                                        }\n                                    }\n                                    ele.innerHTML = `<div class=\"choice\">${choices}</div>\n                                    <div class=\"choice\">\n                                        <input type = \"radio\" id = \"add-choice\" disabled />\n                                        <label for = \"add-choice\" class=\"add-option\" id=\"add-option\" data-question=\"${result[\"question_id\"]}\"\n                                        data-type = \"${this.value}\">Add option</label>\n                                    </div>`;\n                                    choicesElement.parentNode.replaceChild(ele, choicesElement);\n                                    editChoice()\n                                    removeOption()\n                                    changeType()\n                                    editQuestion()\n                                    editRequire()\n                                    addOption()\n                                    deleteQuestion()\n                                })\n                            }else{\n                                if(this.value === \"short\"){\n                                    choicesElement.parentNode.removeChild(choicesElement)\n                                    let ele = document.createElement(\"div\");\n                                    ele.innerHTML = `<div class=\"answers\" data-id=\"${this.dataset.id}\">\n                                    <input type =\"text\" class=\"short-answer\" disabled placeholder=\"Short answer text\" />\n                                </div>`\n                                    this.parentNode.insertBefore(ele, this.parentNode.childNodes[4])\n                                }else if(this.value === \"paragraph\"){\n                                    choicesElement.parentNode.removeChild(choicesElement)\n                                    let ele = document.createElement(\"div\");\n                                    ele.innerHTML = `<div class=\"answers\" data-id=\"${this.dataset.id}\">\n                                    <textarea class=\"long-answer\" disabled placeholder=\"Long answer text\" ></textarea>\n                                </div>`\n                                    this.parentNode.insertBefore(ele, this.parentNode.childNodes[4])\n                                }\n                            }\n                        }\n                    })\n                }else{\n                    document.querySelectorAll(\".question-box\").forEach(question => {\n                        document.querySelectorAll(\".answers\").forEach(answer => {\n                            if(answer.dataset.id === this.dataset.id){\n                                answer.parentNode.removeChild(answer)\n                            }\n                        })\n                        if((this.value === \"multiple choice\" || this.value === \"checkbox\") && question.dataset.id === this.dataset.id){\n                            fetch(`get_choice/${this.dataset.id}`, {\n                                method: \"GET\"\n                            })\n                            .then(response => response.json())\n                            .then(result => {\n                                let ele = document.createElement(\"div\");\n                                ele.classList.add('choices');\n                                ele.setAttribute(\"data-id\", result[\"question_id\"])\n                                let choices = '';\n                                if(this.value === \"multiple choice\"){\n                                    for(let i in result[\"choices\"]){\n                                        if(i){ choices += `<div class=\"choice\">\n                                        <input type=\"radio\" id=\"${result[\"choices\"][i].id}\" disabled>\n                                        <label for=\"${result[\"choices\"][i].id}\">\n                                            <input type=\"text\" data-id=\"${result[\"choices\"][i].id}\" class=\"edit-choice\" value=\"${result[\"choices\"][i].choice}\">\n                                        </label>\n                                        <span class=\"remove-option\" title=\"Remove\" data-id=\"${result[\"choices\"][i].id}\">&times;</span></div>`}\n                                    }\n                                }else if(this.value === \"checkbox\"){\n                                    for(let i in result[\"choices\"]){\n                                        if(i){choices += `<div class=\"choice\">\n                                        <input type=\"checkbox\" id=\"${result[\"choices\"][i].id}\" disabled>\n                                        <label for=\"${result[\"choices\"][i].id}\">\n                                            <input type=\"text\" data-id=\"${result[\"choices\"][i].id}\" class=\"edit-choice\" value=\"${result[\"choices\"][i].choice}\">\n                                        </label>\n                                        <span class=\"remove-option\" title=\"Remove\" data-id=\"${result[\"choices\"][i].id}\">&times;</span></div>`}\n                                    }\n                                }\n                                ele.innerHTML = `<div class=\"choice\">${choices}</div>\n                                <div class=\"choice\">\n                                    <input type = \"radio\" id = \"add-choice\" disabled />\n                                    <label for = \"add-choice\" class=\"add-option\" id=\"add-option\" data-question=\"${result[\"question_id\"]}\"\n                                    data-type = \"${this.value}\">Add option</label>\n                                </div>`;\n                                question.insertBefore(ele, question.childNodes[4])\n                                editChoice()\n                                removeOption()\n                                changeType()\n                                editQuestion()\n                                editRequire()\n                                addOption()\n                                deleteQuestion()\n                            })\n                        }else{\n                            if(this.value === \"short\"){\n                                let ele = document.createElement(\"div\");\n                                ele.innerHTML = `<div class=\"answers\" data-id=\"${this.dataset.id}\">\n                                <input type =\"text\" class=\"short-answer\" disabled placeholder=\"Short answer text\" />\n                            </div>`\n                                this.parentNode.insertBefore(ele, this.parentNode.childNodes[4])\n                            }else if(this.value === \"paragraph\"){\n                                let ele = document.createElement(\"div\");\n                                ele.innerHTML = `<div class=\"answers\" data-id=\"${this.dataset.id}\">\n                                <textarea class=\"long-answer\" disabled placeholder=\"Long answer text\" ></textarea>\n                            </div>`\n                                this.parentNode.insertBefore(ele, this.parentNode.childNodes[4])\n                            }\n                        }\n                    })\n                }\n                this.setAttribute(\"data-origin_type\", this.value);\n            })\n        })\n    }\n    changeType()\n    document.querySelector(\"#add-question\").addEventListener(\"click\", () => {\n        fetch('add_question', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({})\n        })\n        .then(response => response.json())\n        .then(result => {\n            let ele = document.createElement('div')\n            ele.classList.add('margin-top-bottom');\n            ele.classList.add('box');\n            ele.classList.add('question-box');\n            ele.classList.add('question');\n            ele.setAttribute(\"data-id\", result[\"question\"].id)\n            ele.innerHTML = `\n            <input type=\"text\" data-id=\"${result[\"question\"].id}\" class=\"question-title edit-on-click input-question\" value=\"${result[\"question\"].question}\">\n            <select class=\"question-type-select input-question-type\" data-id=\"${result[\"question\"].id}\" data-origin_type = \"${result[\"question\"].question_type}\">\n                <option value=\"short\">Short answer</option>\n                <option value=\"paragraph\">Paragraph</option>\n                <option value=\"multiple choice\" selected>Multiple choice</option>\n                <option value=\"checkbox\">Checkbox</option>\n            </select>\n            <div class=\"choices\" data-id=\"${result[\"question\"].id}\">\n                <div class=\"choice\">\n                    <input type=\"radio\" id=\"${result[\"choices\"].id}\" disabled>\n                    <label for=\"${result[\"choices\"].id}\">\n                        <input type=\"text\" value=\"${result[\"choices\"].choice}\" class=\"edit-choice\" data-id=\"${result[\"choices\"].id}\">\n                    </label>\n                    <span class=\"remove-option\" title = \"Remove\" data-id=\"${result[\"choices\"].id}\">&times;</span>\n                </div>\n                <div class=\"choice\">\n                    <input type = \"radio\" id = \"add-choice\" disabled />\n                    <label for = \"add-choice\" class=\"add-option\" id=\"add-option\" data-question=\"${result[\"question\"].id}\" \n                    data-type = \"${result[\"question\"].question_type}\">Add option</label>\n                </div>\n            </div>\n            <div class=\"choice-option\">\n                <input type=\"checkbox\" class=\"required-checkbox\" id=\"${result[\"question\"].id}\" data-id=\"${result[\"question\"].id}\">\n                <label for=\"${result[\"question\"].id}\" class=\"required\">Required</label>\n                <div class=\"float-right\">\n                    <img src=\"/static/Icon/dustbin.png\" alt=\"Delete question icon\" class=\"question-option-icon delete-question\" title=\"Delete question\"\n                    data-id=\"${result[\"question\"].id}\">\n                </div>\n            </div>\n            `;\n            document.querySelector(\".container\").appendChild(ele);\n            editChoice()\n            removeOption()\n            changeType()\n            editQuestion()\n            editRequire()\n            addOption()\n            deleteQuestion()\n        })\n    })\n})"
  },
  {
    "path": "index/static/index/index.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", () => {\n    document.querySelector(\"#nav-ham\").addEventListener(\"click\", () => {\n        document.querySelector(\"#sidebar\").style.width = \"250px\";\n    })\n    document.querySelector(\"#close-sidebar\").addEventListener('click', () => {\n        document.querySelector(\"#sidebar\").style.width = \"0px\";\n    })\n    document.querySelector(\"#create-blank-form\").addEventListener(\"click\", () => {\n        const csrf = Cookies.get('csrftoken');\n        fetch('/form/create', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({\n                title: \"Untitled Form\"\n            })\n        })\n        .then(response => response.json())\n        .then(result => {\n            window.location = `/form/${result.code}/edit`\n        })\n    })\n    document.querySelector(\"#create-contact-form\").addEventListener(\"click\", () => {\n        const csrf = Cookies.get('csrftoken');\n        fetch('/form/create/contact', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({})\n        })\n        .then(response => response.json())\n        .then(result => {\n            window.location = `/form/${result.code}/edit`\n        })\n    })\n    document.querySelector(\"#create-customer-feedback\").addEventListener(\"click\", () => {\n        const csrf = Cookies.get('csrftoken');\n        fetch('/form/create/feedback', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({})\n        })\n        .then(response => response.json())\n        .then(result => {\n            window.location = `/form/${result.code}/edit`\n        })\n    })\n    document.querySelector(\"#create-event-registration\").addEventListener(\"click\", () => {\n        const csrf = Cookies.get('csrftoken');\n        fetch('/form/create/event', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({})\n        })\n        .then(response => response.json())\n        .then(result => {\n            window.location = `/form/${result.code}/edit`\n        })\n    })\n})"
  },
  {
    "path": "index/static/index/response.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", () => {\n    document.body.style.backgroundColor =  document.querySelector(\"#bg-color\").innerHTML;\n    document.body.style.color =  document.querySelector(\"#text-color\").innerHTML;\n    document.querySelectorAll(\".txtClr\").forEach(element => {\n        element.style.color = document.querySelector(\"#text-color\").innerHTML;\n    })\n})"
  },
  {
    "path": "index/static/index/responses.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", () => {\n    const csrf = Cookies.get('csrftoken');\n    document.body.style.backgroundColor =  document.querySelector(\"#bg-color\").innerHTML;\n    document.body.style.color =  document.querySelector(\"#text-color\").innerHTML;\n    document.querySelector(\"#customize-theme-btn\").addEventListener('click', () => {\n        document.querySelector(\"#customize-theme\").style.display = \"block\";\n        document.querySelector(\"#close-customize-theme\").addEventListener('click', () => {\n            document.querySelector(\"#customize-theme\").style.display = \"none\";\n        })\n        window.onclick = e => {\n            if(e.target == document.querySelector(\"#customize-theme\")) document.querySelector(\"#customize-theme\").style.display = \"none\";\n        }\n    })\n    document.querySelector(\"#input-bg-color\").addEventListener(\"input\", function(){\n        document.body.style.backgroundColor = this.value;\n        fetch('edit_background_color', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({\n                \"bgColor\": this.value\n            })\n        })\n    })\n    document.querySelector(\"#input-text-color\").addEventListener(\"input\", function(){\n        document.querySelectorAll(\".txt-clr\").forEach(element => {\n            element.style.color = this.value;\n        })\n        fetch('edit_text_color', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({\n                \"textColor\": this.value\n            })\n        })\n    })\n    document.querySelectorAll(\".open-setting\").forEach(ele => {\n        ele.addEventListener('click', () => {\n            document.querySelector(\"#setting\").style.display = \"block\";\n        })\n        document.querySelector(\"#close-setting\").addEventListener('click', () => {\n            document.querySelector(\"#setting\").style.display = \"none\";\n        })\n        window.onclick = e => {\n            if(e.target == document.querySelector(\"#setting\")) document.querySelector(\"#setting\").style.display = \"none\";\n        }\n    })\n    document.querySelector(\"#delete-form\").addEventListener(\"submit\", e => {\n        e.preventDefault();\n        if(window.confirm(\"Are you sure? This action CANNOT be undone.\")){\n            fetch('delete', {\n                method: \"DELETE\",\n                headers: {'X-CSRFToken': csrf}\n            })\n            .then(() => window.location = \"/\")\n        }\n    })\n    document.querySelectorAll(\"#send-form-btn\").forEach(btn => {\n        btn.addEventListener(\"click\", () => {\n            document.querySelector(\"#send-form\").style.display = \"block\";\n        })\n        document.querySelector(\"#close-send-form\").addEventListener(\"click\", () => {\n            document.querySelector(\"#send-form\").style.display = \"none\";\n        })\n        window.onclick = e => {\n            if(e.target == document.querySelector(\"#send-form\")) document.querySelector(\"#send-form\").style.display = \"none\";\n        }\n    })\n    document.querySelectorAll(\"[copy-btn]\").forEach(btn => {\n        btn.addEventListener(\"click\", () => {\n            var url = document.getElementById(\"copy-url\");\n            navigator.clipboard.writeText(url.value);\n            document.querySelector(\"#send-form\").style.display = \"none\";\n        })\n    })\n    document.querySelector(\"#setting-form\").addEventListener(\"submit\", e => {\n        e.preventDefault();\n        fetch('edit_setting', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({\n                \"collect_email\": document.querySelector(\"#collect_email\").checked,\n                \"is_quiz\": document.querySelector(\"#is_quiz\").checked,\n                \"authenticated_responder\": document.querySelector(\"#authenticated_responder\").checked,\n                \"confirmation_message\": document.querySelector(\"#comfirmation_message\").value,\n                \"edit_after_submit\": document.querySelector(\"#edit_after_submit\").checked,\n                \"allow_view_score\": document.querySelector(\"#allow_view_score\").checked\n            })\n        })\n        document.querySelector(\"#setting\").style.display = \"none\";\n        if(!document.querySelector(\"#collect_email\").checked){\n            if(document.querySelector(\".collect-email\")) document.querySelector(\".collect-email\").parentNode.removeChild(document.querySelector(\".collect-email\"))\n        }else{\n            if(!document.querySelector(\".collect-email\")){\n                let collect_email = document.createElement(\"div\");\n                collect_email.classList.add(\"collect-email\")\n                collect_email.innerHTML = `<h3 class=\"question-title\">Email address <span class=\"require-star\">*</span></h3>\n                <input type=\"text\" autoComplete=\"off\" aria-label=\"Valid email address\" disabled dir = \"auto\" class=\"require-email-edit\"\n                placeholder = \"Valid email address\" />\n                <p class=\"collect-email-desc\">This form is collecting email addresses. <span class=\"open-setting\">Change settings</span></p>`\n                document.querySelector(\"#form-head\").appendChild(collect_email)\n            }\n        }\n        if(document.querySelector(\"#is_quiz\").checked){\n            if(!document.querySelector(\"#add-score\")){\n                let is_quiz = document.createElement('a')\n                is_quiz.setAttribute(\"href\", \"score\");\n                is_quiz.setAttribute(\"id\", \"add-score\");\n                is_quiz.innerHTML = `<img src = \"/static/Icon/score.png\" id=\"add-score\" class = \"form-option-icon\" title = \"Add score\" alt = \"Score icon\" />`;\n                document.querySelector(\".question-options\").appendChild(is_quiz)\n            }\n            if(!document.querySelector(\".score\")){\n                let quiz_nav = document.createElement(\"span\");\n                quiz_nav.classList.add(\"col-4\");\n                quiz_nav.classList.add(\"navigation\");\n                quiz_nav.classList.add('score');\n                quiz_nav.innerHTML =   `<a href = \"score\" class=\"link\">Scores</a>`;\n                [...document.querySelector(\".form-navigation\").children].forEach(element => {\n                    element.classList.remove(\"col-6\")\n                    element.classList.add('col-4')\n                })\n                document.querySelector(\".form-navigation\").insertBefore(quiz_nav, document.querySelector(\".form-navigation\").childNodes[2])\n            }\n        }else{\n            if(document.querySelector(\"#add-score\")) document.querySelector(\"#add-score\").parentNode.removeChild(document.querySelector(\"#add-score\"))\n            if(document.querySelector(\".score\")){\n                [...document.querySelector(\".form-navigation\").children].forEach(element => {\n                    element.classList.remove(\"col-4\")\n                    element.classList.add('col-6')\n                })\n                document.querySelector(\".score\").parentNode.removeChild(document.querySelector(\".score\"))\n            }\n        }\n    })\n    document.querySelectorAll(\".textarea-adjust\").forEach(tx => {\n        tx.style.height = \"auto\";\n        tx.style.height = (10 + tx.scrollHeight)+\"px\";\n        tx.addEventListener('input', e => {\n            tx.style.height = \"auto\";\n            tx.style.height = (10 + tx.scrollHeight)+\"px\";\n        })\n    })\n    if(document.querySelector(\"#delete-responses\")){\n        document.querySelector(\"#delete-responses\").addEventListener(\"click\", () => {\n            if(window.confirm(\"Are you sure? This action CANNOT be undone.\")){\n                fetch('responses/delete', {\n                    method: \"DELETE\",\n                    headers: {'X-CSRFToken': csrf}\n                })\n                .then(() => {\n                    let ele = document.createElement(\"div\");\n                    ele.classList.add('margin-top-bottom');\n                    ele.classList.add('box');\n                    ele.classList.add('question-box');\n                    ele.innerHTML = '<h1 class=\"response-title\">0 responses</h1>';\n                    document.querySelector(\"#responses\").parentNode.replaceChild(ele, document.querySelector(\"#responses\"))\n                })\n            }\n        })\n    }\n})"
  },
  {
    "path": "index/static/index/score.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", () => {\n    const csrf = Cookies.get('csrftoken');\n    document.body.style.backgroundColor =  document.querySelector(\"#bg-color\").innerHTML;\n    document.body.style.color =  document.querySelector(\"#text-color\").innerHTML;\n    document.querySelector(\"#customize-theme-btn\").addEventListener('click', () => {\n        document.querySelector(\"#customize-theme\").style.display = \"block\";\n        document.querySelector(\"#close-customize-theme\").addEventListener('click', () => {\n            document.querySelector(\"#customize-theme\").style.display = \"none\";\n        })\n        window.onclick = e => {\n            if(e.target == document.querySelector(\"#customize-theme\")) document.querySelector(\"#customize-theme\").style.display = \"none\";\n        }\n    })\n    document.querySelector(\"#input-bg-color\").addEventListener(\"input\", function(){\n        document.body.style.backgroundColor = this.value;\n        fetch('edit_background_color', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({\n                \"bgColor\": this.value\n            })\n        })\n    })\n    document.querySelector(\"#input-text-color\").addEventListener(\"input\", function(){\n        document.querySelectorAll(\".txt-clr\").forEach(element => {\n            element.style.color = this.value;\n        })\n        fetch('edit_text_color', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({\n                \"textColor\": this.value\n            })\n        })\n    })\n    document.querySelectorAll(\".open-setting\").forEach(ele => {\n        ele.addEventListener('click', () => {\n            document.querySelector(\"#setting\").style.display = \"block\";\n        })\n        document.querySelector(\"#close-setting\").addEventListener('click', () => {\n            document.querySelector(\"#setting\").style.display = \"none\";\n        })\n        window.onclick = e => {\n            if(e.target == document.querySelector(\"#setting\")) document.querySelector(\"#setting\").style.display = \"none\";\n        }\n    })\n    document.querySelector(\"#delete-form\").addEventListener(\"submit\", e => {\n        e.preventDefault();\n        if(window.confirm(\"Are you sure? This action CANNOT be undone.\")){\n            fetch('delete', {\n                method: \"DELETE\",\n                headers: {'X-CSRFToken': csrf}\n            })\n            .then(() => window.location = \"/\")\n        }\n    })\n    document.querySelectorAll(\"#send-form-btn\").forEach(btn => {\n        btn.addEventListener(\"click\", () => {\n            document.querySelector(\"#send-form\").style.display = \"block\";\n        })\n        document.querySelector(\"#close-send-form\").addEventListener(\"click\", () => {\n            document.querySelector(\"#send-form\").style.display = \"none\";\n        })\n        window.onclick = e => {\n            if(e.target == document.querySelector(\"#send-form\")) document.querySelector(\"#send-form\").style.display = \"none\";\n        }\n    })\n    document.querySelectorAll(\"[copy-btn]\").forEach(btn => {\n        btn.addEventListener(\"click\", () => {\n            var url = document.getElementById(\"copy-url\");\n            navigator.clipboard.writeText(url.value);\n            document.querySelector(\"#send-form\").style.display = \"none\";\n        })\n    })\n    document.querySelector(\"#setting-form\").addEventListener(\"submit\", e => {\n        e.preventDefault();\n        fetch('edit_setting', {\n            method: \"POST\",\n            headers: {'X-CSRFToken': csrf},\n            body: JSON.stringify({\n                \"collect_email\": document.querySelector(\"#collect_email\").checked,\n                \"is_quiz\": document.querySelector(\"#is_quiz\").checked,\n                \"authenticated_responder\": document.querySelector(\"#authenticated_responder\").checked,\n                \"confirmation_message\": document.querySelector(\"#comfirmation_message\").value,\n                \"edit_after_submit\": document.querySelector(\"#edit_after_submit\").checked,\n                \"allow_view_score\": document.querySelector(\"#allow_view_score\").checked\n            })\n        })\n        document.querySelector(\"#setting\").style.display = \"none\";\n        if(!document.querySelector(\"#collect_email\").checked){\n            if(document.querySelector(\".collect-email\")) document.querySelector(\".collect-email\").parentNode.removeChild(document.querySelector(\".collect-email\"))\n        }else{\n            if(!document.querySelector(\".collect-email\")){\n                let collect_email = document.createElement(\"div\");\n                collect_email.classList.add(\"collect-email\")\n                collect_email.innerHTML = `<h3 class=\"question-title\">Email address <span class=\"require-star\">*</span></h3>\n                <input type=\"text\" autoComplete=\"off\" aria-label=\"Valid email address\" disabled dir = \"auto\" class=\"require-email-edit\"\n                placeholder = \"Valid email address\" />\n                <p class=\"collect-email-desc\">This form is collecting email addresses. <span class=\"open-setting\">Change settings</span></p>`\n                document.querySelector(\"#form-head\").appendChild(collect_email)\n            }\n        }\n        if(document.querySelector(\"#is_quiz\").checked){\n            if(!document.querySelector(\"#add-score\")){\n                let is_quiz = document.createElement('a')\n                is_quiz.setAttribute(\"href\", \"/\");\n                is_quiz.setAttribute(\"id\", \"add-score\");\n                is_quiz.innerHTML = `<img src = \"/static/Icon/score.png\" id=\"add-score\" class = \"form-option-icon\" title = \"Add score\" alt = \"Score icon\" />`;\n                document.querySelector(\".question-options\").appendChild(is_quiz)\n            }\n        }else{\n            if(document.querySelector(\"#add-score\")){\n                document.querySelector(\"#add-score\").parentNode.removeChild(document.querySelector(\"#add-score\"))\n            }\n        }\n    })\n    document.querySelectorAll(\".textarea-adjust\").forEach(tx => {\n        tx.style.height = \"auto\";\n        tx.style.height = (10 + tx.scrollHeight)+\"px\";\n        tx.addEventListener('input', e => {\n            tx.style.height = \"auto\";\n            tx.style.height = (10 + tx.scrollHeight)+\"px\";\n        })\n    })\n    document.querySelectorAll(\".input-score\").forEach(element => {\n        element.addEventListener(\"input\", function(){\n            fetch('edit_score', {\n                method: \"POST\",\n                headers: {'X-CSRFToken': csrf},\n                body: JSON.stringify({\n                    question_id: this.dataset.id,\n                    score: this.value\n                })\n            })\n        })\n    })\n    document.querySelectorAll(\"[answer-key]\").forEach(element => {\n        element.addEventListener(\"input\", function(){\n            if(this.dataset.question_type === \"multiple choice\"){\n                fetch('answer_key', {\n                    method: \"POST\",\n                    headers: {'X-CSRFToken': csrf},\n                    body: JSON.stringify({\n                        \"question_id\": this.dataset.id,\n                        \"answer_key\": document.querySelector(`input[name=\"${this.name}\"]:checked`).value\n                    })\n                })\n            }else if(this.dataset.question_type === \"checkbox\"){\n                answers = []\n                document.getElementsByName(this.name).forEach(element => {\n                    if(element.checked) answers.push(element.value)\n                })\n                fetch('answer_key', {\n                    method: \"POST\",\n                    headers: {'X-CSRFToken': csrf},\n                    body: JSON.stringify({\n                        \"question_id\": this.dataset.id,\n                        \"answer_key\": answers\n                    })\n                })\n            }\n            else{\n                fetch('answer_key', {\n                    method: \"POST\",\n                    headers: {'X-CSRFToken': csrf},\n                    body: JSON.stringify({\n                        \"question_id\": this.dataset.id,\n                        \"answer_key\": this.value\n                    })\n                })\n            }\n        })\n    })\n    document.getElementsByName('feedback').forEach(element => {\n        element.addEventListener(\"input\", function(){\n            fetch('feedback', {\n                method: \"POST\",\n                headers: {'X-CSRFToken': csrf},\n                body: JSON.stringify({\n                    \"question_id\": this.dataset.id,\n                    \"feedback\": this.value\n                })\n            })\n        })\n    })\n})"
  },
  {
    "path": "index/static/index/style.css",
    "content": "@import url(\"https://fonts.googleapis.com/css?family=Permanent+Marker\");\n@import url(\"https://fonts.googleapis.com/css?family=Product+Sans\");\n@import url(\"https://fonts.googleapis.com/css?family=Google+Sans\");\n\nbody{\n    scroll-behavior: smooth;\n}\n\n.form-error{\n    font-family: \"Permanent Marker\";\n    color: red;\n}\n\n.form-icon{\n    width: 40px;\n    margin-bottom: 0.5rem;\n}\n\n.topnav{\n    float: left;\n    width: 100vw;\n}\n\n.navbar-icon{\n    float: left;\n}\n.nav-text{\n    float: left;\n    position: relative;\n    vertical-align: middle;\n    margin-top: 0.75rem;\n    font-family: \"Product Sans\";\n    color: #5f6368;\n    padding-left: 1rem;\n}\n\n.nav-link{\n    color: #000;\n    text-decoration: none;\n}\n\n.nav-effect{box-shadow: 0 2px 30px -2px rgba(0,0,0,.2);}\n\n.float-right{\n    float: right;\n}\n\n.logout-icon{\n    width: 40px;\n    cursor: pointer;\n}\n\n.nav-padding{\n    padding: 10px 20px 10px;\n}\n.sidebar{\n    height: 100%;\n    width: 0;\n    position: fixed;\n    z-index: 5;\n    top: 0;\n    left: 0;\n    overflow-x: hidden;\n    transition: 0.5s;\n    background-color: #FFF;\n    box-shadow: 10px 0 5px -2px #888;\n}\n\n.nav-ham{\n    float: left;\n    font-size: 1.8rem;\n    position: relative;\n    vertical-align: middle;\n    margin-right: 1rem;\n    cursor: pointer;\n}\n\n.close-sidebar{\n    position: absolute;\n    top: 0;\n    right: 25px;\n    font-size: 36px;\n    margin-left: 50px;\n    cursor: pointer;\n}\n\n.sidebar-content{\n    margin: 20px\n}\n\n.sidebar-title{\n    margin-top: 50px;\n    font-family: \"Google Sans\";\n    font-size: 1.3rem;\n    border-bottom: 1px solid #888;\n    text-align: center;\n    cursor: pointer;\n}\n\n.sidebar-title-link{\n    text-decoration: none;\n    color: #414244;\n}\n\n.github-icon{\n    width: 1.3rem;\n}\n\n.create-form{\n    background-color: #f1f3f4;\n    width: 100vw;\n    float: left;\n}\n\n.forms-label{\n    font-family: \"Google Sans\";\n    margin: 10px 10px 5px 10px;\n}\n\n.form-template-box{\n    margin: 5px 30px 10px 0;\n    float: left;\n}\n\n.form-template-box img{\n    width: 10em;\n    height: 7em;\n    float: left;\n}\n\n.form-template-box:hover{\n    border: 1px solid black;\n}\n\n.form-box{\n    width: 250px;\n    border: 1px solid rgb(182, 179, 179);\n    padding: 5px;\n    cursor: pointer;\n    margin: 10px;\n    position: relative;\n}\n\n.form-box:hover{\n    border: 1px solid darkblue;\n}\n\n.form-list{\n    float: left;\n    margin-top: 20px;\n}\n\n.form-list-title{\n    align-items: flex-end;\n    display: flex;\n    flex-direction: row;\n    position: relative;\n}\n\n.form-list-title-text{\n    text-align: left;\n    overflow: hidden;\n    display: -webkit-box;\n    -webkit-box-orient: vertical;\n    -webkit-line-clamp: 1;\n    text-overflow: ellipsis;\n    font-family: \"Google Sans\";\n    margin: 2.5px;\n}\n\n.form-list-timestamp{\n    margin: 2.5px ;\n    color: gray;\n}\n\n.form-list-link{\n    color: #000000;\n    text-decoration: none;\n    float: left;\n}\n\n.error-page{\n    text-align: center;\n    font-family: \"Roboto Condensed\";\n}\n\n.form-topnav{\n    padding: 15px;\n    overflow: hidden;\n    background-color: #fff;\n}\n\n.nav-form-title{\n    width: 300px;\n    overflow: hidden;\n    display: -webkit-box;\n    -webkit-box-orient: vertical;\n    -webkit-line-clamp: 1;\n    text-overflow: ellipsis;\n}\n\n.edit-on-click{\n    border: none;\n    font-size: 1.2rem;\n    transition: 1s;\n    overflow-y: hidden;\n}\n\n.edit-on-click:focus{\n    outline: none !important;\n    border-bottom: 1px solid #202124;\n}\n\n.nav-form-menu-icon{\n    width: 1.5rem;\n    margin: 10px 15px;\n    cursor: pointer;\n    float: left;\n}\n\n.send-form-btn{\n    position: relative;\n    background-color: #673ab7;\n    color: #ddd;\n    font-size: 1rem;\n    font-family: \"Google Sans\";\n    vertical-align: middle;\n    border: 1px solid #ddd;\n    padding: 10px 20px;\n    float: left;\n    margin: 0.2px 15px;\n}\n\n.question-box{\n    background-color: #FFF;\n}\n\n.form-title{\n    font-size: 2rem;\n    font-family: \"Google Sans\";\n    font-weight: normal;\n    margin: 10px;\n    width: -webkit-fill-available;\n    width: -moz-available;\n}\n\n.form-description{\n    font-size: 1rem;\n    font-family: \"Roboto Condensed\";\n    margin: 10px;\n    width: -webkit-fill-available;\n    width: -moz-available;\n}\n\n.form-title-box{\n    border-bottom: 1px solid #ddd;\n}\n\n.modal{\n    display: none;\n    position: fixed;\n    z-index: 6;\n    padding: calc(10vh - 20px) 0;\n    left: 0;\n    top: 0;\n    width: 100%;\n    height: 100%;\n    overflow: auto;\n    background-color: rgb(0, 0, 0);\n    background-color: rgba(0, 0, 0, 0.4);\n}\n\n.modal-content{\n    background-color: #fefefe;\n    margin: auto;\n    padding: 20px;\n    border: 1px solid #888;\n    width: 80%;\n    max-height: 80%;\n    overflow: auto;\n    max-width: 600px;\n    border-radius: 10px;\n}\n\n.modal-close-btn{\n    color: #aaa;\n    float: right;\n    font-size: 28px;\n    font-weight: bold;\n}\n\n.modal-close-btn:hover, .modal-close-btn:focus{\n    color: #000;\n    text-decoration: none;\n    cursor: pointer;\n}\n\n.modal-title{\n    font-family: \"Google Sans\";\n    font-size: 1.2rem;\n    border-bottom: 1px solid rgb(233, 232, 232);\n    margin-bottom: 0;\n}\n\n.modal-subtitle{\n    font-family: \"Roboto Condensed\";\n    font-size: 1rem;\n    font-weight: normal;\n}\n\n.setting-form-label{\n    font-family: \"Roboto Condensed\";\n}\n\n.modal-division{\n    margin: 30px 0;\n}\n.confirmation-msg-input{\n    width: -webkit-fill-available;\n    width: -moz-available;\n    border-bottom: 1px solid #202124;\n    min-height: 20px !important;\n}\n\n.setting-options{\n    position: relative;\n}\n.setting-option-cancel{\n    margin: 20px 10px;\n    cursor: pointer;\n    color: #84878b;\n\n}\n\n.btn-save-setting{\n    background-color: #673ab7;\n    color: #ddd;\n    font-size: 1rem;\n    font-family: \"Google Sans\";\n}\n\n.setting-preview-form, .setting-preview-form a{\n    cursor: pointer;\n    color: #bbb;\n    font-family: \"Google Sans\";\n    text-decoration: none;\n}\n\n.setting-preview-form:hover{\n    opacity: .5;\n}\n\n.danger-zone{\n    font-weight: bold;\n    font-family: \"Google Sans\";\n    font-size: 1.4rem;\n}\n\n.delete-form-title{\n    margin: 0;\n    font-family: \"Roboto Condensed\";\n}\n\n.delete-form-description{\n    margin: 0;\n    font-family: \"Poppins\";\n}\n\n.delete-form-btn{\n    font-size: 1rem;\n    font-family: \"Poppins\";\n    padding: 3px !important;\n    background-color: #E71C23;\n    color: #fff;\n}\n\n.question-options{\n    background-color: #fff;\n    margin: 20px 0;\n    position: fixed;\n    bottom: 10%;\n    right: 0;\n    border: 1px solid #84878b;\n}\n\n.form-option-icon{\n    width: 2rem;\n    margin: 5px;\n    cursor: pointer;\n    display: block;\n}\n\n.collect-email{\n    margin: 10px;\n}\n\n.question-title{\n    font-family: \"Google Sans\";\n    font-size: 1.3rem;\n    font-weight: normal;\n}\n\n.require-star{\n    color: #E71C23;\n}\n\n.require-email-edit{\n    padding: 5px;\n    border: none;\n    border-bottom: 1px solid #84878b;\n    width: 50%;\n    cursor: not-allowed;\n}\n\n.collect-email-desc{\n    color: #70757a;\n    margin: 10px 0;\n}\n\n.open-setting{\n    color: #1a73e8;\n    cursor: pointer;\n}\n\n.question-title{\n    font-family: \"Google Sans\";\n    font-size: 1.5rem;\n    width: 65%;\n}\n\n.question-type-select{\n    width: calc(35% - 8px);\n    padding: 5px 35px 5px 5px;\n    font-size: 1.2rem;\n    border: 1px solid #ccc;\n    height: 34px;\n}\n\n.question-type-select::-ms-expand{\n    display: none;\n}\n\n.choices{\n    margin: 10px 0;\n}\n\n.choice{\n    margin: 5px 0;\n    font-family: \"Google Sans\";\n}\n\n.add-option{\n    cursor: pointer;\n    color: #70757a;\n}\n\n.edit-choice{\n    display: inline;\n    width: 80%;\n    border: none;\n    overflow-y: hidden;\n    font-family: \"Google Sans\";\n}\n\n.remove-option{\n    display: inline;\n    font-size: 1.3rem;\n    cursor: pointer;\n    margin-left: 10px;\n}\n\n.choice-option{\n    padding: 10px;\n    display: block;\n    border-top: 1px solid #ccc;\n}\n\n.required{\n    font-family: \"Roboto Condensed\";\n}\n\n.answers{\n    margin: 5px;\n    font-family: \"Google Sans\";\n}\n\n.short-answer{\n    width: 50%;\n    border: none;\n    padding: 5px;\n    border-bottom: 1px solid #70757a;\n}\n\n.long-answer{\n    width: -webkit-fill-available;\n    width: -moz-available;\n    border: none;\n    padding: 5px;\n    border-bottom: 1px solid #70757a;\n}\n\n.question-option-icon{\n    width: 1.5rem;\n    cursor: pointer;\n}\n.form-navigation{\n    background-color: #fff;\n    width: 400px;\n    margin: auto;\n}\n\n.navigation{\n    text-align: center;\n    cursor: pointer;\n}\n\n.form-navigation .active{\n    color:rgb(0, 132, 223);\n    font-weight: bold;\n    font-family: \"Google Sans\";\n    font-size: 0.8rem;\n}\n\n.question-score{\n    max-width: calc(25% - 8px);\n    display: inline-block;\n    font-family: \"Google Sans\";\n    margin: 1rem;\n}\n\n.input-score{\n    width: 30px;\n    border: none;\n    border-bottom: 1px solid rgb(0, 132, 223);\n}\ninput[type=number]::-webkit-inner-spin-button, \ninput[type=number]::-webkit-outer-spin-button { \n  -webkit-appearance: none;\n}\n\n.question-title-score{\n    font-family: \"Google Sans\";\n    display: inline-block;\n    width: 75%;\n    font-size: 1.5rem;\n    font-weight: normal;\n    margin: 1rem;\n}\n\n.answer-key, .feedback{\n    margin: 5px 10px;\n}\n.answer-key-title, .feedback-title{\n    margin: 0;\n    font-family: \"Roboto Condensed\";\n    display: inline-block;\n}\n\n.multiple-choice{\n    width: 100%;\n    margin: 5px;\n}\n\n.btn-submit{\n    background-color: #1a73e8;\n    color: #fff;\n    border: 1px solid #fff;\n    cursor: pointer;\n}\n\n.required-info{\n    color: #E71C23;\n    margin: 10px;\n}\n\n.edit-form-link{\n    width: 4rem;\n    height: 4rem;\n    position: fixed;\n    bottom: 50px;\n    right: 0%;\n    border-radius: 50%;\n    border: 1px solid #5f6368;\n}\n\n.response-title{\n    font-family: \"Google Sans\";\n    font-size: 1.5rem;\n    font-weight: normal;\n}\n\n.score-title{\n    font-family: \"Google Sans\";\n    margin: 10px;\n    font-size: 1.2rem;\n    font-weight: normal;\n}\n\n.question-title{\n    font-family: \"Google Sans\";\n    font-size: 1.5rem;\n}\n\n.view-score-btn{\n    position: relative;\n    background-color: #673ab7;\n    color: #ddd;\n    font-family: \"Google Sans\";\n    border: 1px solid #ddd;\n    padding: 10px 20px;\n    margin: 5px 15px;\n}\n\n.feedback{\n    margin: 10px 5px;\n}\n\n.feedback-title{\n    font-family: \"Poppins\";\n    font-size: 1.1rem;\n    font-weight: normal;\n}\n\n.edit-response-link{\n    margin-left: 15px;\n}\n\n.form-template-label{\n    font-family: \"Google Sans\";\n    margin: 10px;\n    display: block;\n}\n\n.form-animate {\n    position: relative;\n    display: block;\n    overflow: hidden;\n}\n  \n.input-animate {\n    width: -webkit-fill-available;\n    width: -moz-available;\n    border: none;\n    display: inline-block;\n    outline: none;\n    padding: 10px;\n    font-size: 20px;\n    background-color: transparent;\n    border-bottom: 1px solid #7c7c7c;\n}\n  \n.input-onFocus {\n    transition: all 0.5s;\n    display: inline-block;\n    bottom: 0;\n    left: -100%;\n    position: absolute;\n    width: 100%;\n    height: 2px;\n    background: #1a73e8;\n}\n  \n.form-animate, .input-animate {\n    color: inherit;\n}\n  \n.form-animate .input-animate:focus + .input-onFocus {\n    left: 0;\n}\n\n.response-summary{\n    margin: .5rem 1rem;\n}\n\n.response-summary-title{\n    font-family: \"Google Sans\";\n    font-size: 1rem;\n    font-weight: normal;\n}\n\nblockquote{\n    font-size: 1.4em;\n    font-family:Open Sans;\n    font-style:italic;\n    color: #555555;\n    padding: 10px;\n    border-left:8px solid #78C0A8 ;\n    position: relative;\n    background:#EDEDED;\n}\n  \nblockquote span{\n    display:block;\n    color:#333333;\n    font-style: normal;\n    font-weight: bold;\n    margin-top:1em;\n}\n\n.pie-chart{\n    width: 70% !important;\n    height: 70% !important;\n    margin: auto;\n}\n@media only screen and (max-width: 768px){\n    .nav-form-title{\n        width: 100px;\n    }\n\n    .form-list-link, .form-box{\n        width: -webkit-fill-available;\n        width: -moz-available;\n    }\n    .modal{\n        padding: 0;\n    }\n\n    .modal-content{\n        max-width: none;\n        max-height: none;\n        width: -webkit-fill-available;\n        width: -moz-available;\n        height: calc(100% - 40px);\n        border-radius: 0%;\n    }\n    .question-title, .question-title-score{\n        width: 100%;\n    }\n    .question-type-select{\n        width: 100%;\n        display: block;\n    }\n\n    .big-screen{\n        display: none;\n    }\n    .navigation{\n        width: calc((100% - 60px)/3) !important;\n    }\n    .question-score{\n        max-width: 100%;\n        width: 100%;\n    }\n    .input-score{\n        width: 50px;\n    }\n}\n\n@media only screen and (min-width: 768px){\n    .small-screen{\n        display: none;\n    }\n}"
  },
  {
    "path": "index/static/index/viewform.js",
    "content": "document.addEventListener(\"DOMContentLoaded\", () => {\n    document.body.style.backgroundColor =  document.querySelector(\"#bg-color\").innerHTML;\n    document.body.style.color =  document.querySelector(\"#text-color\").innerHTML;\n    document.querySelectorAll(\".txtClr\").forEach(element => {\n        element.style.color = document.querySelector(\"#text-color\").innerHTML;\n    })\n    document.querySelectorAll(\".textarea-adjust\").forEach(tx => {\n        tx.style.height = \"auto\";\n        tx.style.height = (10 + tx.scrollHeight)+\"px\";\n        tx.addEventListener('input', e => {\n            tx.style.height = \"auto\";\n            tx.style.height = (10 + tx.scrollHeight)+\"px\";\n        })\n    })\n    document.querySelectorAll('input[type=\"checkbox\"]').forEach(element => {\n        document.getElementsByName(element.name).forEach(checkbox => {\n            checkbox.addEventListener(\"input\", function(){\n                let totalChecked = 0\n                document.getElementsByName(element.name).forEach(checkbox => {\n                    if(checkbox.checked) totalChecked++;\n                })\n                if(totalChecked > 0){\n                    document.getElementsByName(element.name).forEach(checkbox => {\n                        checkbox.removeAttribute(\"required\")\n                    })\n                }else{\n                    document.getElementsByName(element.name).forEach(checkbox => {\n                        checkbox.setAttribute(\"required\", '')\n                    })\n                }\n            })\n        })\n    })\n})"
  },
  {
    "path": "index/templates/error/403.html",
    "content": "{% extends 'index/layout.html' %}\n{% block body %}\n<h1 class=\"text-danger error-page\">Error 403 Forbidden.</h1>\n{% endblock %}"
  },
  {
    "path": "index/templates/error/404.html",
    "content": "{% extends 'index/layout.html' %}\n{% block body %}\n<h1 class=\"text-danger error-page\">Error 404 not found</h1>\n{% endblock %}"
  },
  {
    "path": "index/templates/index/edit_response.html",
    "content": "{% extends 'index/layout.html' %}\n{% load static %}\n{% load get_response %}\n{% load to_int %}\n{% load is_response %}\n{% block title %}{{form.title}} ~ Google Forms CLONE{% endblock %}\n{% block script %}\n<script src=\"{% static 'index/viewform.js' %}\" defer></script>\n{% endblock %}\n{% block body %}\n<div class=\"container-fluid\">\n    <form class=\"container\" method=\"POST\" action=\"{% url 'edit_response' form.code response.response_code %}\" autocomplete=\"off\">\n        <span id=\"bg-color\" style=\"display: none;\">{{form.background_color}}</span>\n        <span id=\"text-color\" style=\"display: none;\">{{form.text_color}}</span>\n        {% csrf_token %}\n        <div class=\"margin-top-bottom box question-box\">\n            <div class=\"form-title-box\">\n                <h1 class=\"form-title txtClr\">{{form.title}}</h1>\n                <p class=\"required-info\">* Required</p>\n            </div>\n            <div class=\"form-description txtClr\">{{form.description|linebreaksbr}}</div>\n        </div>\n        {% if form.collect_email %}\n        <div class=\"margin-top-bottom box question-box\">\n            <h1 class=\"question-title txtClr\">Email address: <span class=\"require-star\">*</span></h1>\n            <input type=\"email\" name=\"email-address\" class=\"short-answer\" placeholder=\"Your email address\" required value=\"{{response.responder_email}}\">\n        </div>\n        {% endif %}\n        {% for question in form.questions.all %}\n        <div class=\"margin-top-bottom box question-box\">\n            {% if form.is_quiz %}\n            <h1 class=\"question-title txtClr\">{{question.question}} {% if question.required %}<span class=\"require-star\">*</span>{% endif %}</h1>\n            {% else %}\n            <h1 class=\"question-title txtClr\" oncopy = \"return false\">{{question.question}} {% if question.required %}<span class=\"require-star\">*</span>{% endif %}</h1>\n            {% endif %}\n            {% if question.question_type == \"short\" %}\n                <input type=\"text\" name=\"{{question.id}}\" class=\"short-answer\" placeholder = \"Your answer\" {% if question.required %} required {% endif %}\n                value=\"{{response|get_response:question.pk}}\">\n            {% elif question.question_type == \"paragraph\" %}\n                <textarea name=\"{{question.id}}\" placeholder=\"Your answer\" class=\"long-answer textarea-adjust\" \n                {% if question.required %} required {% endif %}>{{response|get_response:question.pk}}</textarea>\n            {% elif question.question_type == \"multiple choice\" %}\n                {% for choice in question.choices.all %}\n                <div class=\"multiple-choice\">\n                    {% if response|get_response:question.pk|to_int == choice.pk|to_int %}\n                    <input type=\"radio\" name=\"{{question.id}}\" id=\"{{choice.id}}\" {% if question.required %} required {% endif %} value=\"{{choice.id}}\" checked>\n                    {% else %}\n                    <input type=\"radio\" name=\"{{question.id}}\" id=\"{{choice.id}}\" {% if question.required %} required {% endif %} value=\"{{choice.id}}\">\n                    {% endif %}\n                    <label for=\"{{choice.id}}\" class=\"txtClr\">{{choice.choice}}</label>\n                </div>\n                {% endfor %}\n            {% elif question.question_type == \"checkbox\" %}\n            {% for choice in question.choices.all %}\n                <div class=\"multiple-choice\">\n                    {% if response|get_responses:question.pk|is_response:choice.pk %}\n                    <input type=\"checkbox\" name=\"{{question.id}}\" id=\"{{choice.id}}\" {% if question.required %} required {% endif %} value=\"{{choice.id}}\" checked>\n                    {% else %}\n                    <input type=\"checkbox\" name=\"{{question.id}}\" id=\"{{choice.id}}\" {% if question.required %} required {% endif %} value=\"{{choice.id}}\">\n                    {% endif %}\n                    <label for=\"{{choice.id}}\" class=\"txtClr\">{{choice.choice}}</label>\n                </div>\n                {% endfor %}\n            {% endif %}\n        </div>\n        {% endfor %}\n        <div class=\"margin-top-bottom\">\n            <input type=\"submit\" value=\"Submit\" class=\"btn btn-submit\">\n        </div>\n    </form>\n    {% if user == form.creator %}\n        <a href=\"{% url 'edit_form' form.code %}\">\n            <img src=\"{% static 'Icon/question.png' %}\" alt=\"Edit Question\" title=\"Edit this form\" class=\"edit-form-link\">\n        </a>\n    {% endif %}\n</div>\n{% endblock %}"
  },
  {
    "path": "index/templates/index/form.html",
    "content": "{% extends 'index/layout.html' %}\n{% block title %}\n{{form.title}} ~ Google Forms CLONE\n{% endblock %}\n{% load static %}\n{% block script %}\n<script src=\"{% static 'index/form.js' %}\"></script>\n<script src=\"{% static 'lib/cookie.min.js' %}\"></script>\n{% endblock %}\n{% block body %}\n<div class = \"container-fluid\">\n    <div class=\"form-topnav\">\n        <a href = \"/\">\n            <img src = \"{% static 'Icon/icon.png' %}\" alt = \"Google Forms Icon(CLONE)\" class=\"navbar-icon form-icon\" title = \"Forms\" />\n        </a>\n        <input class=\"nav-text nav-form-title edit-on-click input-form-title\" value  = \"{{form.title}}\" type=\"text\">\n        <div class=\"float-right\">\n            <img src=\"{% static 'Icon/theme.png' %}\" alt=\"Theme icon\" id=\"customize-theme-btn\" title = \"Customize theme\" class=\"nav-form-menu-icon\" />\n            <a href=\"{% url 'view_form' form.code %}\">\n            <img src=\"{% static 'Icon/eye.png' %}\" alt=\"Preview icon\" title = \"Preview\" class=\"nav-form-menu-icon big-screen\" />\n            </a>\n            <img src=\"{% static 'Icon/send.png' %}\" alt =\"Send icon\" title = \"Send\" class=\"nav-form-menu-icon small-screen\" id=\"send-form-btn\" />\n            <img src=\"{% static 'Icon/setting.png' %}\" alt=\"Setting icon\" title = \"Setting\" class=\"nav-form-menu-icon open-setting\" />\n            <button class = \"btn send-form-btn big-screen\" title = \"Send\" id=\"send-form-btn\">Send</button>\n        </div>\n    </div>\n    <div class=\"form-topnav\">\n        <div class=\"form-navigation center\">\n            {% if form.is_quiz %}\n            <span class=\"col-4 navigation active\">Questions</span>\n            <span class=\"col-4 navigation score\"><a href = \"{% url 'score' form.code %}\" class=\"link\">Scores</a></span>\n            <span class=\"col-4 navigation\"><a href = \"{% url 'responses' form.code %}\" class=\"link\">Responses</a></span>\n            {% else %}\n            <span class=\"col-6 navigation active\">Questions</span>\n            <span class=\"col-6 navigation\"><a href = \"{% url 'responses' form.code %}\" class=\"link\">Responses</a></span>\n            {% endif %}\n        </div>\n    </div>\n    <div class=\"container\">\n        <span id=\"bg-color\" style=\"display: none;\">{{form.background_color}}</span>\n        <span id=\"text-color\" style=\"display: none;\">{{form.text_color}}</span>\n        <div class=\"margin-top-bottom box question-box\" id=\"form-head\">\n            <div class=\"form-title-box\">\n                <input type=\"text\" class=\"form-title edit-on-click input-form-title txt-clr\" value=\"{{form.title}}\">\n            </div>\n            <textarea class=\"form-description edit-on-click textarea-adjust txt-clr\" rows=\"1\" placeholder=\"Form description\" spellCheck = \"false\"\n            id=\"input-form-description\">{{form.description}}</textarea>\n            {% if form.collect_email %}\n            <div class=\"collect-email txt-clr\">\n                <h3 class=\"question-title\">Email address <span class=\"require-star\">*</span></h3>\n                <input type=\"text\" autocomplete=\"off\" aria-label=\"Valid email address\" disabled dir = \"auto\" class=\"require-email-edit txtColor\"\n                placeholder = \"Valid email address\" />\n                <p class=\"collect-email-desc\">This form is collecting email addresses. <span class=\"open-setting\">Change settings</span></p>\n            </div>\n            {% endif %}\n        </div>\n        {% for question in form.questions.all %}\n        <div class=\"margin-top-bottom box question-box question\" data-id=\"{{question.id}}\">\n            <input type=\"text\" data-id=\"{{question.id}}\" class=\"question-title edit-on-click input-question\" value=\"{{question.question}}\">\n            <select class=\"question-type-select input-question-type\" data-id=\"{{question.id}}\" data-origin_type = \"{{question.question_type}}\">\n                <option value=\"short\" {% if question.question_type == \"short\" %}selected{% endif %}>Short answer</option>\n                <option value=\"paragraph\" {% if question.question_type == \"paragraph\" %}selected{% endif %}>Paragraph</option>\n                <option value=\"multiple choice\" {% if question.question_type == \"multiple choice\" %}selected{% endif %}>Multiple choice</option>\n                <option value=\"checkbox\" {% if question.question_type == \"checkbox\" %}selected{% endif %}>Checkbox</option>\n            </select>\n            {% if question.question_type == \"multiple choice\" %}\n            <div class=\"choices\" data-id=\"{{question.id}}\">\n                {% for choice in question.choices.all %}\n                    <div class=\"choice\">\n                        <input type=\"radio\" id=\"{{choice.id}}\" disabled>\n                        <label for=\"{{choice.id}}\">\n                            <input type=\"text\" value=\"{{choice.choice}}\" class=\"edit-choice\" data-id=\"{{choice.id}}\">\n                        </label>\n                        <span class=\"remove-option\" title = \"Remove\" data-id=\"{{choice.id}}\">&times;</span>\n                    </div>\n                {% endfor %}\n                <div class=\"choice\">\n                    <input type = \"radio\" id = \"add-choice\" disabled />\n                    <label for = \"add-choice\" class=\"add-option\" data-question=\"{{question.id}}\" data-type = \"{{question.question_type}}\">Add option</label>\n                </div>\n            </div>\n            {% elif question.question_type == \"checkbox\" %}\n            <div class=\"choices\" data-id=\"{{question.id}}\">\n                {% for choice in question.choices.all %}\n                    <div class=\"choice\">\n                        <input type=\"checkbox\" id=\"{{choice.id}}\" disabled>\n                        <label for=\"{{choice.id}}\">\n                            <input type=\"text\" data-id=\"{{choice.id}}\" class=\"edit-choice\" value=\"{{choice.choice}}\">\n                        </label>\n                        <span class=\"remove-option\" title=\"Remove\" data-id=\"{{choice.id}}\">&times;</span>\n                    </div>\n                {% endfor %}\n                <div class=\"choice\">\n                    <input type = \"checkbox\" id = \"add-choice\" disabled />\n                    <label for = \"add-choice\" class=\"add-option\" id=\"add-option\" data-question=\"{{question.id}}\" data-type = \"{{question.question_type}}\">Add option</label>\n                </div>\n            </div>\n            {% elif question.question_type == \"short\" %}\n            <div class=\"answers\" data-id=\"{{question.id}}\">\n                <input type =\"text\" class=\"short-answer\" disabled placeholder=\"Short answer text\" />\n            </div>\n            {% elif question.question_type == \"paragraph\" %}\n            <div class=\"answers\" data-id=\"{{question.id}}\">\n                <textarea class=\"long-answer\" disabled placeholder=\"Long answer text\" ></textarea>\n            </div>\n            {% endif %}\n            <div class=\"choice-option\">\n                <input type=\"checkbox\" class=\"required-checkbox\" id=\"required-{{question.id}}\" data-id=\"{{question.id}}\" {% if question.required %}checked{% endif %}>\n                <label for=\"required-{{question.id}}\" class=\"required\">Required</label>\n                <div class=\"float-right\">\n                    <img src=\"{% static 'Icon/dustbin.png' %}\" alt=\"Delete question icon\" class=\"question-option-icon delete-question\" title=\"Delete question\"\n                    data-id=\"{{question.id}}\">\n                </div>\n            </div>\n        </div>\n        {% endfor %}\n    </div>\n    <div class=\"question-options\">\n        <img src = \"{% static 'Icon/add.png' %}\" class=\"form-option-icon\" title = \"Add question\" alt = \"Add question icon\" id=\"add-question\" />\n        <a href=\"{% url 'view_form' form.code %}\">\n            <img src = \"{% static 'Icon/eye.png' %}\" class = \"form-option-icon\" title = \"Preview\" alt = \"Preview icon\" />\n        </a>\n        {% if form.is_quiz %}\n        <a href = \"{% url 'score' form.code %}\" id=\"add-score\">\n            <img src = \"{% static 'Icon/score.png' %}\" class = \"form-option-icon\" title = \"Add score\" alt = \"Score icon\" />\n        </a>\n        {% endif %}\n    </div>\n    <div class=\"modal\" id=\"customize-theme\">\n        <div class=\"modal-content\">\n            <span class=\"modal-close-btn\" id=\"close-customize-theme\">&times;</span>\n            <h1 class=\"modal-title\">Theme options</h1>\n            <h3 class=\"modal-subtitle\">Background Color:</h3>\n            <input type=\"color\"  value = \"{{form.background_color}}\" list=\"bgColors\" class=\"form-control\" id=\"input-bg-color\" />\n            <datalist id=\"bgColors\">\n                <option value=\"#03a9f4\"></option>\n                <option value=\"#00bcd4\"></option>\n                <option value=\"#7ff0e7\"></option>\n                <option value = \"#e1d8f1\"></option>\n                <option value = \"#d1c4e9\"></option>\n                <option value = \"#f6f6f6\"></option>\n                <option value=\"#f1f3f4\"></option>\n                <option value=\"#9aa0a2\"></option>\n                <option value=\"#d8ef89\"></option>\n            </datalist>\n            <h3 class=\"modal-subtitle\">Text Color:</h3>\n            <input type=\"color\"  value = {{form.text_color}} list=\"textColors\" class=\"form-control\" id=\"input-text-color\" />\n            <datalist id=\"textColors\">\n                <option value=\"#db4437\"></option>\n                <option value=\"#673ab7\"></option>\n                <option value=\"#3f51b5\"></option>\n                <option value=\"#4285f4\"></option>\n                <option value=\"#03a9f4\"></option>\n                <option value=\"#00bcd4\"></option>\n                <option value=\"#8a8a8a\"></option>\n                <option value=\"#4c3d45\"></option>\n                <option value=\"#272124\"></option>\n            </datalist>\n        </div>\n    </div>\n    <div class=\"modal\" id=\"setting\">\n        <div class=\"modal-content txt-clr\">\n            <form id=\"setting-form\">\n                <span class=\"modal-close-btn\" id=\"close-setting\">&times;</span>\n                <h1 class = \"modal-title\">Setting</h1>\n                <h4 class=\"setting-preview-form small-screen\"><a href=\"{% url 'view_form' form.code %}\">Preview form here</a></h4>\n                <div class=\"modal-division\">\n                    <div class=\"form-group\">\n                        <h3 class=\"modal-subtitle\">General</h3>\n                        <input type=\"checkbox\" id=\"collect_email\"{% if form.collect_email %} checked {% endif %}>\n                        <label for=\"collect_email\" class=\"setting-form-label\">Collect email address</label>\n                    </div>\n                    <div class=\"form-group\">\n                        <input type=\"checkbox\" id=\"is_quiz\" {% if form.is_quiz %} checked {% endif %}>\n                        <label for=\"is_quiz\" class=\"setting-form-label\">Make this as a quiz</label>\n                    </div>\n                    <div class=\"form-group\">\n                        <input type=\"checkbox\" id=\"authenticated_responder\" {% if form.authenticated_responder %} checked {% endif %}>\n                        <label for=\"authenticated_responder\" class=\"setting-form-label\">Respondent account must be authenticated. (Signed in required)</label>\n                    </div>\n                </div>\n                <div class=\"modal-division\">\n                    <div class=\"form-group\">\n                        <h3 class=\"modal-subtitle\">Confirmation message:</h3>\n                        <textarea rows=\"1\" class=\"confirmation-msg-input edit-on-click textarea-adjust\" spellcheck=\"false\"\n                         id=\"comfirmation_message\">{{form.confirmation_message}}</textarea>\n                    </div>\n                </div>\n                <div class=\"modal-division\">\n                    <div class=\"form-group\">\n                        <h3 class=\"modal-subtitle\">Respondents can:</h3>\n                        <input type=\"checkbox\" id=\"edit_after_submit\" {% if form.edit_after_submit %}checked{% endif %}>\n                        <label for=\"edit_after_submit\" class=\"setting-form-label\">Edit after submit</label>\n                    </div>\n                    <div class=\"form-group\">\n                        <input type=\"checkbox\" id=\"allow_view_score\" {% if form.allow_view_score %}checked{% endif %}>\n                        <label for=\"allow_view_score\" class=\"setting-form-label\">View score</label>\n                    </div>\n                    <div class=\"form-group\">\n                        <input type=\"submit\" value=\"Save\" class=\"form-control btn btn-save-setting\">\n                    </div>\n                </div>\n            </form>\n            <form id=\"delete-form\" class=\"modal-division\">\n                <fieldset class=\"form-group\">\n                    <legend class=\"modal-subtitle text-danger danger-zone\">Danger Zone</legend>\n                    <h3 class=\"delete-form-title\">Delete this form</h3>\n                    <p class=\"delete-form-description\">Once you delete a form, there is no going back. Please be certain.</p>\n                    <input type=\"submit\" value=\"Delete\" class=\"form-control delete-form-btn\">\n                </fieldset>\n            </form>\n        </div>\n    </div>\n    <div class=\"modal\" id=\"send-form\">\n        <div class=\"modal-content\">\n            <span class=\"modal-close-btn\" id=\"close-send-form\">&times;</span>\n            <h1 class = \"modal-title\">Send form</h1>\n            <div class=\"modal-division\">\n                <h4 class=\"modal-subtitle\">Link:</h4>\n                <input type=\"url\" class=\"form-control\" value=\"http://{{request.get_host}}/form/{{form.code}}/viewform\" copy-btn id=\"copy-url\">\n            </div>\n            <button class=\"btn btn-submit\" copy-btn>Copy</button>\n        </div>\n    </div>\n</div>\n{% endblock %}"
  },
  {
    "path": "index/templates/index/form_response.html",
    "content": "{% extends 'index/layout.html' %}\n{% load static %}\n{% block script %}\n<script src=\"{% static 'index/viewform.js' %}\" defer></script>\n{% endblock %}\n{% block body %}\n<div class=\"container\">\n    <span id=\"bg-color\" style=\"display: none;\">{{form.background_color}}</span>\n    <span id=\"text-color\" style=\"display: none;\">{{form.text_color}}</span>\n    <div class=\"margin-top-bottom box box-shadow bg-white\">\n        <h1 class=\"form-title txtClr\">{{form.title}}</h1>\n        <p class=\"text-label margin-left-right\" style=\"margin-left: 10px;\">{{form.confirmation_message}}</p>\n        {% if form.edit_after_submit %}\n        <a href=\"{% url 'edit_response' form.code code %}\" class=\"edit-response-link\">Edit response</a>\n        {% endif %}\n        {% if form.is_quiz and form.allow_view_score %}\n        <div class=\"modal-division\">\n            <a href=\"{% url 'response' form.code code %}\" class=\"btn view-score-btn\">View Score</a>\n        </div>\n        {% endif %}\n    </div>\n</div>\n{% endblock %}"
  },
  {
    "path": "index/templates/index/index.html",
    "content": "{% extends 'index/layout.html' %}\n{% load static %}\n{% block script %}\n<script src = \"{% static 'index/index.js' %}\" defer></script>\n<script src=\"{% static 'lib/cookie.min.js' %}\" defer></script>\n{% endblock %}\n{% load static %}\n{% block body %}\n<div class=\"container-fluid\">\n    <div class=\"topnav nav-effect\">\n        <div class=\"nav-padding\">\n            <span class=\"nav-ham\" id=\"nav-ham\">&#9776;</span>\n            <img src = \"{% static 'Icon/icon.png' %}\" alt = \"Google Forms Icon(CLONE)\" class=\"navbar-icon form-icon\" title = \"Forms\">\n            <span class=\"nav-text\" title = \"Forms\"><a href = \"{% url 'index' %}\" class=\"nav-link\">Forms CLONE</a></span>\n            <a href=\"{% url 'logout' %}\">\n                <img src = \"{% static 'Icon/Logout.jpg' %}\" alt = \"Logout Icon\" class=\"navbar-icon float-right logout-icon\" title = \"Logout\">\n            </a>\n        </div>\n    </div>\n    <div class=\"sidebar\" id = \"sidebar\">\n        <span class=\"close-sidebar\" id=\"close-sidebar\">&times;</span>\n        <div class=\"sidebar-content\">\n            <h4 class=\"sidebar-title\">\n                <a href = \"{% url 'index' %}\" class=\"sidebar-title-link\">\n                    <span>Google Forms CLONE</span>\n                </a>\n            </h4>\n            <p class=\"text-label\">Found bug? Submit an issue <a href=\"https://github.com/kimlimjustin/google-form-clone/issues\" class=\"link\">here</a></p>\n            <p class=\"text-label\">License: <a href=\"https://github.com/kimlimjustin/google-form-clone/blob/master/LICENSE\" class=\"link\">MIT</a></p>\n            <p class=\"text-label\">Source code: <a href=\"https://github.com/kimlimjustin/google-form-clone\">\n                <img src = \"{% static 'Icon/github.png' %}\" class=\"github-icon\" alt=\"GitHub\"></a></p>\n            <p class=\"text-label\">Support creator by <a href=\"https://github.com/kimlimjustin/google-form-clone\" class=\"link\">give a star on GitHub</a></p>\n        </div>\n    </div>\n    <div class=\"create-form\">\n        <div class=\"container\">\n            <p class=\"forms-label\">Start a new form</p>\n            <div class=\"form-template-box\">\n                <img src = \"{% static 'Icon/blank-form.png' %}\" alt = \"Blank form\" title = \"Blank form\" id=\"create-blank-form\">\n                <span class=\"form-template-label\">Blank Form</span>\n            </div>\n            <div class=\"form-template-box big-screen\">\n                <img src = \"{% static 'Template/contact_information.png' %}\" alt = \"Contact Information\" title = \"Contact Information\" id=\"create-contact-form\">\n                <span class=\"form-template-label\">Contact Information</span>\n            </div>\n            <div class=\"form-template-box big-screen\">\n                <img src = \"{% static 'Template/customer_feedback.png' %}\" alt = \"Customer Feedback\" title = \"Customer Feedback\" id=\"create-customer-feedback\">\n                <span class=\"form-template-label\">Customer Feedback</span>\n            </div>\n            <div class=\"form-template-box big-screen\">\n                <img src = \"{% static 'Template/customer_feedback.png' %}\" alt = \"Event Registration\" title = \"Event Registration\" id=\"create-event-registration\">\n                <span class=\"form-template-label\">Event Registration</span>\n            </div>\n        </div>\n    </div>\n    <div class=\"container\">\n        <div class=\"form-list\">\n            <p class=\"forms-label\">Your forms:</p>\n            {% for i in forms %}\n            <a href = \"{% url 'edit_form' i.code %}\" class=\"form-list-link\">\n                <div class=\"form-box\">\n                    <div class=\"form-list-title\"><h5 class=\"form-list-title-text\">{{i.title}}</h5></div>\n                    {% if i.createdAt == i.updatedAt %}\n                    <p class=\"form-list-timestamp\">{{i.createdAt}}</p>\n                    {% else %}\n                    <p class=\"form-list-timestamp\">{{i.updatedAt}}</p>\n                    {% endif %}\n                </div>\n            </a>\n            {% endfor %}\n        </div>\n    </div>\n</div>\n{% endblock %}"
  },
  {
    "path": "index/templates/index/layout.html",
    "content": "{% load static %}\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>{% block title %}Google Forms CLONE{% endblock %}</title>\n    <link rel=\"stylesheet\" href=\"{% static 'index/HurlUI.css' %}\">\n    <link rel=\"stylesheet\" href=\"{% static 'index/style.css' %}\">\n    {% block script %}\n    {% endblock %}\n</head>\n<body>\n    {% block body %}\n    {% endblock %}\n</body>\n</html>"
  },
  {
    "path": "index/templates/index/login.html",
    "content": "{% extends 'index/layout.html' %}\n{% block body %}\n<div class=\"container\">\n    <form class=\"box box-shadow margin-top-bottom\" method=\"POST\" action = \"{% url 'login' %}\">\n        <div class=\"form-group\">\n            <h1 class=\"box-title\">Login user</h1>\n            <p class=\"form-error\">{{message}}</p>\n            {% csrf_token %}\n        </div>\n        <div class=\"form-group form-animate\">\n            <p class=\"form-label\">Username</p>\n            <input type=\"text\" class=\"input-animate\" required name=\"username\">\n            <span class=\"input-onFocus\"></span>\n        </div>\n        <div class=\"form-group form-animate\">\n            <p class=\"form-label\">Password:</p>\n            <input type=\"password\" name=\"password\" class=\"input-animate\" required>\n            <span class=\"input-onFocus\"></span>\n        </div>\n        <div class=\"form-group\">\n            <p class=\"form-label\">Don't have account yet? <a class=\"link\" href = \"{% url 'register' %}\">Register</a></p>\n            <input type=\"submit\" value=\"Login\" class=\"btn btn-dark form-control\">\n        </div>\n    </form>\n</div>\n{% endblock %}"
  },
  {
    "path": "index/templates/index/register.html",
    "content": "{% extends 'index/layout.html' %}\n{% block body %}\n<div class=\"container\">\n    <form action=\"{% url 'register' %}\" method=\"post\" class=\"box box-shadow margin-top-bottom\">\n        <div class=\"form-group\">\n            <h1 class=\"box-title\">Register user</h1>\n            <p class=\"form-error\">{{message}}</p>\n            {% csrf_token %}\n        </div>\n        <div class=\"form-group form-animate\">\n            <p class=\"form-label\">Username:</p>\n            <input type=\"text\" class=\"form-control input-animate\" name=\"username\" required>\n            <span class=\"input-onFocus\"></span>\n        </div>\n        <div class=\"form-group form-animate\">\n            <p class=\"form-label\">Email:</p>\n            <input type=\"email\" name=\"email\" class=\"form-control input-animate\" required>\n            <span class=\"input-onFocus\"></span>\n        </div>\n        <div class=\"form-group form-animate\">\n            <p class=\"form-label\">Password:</p>\n            <input type=\"password\" name=\"password\" class=\"form-control input-animate\" required>\n            <span class=\"input-onFocus\"></span>\n        </div>\n        <div class=\"form-group form-animate\">\n            <p class=\"form-label\">Password Confirmation:</p>\n            <input type=\"password\" name=\"confirmation\" class=\"form-control input-animate\" required>\n            <span class=\"input-onFocus\"></span>\n        </div>\n        <div class=\"form-group\">\n            <p class=\"form-label\">Already have account? <a class=\"link\" href = \"{% url 'login' %}\">Login</a></p>\n            <input type=\"submit\" value=\"Register\" class=\"btn btn-dark form-control\">\n        </div>\n    </form>\n</div>\n{% endblock %}"
  },
  {
    "path": "index/templates/index/response.html",
    "content": "{% extends 'index/layout.html' %}\n{% load static %}\n{% load get_response %}\n{% load to_int %}\n{% load is_response %}\n{% load score %}\n{% block script %}\n<script src=\"{% static 'index/response.js' %}\"></script>\n{% endblock %}\n{% block body %}\n<div class=\"container-fluid\">\n    <div class=\"container\">\n        <span id=\"bg-color\" style=\"display: none;\">{{form.background_color}}</span>\n        <span id=\"text-color\" style=\"display: none;\">{{form.text_color}}</span>\n        <div class=\"margin-top-bottom box question-box\">\n            <div class=\"form-title-box\">\n                <h1 class=\"form-title txtClr\">{{form.title}}</h1>\n                {% if form.is_quiz %}\n                <h4 class=\"score-title\">Score: {{score}} / {{total_score}}</h4>\n                {% endif %}\n                <p class=\"required-info\">* Required</p>\n            </div>\n            <div class=\"form-description txtClr\">{{form.description|linebreaksbr}}</div>\n        </div>\n        {% if form.collect_email %}\n        <div class=\"margin-top-bottom box question-box\">\n            <h1 class=\"question-title txtClr\">Email address: <span class=\"require-star\">*</span></h1>\n            <p class=\"short-answer\">{{response.responder_email}}</p>\n        </div>\n        {% endif %}\n        {% for question in form.questions.all %}\n        <div class=\"margin-top-bottom box question-box\">\n            <h1 class=\"response-title txtClr\">{{question.question}} {% if question.required %}<span class=\"require-star\">*</span>{% endif %}\n            {% if form.is_quiz %}<span class=\"float-right\">{{response|score:question.pk}} / {{question.score}}</span>{% endif %}</h1>\n            {% if question.question_type == \"short\" %}\n                <p class=\"short-answer\">{{response|get_response:question.pk}}</p>\n            {% elif question.question_type == \"paragraph\" %}\n                <p class=\"long-answer\">{{response|get_response:question.pk|linebreaksbr}}</p>\n            {% elif question.question_type == \"multiple choice\" %}\n                {% for choice in question.choices.all %}\n                <div class=\"multiple-choice\">\n                    {% if response|get_response:question.pk|to_int == choice.pk|to_int %}\n                        <input type=\"radio\" name=\"{{question.id}}\" id=\"{{choice.id}}\" checked>\n                    {% else %}\n                        <input type=\"radio\" name=\"{{question.id}}\" id=\"{{choice.id}}\" disabled>\n                    {% endif %}\n                    <label for=\"{{choice.id}}\" class=\"txtClr\">{{choice.choice}}</label>\n                </div>\n                {% endfor %}\n            {% elif question.question_type == \"checkbox\" %}\n                {% for choice in question.choices.all %}\n                <div class=\"multiple-choice\">\n                    {% if response|get_responses:question.pk|is_response:choice.pk %}\n                        <input type=\"checkbox\" name=\"{{question.id}}\" id=\"{{choice.id}}\" value=\"{{choice.id}}\" checked onclick=\"return false\">\n                    {% else %}\n                        <input type=\"checkbox\" name=\"{{question.id}}\" id=\"{{choice.id}}\" value=\"{{choice.id}}\" disabled>\n                    {% endif %}\n                    <label for=\"{{choice.id}}\" class=\"txtClr\">{{choice.choice}}</label>\n                </div>\n                {% endfor %}\n            {% endif %}\n            {% if user != form.creator and question.feedback != None and question.feedback != \"\" %}\n                <div class=\"feedback\">\n                    <h5 class=\"feedback-title\">Feedback:</h5>\n                    <p class=\"text-label long-answer\">{{question.feedback|linebreaksbr|urlize}}</p>\n                </div>\n            {% endif %}\n        </div>\n        {% endfor %}\n    </div>\n    {% if user == form.creator %}\n        <a href=\"{% url 'edit_form' form.code %}\">\n            <img src=\"{% static 'Icon/question.png' %}\" alt=\"Edit Question\" title=\"Edit this form\" class=\"edit-form-link\">\n        </a>\n    {% endif %}\n</div>\n{% endblock %}"
  },
  {
    "path": "index/templates/index/responses.html",
    "content": "{% extends 'index/layout.html' %}\n{% load static %}\n{% load get_property %}\n{% load generate_color %}\n{% load count %}\n{% block title %}{{form.title}}'s response ~ Google Forms CLONE{% endblock %}\n{% block script %}\n<script src=\"{% static 'index/responses.js' %}\" defer></script>\n<script src=\"{% static 'lib/cookie.min.js' %}\"></script>\n{% endblock %}\n{% block body %}\n<div class=\"container-fluid\">\n    <div class=\"form-topnav\">\n        <a href = \"/\">\n            <img src = \"{% static 'Icon/icon.png' %}\" alt = \"Google Forms Icon(CLONE)\" class=\"navbar-icon form-icon\" title = \"Forms\" />\n        </a>\n        <span class=\"nav-text nav-form-title input-form-title\">{{form.title}}</span>\n        <div class=\"float-right\">\n            <img src=\"{% static 'Icon/theme.png' %}\" alt=\"Theme icon\" id=\"customize-theme-btn\" title = \"Customize theme\" class=\"nav-form-menu-icon\" />\n            <a href=\"{% url 'view_form' form.code %}\">\n            <img src=\"{% static 'Icon/eye.png' %}\" alt=\"Preview icon\" title = \"Preview\" class=\"nav-form-menu-icon big-screen\" />\n            </a>\n            <img src=\"{% static 'Icon/send.png' %}\" alt =\"Send icon\" title = \"Send\" class=\"nav-form-menu-icon small-screen\" id=\"send-form-btn\" />\n            <img src=\"{% static 'Icon/setting.png' %}\" alt=\"Setting icon\" title = \"Setting\" class=\"nav-form-menu-icon open-setting\" />\n            <button class = \"btn send-form-btn big-screen\" title = \"Send\" id=\"send-form-btn\">Send</button>\n        </div>\n    </div>\n    <div class=\"form-topnav\">\n        <div class=\"form-navigation center\">\n            {% if form.is_quiz %}\n            <span class=\"col-4 navigation\"><a href = \"{% url 'edit_form' form.code %}\" class=\"link\">Questions</a></span>\n            <span class=\"col-4 navigation score\"><a href=\"{% url 'score' form.code %}\" class=\"link\">Scores</a></span>\n            <span class=\"col-4 navigation active\">Responses</span>\n            {% else %}\n            <span class=\"col-6 navigation\"><a href = \"{% url 'edit_form' form.code %}\" class=\"link\">Questions</a></span>\n            <span class=\"col-6 navigation active\">Responses</span>\n            {% endif %}\n        </div>\n    </div>\n    <div class=\"container\">\n        <span id=\"bg-color\" style=\"display: none;\">{{form.background_color}}</span>\n        <span id=\"text-color\" style=\"display: none;\">{{form.text_color}}</span>\n        <div class=\"margin-top-bottom box question-box\" id=\"responses\">\n            {% if responses.count > 0 %}\n            <h1 class=\"response-title\">Individual Response:</h1>\n            <ul>\n                {% for i in responses %}\n                    {% if form.collect_email %}\n                        <li><a href = \"{% url 'response' form.code i.response_code %}\" class=\"link\">{{i.responder_email}}'s response</a></li>\n                    {% elif form.authenticated_responder %}\n                        <li><a href = \"{% url 'response' form.code i.response_code %}\" class=\"link\">{{i.responder.username}}'s response</a></li>\n                    {% else %}\n                        <li><a href = \"{% url 'response' form.code i.response_code %}\" class=\"link\">{{i.responder_ip}}'s response</a></li>\n                    {% endif %}\n                {% endfor %}\n            </ul>\n            <button class=\"btn btn-danger\" id=\"delete-responses\">Delete all responses</button>\n            <a href=\"{% url 'export_csv' form.code  %}\"><button class=\"btn btn-success\" id=\"delete-responses\">download</button></a>\n            {% else %}\n            <h1 class=\"response-title\">0 responses</h1>\n            {% endif %}\n        </div>\n        <div class=\"margin-top-bottom box question-box\">\n            <h1 class=\"response-title\">Questions Summary:</h1>\n            {% for r in responsesSummary %}\n            <div class=\"response-summary\">\n                <h3 class=\"response-summary-title\">{{r.question.question}}</h3>\n                {% if r.answers|count > 0 or filteredResponsesSummary|get_property:r.question.question|count > 0 %}\n                    {% if r.question.question_type == 'short' or r.question.question_type == 'paragraph' %}\n                        {% for i in r.answers %}\n                            <blockquote>{{i.answer}}</blockquote>\n                        {% endfor %}\n                    {% else %}\n                            <canvas id=\"myChart{{r.question.id}}\" class=\"pie-chart\"></canvas>\n                            <script src=\"https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js\"></script>\n                            <script>\n                                Chart.defaults.global.defaultFontFamily = \"Roboto\";\n                                Chart.defaults.global.defaultFontSize = 30;\n                                var ctx = document.getElementById(\"myChart{{r.question.id}}\");\n                                let chartData{{r.question.id}} = {labels: [{% for i in filteredResponsesSummary|get_property:r.question.question %}\"{{i}}\",{% endfor %}], \n                                datasets: [{\n                                    data: [{% for i in filteredResponsesSummary|get_property:r.question.question %}{{filteredResponsesSummary|get_property:r.question.question|get_property:i}},{% endfor %}],\n                                    backgroundColor: [{% for _ in filteredResponsesSummary|get_property:r.question.question %}\"{{0|generate_color}}\",{% endfor %}],\n                                }]}\n                                new Chart(ctx, {type: 'pie', data: chartData{{r.question.id}}, options: {responsive: true}});\n                            </script>\n                    {% endif %}\n                {% else %}\n                <blockquote><i>No responses</i></blockquote>\n                {% endif %}\n            </div>\n            {% endfor %}\n        </div>\n    <div class=\"question-options\">\n        <a href=\"{% url 'view_form' form.code %}\">\n            <img src = \"{% static 'Icon/eye.png' %}\" class = \"form-option-icon\" title = \"Preview\" alt = \"Preview icon\" />\n        </a>\n        <a href=\"{% url 'edit_form' form.code %}\">\n            <img src=\"{% static 'Icon/question.png' %}\" alt=\"Edit Question\" title=\"Edit this form\" class=\"form-option-icon\">\n        </a>\n        {% if form.is_quiz %}\n        <a href = \"{% url 'score' form.code %}\" id=\"add-score\">\n            <img src = \"{% static 'Icon/score.png' %}\" class = \"form-option-icon\" title = \"Add score\" alt = \"Score icon\" />\n        </a>\n        {% endif %}\n    </div>\n    <div class=\"modal\" id=\"customize-theme\">\n        <div class=\"modal-content\">\n            <span class=\"modal-close-btn\" id=\"close-customize-theme\">&times;</span>\n            <h1 class=\"modal-title\">Theme options</h1>\n            <h3 class=\"modal-subtitle\">Background Color:</h3>\n            <input type=\"color\"  value = \"{{form.background_color}}\" list=\"bgColors\" class=\"form-control\" id=\"input-bg-color\" />\n            <datalist id=\"bgColors\">\n                <option value=\"#03a9f4\"></option>\n                <option value=\"#00bcd4\"></option>\n                <option value=\"#7ff0e7\"></option>\n                <option value = \"#e1d8f1\"></option>\n                <option value = \"#d1c4e9\"></option>\n                <option value = \"#f6f6f6\"></option>\n                <option value=\"#f1f3f4\"></option>\n                <option value=\"#9aa0a2\"></option>\n                <option value=\"#d8ef89\"></option>\n            </datalist>\n            <h3 class=\"modal-subtitle\">Text Color:</h3>\n            <input type=\"color\"  value = {{form.text_color}} list=\"textColors\" class=\"form-control\" id=\"input-text-color\" />\n            <datalist id=\"textColors\">\n                <option value=\"#db4437\"></option>\n                <option value=\"#673ab7\"></option>\n                <option value=\"#3f51b5\"></option>\n                <option value=\"#4285f4\"></option>\n                <option value=\"#03a9f4\"></option>\n                <option value=\"#00bcd4\"></option>\n                <option value=\"#8a8a8a\"></option>\n                <option value=\"#4c3d45\"></option>\n                <option value=\"#272124\"></option>\n            </datalist>\n        </div>\n    </div>\n    <div class=\"modal\" id=\"setting\">\n        <div class=\"modal-content txt-clr\">\n            <form id=\"setting-form\">\n                <span class=\"modal-close-btn\" id=\"close-setting\">&times;</span>\n                <h1 class = \"modal-title\">Setting</h1>\n                <h4 class=\"setting-preview-form small-screen\"><a href=\"{% url 'view_form' form.code %}\">Preview form here</a></h4>\n                <div class=\"modal-division\">\n                    <div class=\"form-group\">\n                        <h3 class=\"modal-subtitle\">General</h3>\n                        <input type=\"checkbox\" id=\"collect_email\"{% if form.collect_email %} checked {% endif %}>\n                        <label for=\"collect_email\" class=\"setting-form-label\">Collect email address</label>\n                    </div>\n                    <div class=\"form-group\">\n                        <input type=\"checkbox\" id=\"is_quiz\" {% if form.is_quiz %} checked {% endif %}>\n                        <label for=\"is_quiz\" class=\"setting-form-label\">Make this as a quiz</label>\n                    </div>\n                    <div class=\"form-group\">\n                        <input type=\"checkbox\" id=\"authenticated_responder\" {% if form.authenticated_responder %} checked {% endif %}>\n                        <label for=\"authenticated_responder\" class=\"setting-form-label\">Respondent account must be authenticated. (Signed in required)</label>\n                    </div>\n                </div>\n                <div class=\"modal-division\">\n                    <div class=\"form-group\">\n                        <h3 class=\"modal-subtitle\">Confirmation message:</h3>\n                        <textarea rows=\"1\" class=\"confirmation-msg-input edit-on-click textarea-adjust\" spellcheck=\"false\"\n                         id=\"comfirmation_message\">{{form.confirmation_message}}</textarea>\n                    </div>\n                </div>\n                <div class=\"modal-division\">\n                    <div class=\"form-group\">\n                        <h3 class=\"modal-subtitle\">Respondents can:</h3>\n                        <input type=\"checkbox\" id=\"edit_after_submit\" {% if form.edit_after_submit %}checked{% endif %}>\n                        <label for=\"edit_after_submit\" class=\"setting-form-label\">Edit after submit</label>\n                    </div>\n                    <div class=\"form-group\">\n                        <input type=\"checkbox\" id=\"allow_view_score\" {% if form.allow_view_score %}checked{% endif %}>\n                        <label for=\"allow_view_score\" class=\"setting-form-label\">View score</label>\n                    </div>\n                    <div class=\"form-group\">\n                        <input type=\"submit\" value=\"Save\" class=\"form-control btn btn-save-setting\">\n                    </div>\n                </div>\n            </form>\n            <form id=\"delete-form\" class=\"modal-division\">\n                <fieldset class=\"form-group\">\n                    <legend class=\"modal-subtitle text-danger danger-zone\">Danger Zone</legend>\n                    <h3 class=\"delete-form-title\">Delete this form</h3>\n                    <p class=\"delete-form-description\">Once you delete a form, there is no going back. Please be certain.</p>\n                    <input type=\"submit\" value=\"Delete\" class=\"form-control delete-form-btn\">\n                </fieldset>\n            </form>\n        </div>\n    </div>\n    <div class=\"modal\" id=\"send-form\">\n        <div class=\"modal-content\">\n            <span class=\"modal-close-btn\" id=\"close-send-form\">&times;</span>\n            <h1 class = \"modal-title\">Send form</h1>\n            <div class=\"modal-division\">\n                <h4 class=\"modal-subtitle\">Link:</h4>\n                <input type=\"url\" class=\"form-control\" value=\"http://{{request.get_host}}/form/{{form.code}}/viewform\" copy-btn id=\"copy-url\">\n            </div>\n            <button class=\"btn btn-submit\" copy-btn>Copy</button>\n        </div>\n    </div>\n</div>\n\n{% endblock %}"
  },
  {
    "path": "index/templates/index/score.html",
    "content": "{% extends 'index/layout.html' %}\n{% load static %}\n{% block title %}{{form.title}} ~ Google Forms CLONE{% endblock %}\n{% block script %}\n<script src=\"{% static 'index/score.js' %}\" defer></script>\n<script src=\"{% static 'lib/cookie.min.js' %}\"></script>\n{% endblock %}\n{% block body %}\n<div class=\"container-fluid\">\n    <div class=\"form-topnav\">\n        <a href = \"/\">\n            <img src = \"{% static 'Icon/icon.png' %}\" alt = \"Google Forms Icon(CLONE)\" class=\"navbar-icon form-icon\" title = \"Forms\" />\n        </a>\n        <span class=\"nav-text nav-form-title input-form-title\">{{form.title}}</span>\n        <div class=\"float-right\">\n            <img src=\"{% static 'Icon/theme.png' %}\" alt=\"Theme icon\" id=\"customize-theme-btn\" title = \"Customize theme\" class=\"nav-form-menu-icon\" />\n            <a href=\"{% url 'view_form' form.code %}\">\n            <img src=\"{% static 'Icon/eye.png' %}\" alt=\"Preview icon\" title = \"Preview\" class=\"nav-form-menu-icon big-screen\" />\n            </a>\n            <img src=\"{% static 'Icon/send.png' %}\" alt =\"Send icon\" title = \"Send\" class=\"nav-form-menu-icon small-screen\" id=\"send-form-btn\" />\n            <img src=\"{% static 'Icon/setting.png' %}\" alt=\"Setting icon\" title = \"Setting\" class=\"nav-form-menu-icon open-setting\" />\n            <button class = \"btn send-form-btn big-screen\" title = \"Send\" id=\"send-form-btn\">Send</button>\n        </div>\n    </div>\n    <div class=\"form-topnav\">\n        <div class=\"form-navigation center\">\n            <span class=\"col-4 navigation\"><a href = \"{% url 'edit_form' form.code %}\" class=\"link\">Questions</a></span>\n            <span class=\"col-4 navigation active\">Scores</span>\n            <span class=\"col-4 navigation\"><a href = \"{% url 'responses' form.code %}\" class=\"link\">Responses</a></span>\n        </div>\n    </div>\n    <div class=\"container\">\n        <span id=\"bg-color\" style=\"display: none;\">{{form.background_color}}</span>\n        <span id=\"text-color\" style=\"display: none;\">{{form.text_color}}</span>\n        <div class=\"margin-top-bottom box question-box\" id=\"form-head\">\n            <div class=\"form-title-box\">\n                <h1 class=\"form-title edit-on-click txt-clr\">{{form.title}}</h1>\n            </div>\n            <p class=\"form-description edit-on-click textarea-adjust txt-clr\">{{form.description|linebreaksbr}}</p>\n            {% if form.collect_email %}\n            <div class=\"collect-email txt-clr\">\n                <h3 class=\"question-title\">Email address <span class=\"require-star\">*</span></h3>\n                <input type=\"text\" autoComplete=\"off\" aria-label=\"Valid email address\" disabled dir = \"auto\" class=\"require-email-edit txtColor\"\n                placeholder = \"Valid email address\" />\n                <p class=\"collect-email-desc\">This form is collecting email addresses. <span class=\"open-setting\">Change settings</span></p>\n            </div>\n            {% endif %}\n        </div>\n        {% for question in form.questions.all %}\n        <div class=\"margin-top-bottom box question-box question\" data-id=\"{{question.id}}\">\n            <h2 class=\"question-title-score\">{{question.question}}</h2>\n            <div class=\"question-score\">\n                <input type=\"number\" data-id=\"{{question.id}}\" id=\"score\" class=\"input-score\" value=\"{{question.score}}\">\n                <label for=\"score\">Points</label>\n            </div>\n            <div class=\"answer-key\">\n                <p class=\"answer-key-title\">Answer key:</p>\n                {% if question.question_type == \"short\" %}\n                    <input type=\"text\" class=\"short-answer\" data-id=\"{{question.id}}\" data-question-type = \"{{question.question_type}}\" answer-key\n                    value=\"{{question.answer_key}}\">\n                {% elif question.question_type == \"paragraph\" %}\n                    <textarea class=\"long-answer textarea-adjust\" data-question-type = \"{{question.question_type}}\" answer-key \n                    data-id=\"{{question.id}}\">{{question.answer_key}}\n                    </textarea>\n                {% elif question.question_type == \"multiple choice\" %}\n                    {% for i in question.choices.all %}\n                    <div class=\"form-group\">\n                        <input type=\"radio\" name=\"{{question.id}}-answer\" id=\"choice-{{i.id}}\" data-id=\"{{question.id}}\" value=\"{{i.id}}\" answer-key\n                        data-question_type = \"{{question.question_type}}\" {% if i.is_answer %} checked {% endif %}>\n                        <label for=\"choice-{{i.id}}\">{{i.choice}}</label>\n                    </div>\n                    {% endfor %}\n                {% elif question.question_type == \"checkbox\" %}\n                    {% for i in question.choices.all %}\n                    <div class=\"form-group\">\n                        <input type=\"checkbox\" name=\"{{question.id}}-answer\" id=\"choice-{{i.id}}\" data-id=\"{{question.id}}\" value=\"{{i.id}}\"\n                        data-question_type = \"{{question.question_type}}\" answer-key {% if i.is_answer %} checked {% endif %}>\n                        <label for=\"choice-{{i.id}}\">{{i.choice}}</label>\n                    </div>\n                    {% endfor %}\n                {% endif %}\n            </div>\n            <div class=\"feedback\">\n                <p class=\"feedback-title\">Feedback:</p>\n                {% if question.feedback != None %}\n                <textarea class=\"long-answer textarea-adjust\" data-id=\"{{question.id}}\" name=\"feedback\">{{question.feedback}}</textarea>\n                {% else %}\n                <textarea class=\"long-answer textarea-adjust\" data-id=\"{{question.id}}\" name=\"feedback\"></textarea>\n                {% endif %}\n            </div>\n        </div>\n        {% endfor %}\n    </div>\n    <div class=\"question-options\">\n        <a href=\"{% url 'view_form' form.code %}\">\n            <img src = \"{% static 'Icon/eye.png' %}\" class = \"form-option-icon\" title = \"Preview\" alt = \"Preview icon\" />\n        </a>\n        <a href=\"{% url 'edit_form' form.code %}\">\n            <img src = \"{% static 'Icon/question.png' %}\" class = \"form-option-icon\" title = \"Questions\" alt = \"Question icon\" />\n        </a>\n    </div>\n    <div class=\"modal\" id=\"customize-theme\">\n        <div class=\"modal-content\">\n            <span class=\"modal-close-btn\" id=\"close-customize-theme\">&times;</span>\n            <h1 class=\"modal-title\">Theme options</h1>\n            <h3 class=\"modal-subtitle\">Background Color:</h3>\n            <input type=\"color\"  value = \"{{form.background_color}}\" list=\"bgColors\" class=\"form-control\" id=\"input-bg-color\" />\n            <datalist id=\"bgColors\">\n                <option value=\"#03a9f4\"></option>\n                <option value=\"#00bcd4\"></option>\n                <option value=\"#7ff0e7\"></option>\n                <option value = \"#e1d8f1\"></option>\n                <option value = \"#d1c4e9\"></option>\n                <option value = \"#f6f6f6\"></option>\n                <option value=\"#f1f3f4\"></option>\n            </datalist>\n            <h3 class=\"modal-subtitle\">Text Color:</h3>\n            <input type=\"color\"  value = {{form.text_color}} list=\"textColors\" class=\"form-control\" id=\"input-text-color\" />\n            <datalist id=\"textColors\">\n                <option value=\"#db4437\"></option>\n                <option value=\"#673ab7\"></option>\n                <option value=\"#3f51b5\"></option>\n                <option value=\"#4285f4\"></option>\n                <option value=\"#03a9f4\"></option>\n                <option value=\"#00bcd4\"></option>\n                <option value=\"#8a8a8a\"></option>\n                <option value=\"#4c3d45\"></option>\n                <option value=\"#272124\"></option>\n                <option value=\"#9aa0a2\"></option>\n                <option value=\"#d8ef89\"></option>\n            </datalist>\n        </div>\n    </div>\n    <div class=\"modal\" id=\"setting\">\n        <div class=\"modal-content txt-clr\">\n            <form id=\"setting-form\">\n                <span class=\"modal-close-btn\" id=\"close-setting\">&times;</span>\n                <h1 class = \"modal-title\">Setting</h1>\n                <h4 class=\"setting-preview-form small-screen\"><a href=\"{% url 'view_form' form.code %}\">Preview form here</a></h4>\n                <div class=\"modal-division\">\n                    <div class=\"form-group\">\n                        <h3 class=\"modal-subtitle\">General</h3>\n                        <input type=\"checkbox\" id=\"collect_email\"{% if form.collect_email %} checked {% endif %}>\n                        <label for=\"collect_email\" class=\"setting-form-label\">Collect email address</label>\n                    </div>\n                    <div class=\"form-group\">\n                        <input type=\"checkbox\" id=\"is_quiz\" {% if form.is_quiz %} checked {% endif %}>\n                        <label for=\"is_quiz\" class=\"setting-form-label\">Make this as a quiz</label>\n                    </div>\n                    <div class=\"form-group\">\n                        <input type=\"checkbox\" id=\"authenticated_responder\" {% if form.authenticated_responder %} checked {% endif %}>\n                        <label for=\"authenticated_responder\" class=\"setting-form-label\">Respondent account must be authenticated. (Signed in required)</label>\n                    </div>\n                </div>\n                <div class=\"modal-division\">\n                    <div class=\"form-group\">\n                        <h3 class=\"modal-subtitle\">Confirmation message:</h3>\n                        <textarea rows=\"1\" class=\"confirmation-msg-input edit-on-click textarea-adjust\" spellcheck=\"false\"\n                         id=\"comfirmation_message\">{{form.confirmation_message}}</textarea>\n                    </div>\n                </div>\n                <div class=\"modal-division\">\n                    <div class=\"form-group\">\n                        <h3 class=\"modal-subtitle\">Respondents can:</h3>\n                        <input type=\"checkbox\" id=\"edit_after_submit\" {% if form.edit_after_submit %}checked{% endif %}>\n                        <label for=\"edit_after_submit\" class=\"setting-form-label\">Edit after submit</label>\n                    </div>\n                    <div class=\"form-group\">\n                        <input type=\"checkbox\" id=\"allow_view_score\" {% if form.allow_view_score %}checked{% endif %}>\n                        <label for=\"allow_view_score\" class=\"setting-form-label\">View score</label>\n                    </div>\n                    <div class=\"form-group\">\n                        <input type=\"submit\" value=\"Save\" class=\"form-control btn btn-save-setting\">\n                    </div>\n                </div>\n            </form>\n            <form id=\"delete-form\" class=\"modal-division\">\n                <fieldset class=\"form-group\">\n                    <legend class=\"modal-subtitle text-danger danger-zone\">Danger Zone</legend>\n                    <h3 class=\"delete-form-title\">Delete this form</h3>\n                    <p class=\"delete-form-description\">Once you delete a form, there is no going back. Please be certain.</p>\n                    <input type=\"submit\" value=\"Delete\" class=\"form-control delete-form-btn\">\n                </fieldset>\n            </form>\n        </div>\n    </div>\n    <div class=\"modal\" id=\"send-form\">\n        <div class=\"modal-content\">\n            <span class=\"modal-close-btn\" id=\"close-send-form\">&times;</span>\n            <h1 class = \"modal-title\">Send form</h1>\n            <div class=\"modal-division\">\n                <h4 class=\"modal-subtitle\">Link:</h4>\n                <input type=\"url\" class=\"form-control\" value=\"http://{{request.get_host}}/form/{{form.code}}/viewform\" copy-btn id=\"copy-url\">\n            </div>\n            <button class=\"btn btn-submit\" copy-btn>Copy</button>\n        </div>\n    </div>\n</div>\n{% endblock %}"
  },
  {
    "path": "index/templates/index/view_form.html",
    "content": "{% extends 'index/layout.html' %}\n{% load static %}\n{% block title %}{{form.title}} ~ Google Forms CLONE{% endblock %}\n{% block script %}\n<script src=\"{% static 'index/viewform.js' %}\" defer></script>\n{% endblock %}\n{% block body %}\n<div class=\"container-fluid\">\n    <form class=\"container\" method=\"POST\" action=\"{% url 'submit_form' form.code %}\" autocomplete=\"off\">\n        <span id=\"bg-color\" style=\"display: none;\">{{form.background_color}}</span>\n        <span id=\"text-color\" style=\"display: none;\">{{form.text_color}}</span>\n        {% csrf_token %}\n        <div class=\"margin-top-bottom box question-box\">\n            <div class=\"form-title-box\">\n                <h1 class=\"form-title txtClr\">{{form.title}}</h1>\n                <p class=\"required-info\">* Required</p>\n            </div>\n            <div class=\"form-description txtClr\">{{form.description|linebreaksbr}}</div>\n        </div>\n        {% if form.collect_email %}\n        <div class=\"margin-top-bottom box question-box\">\n            <h1 class=\"question-title txtClr\">Email address: <span class=\"require-star\">*</span></h1>\n            <input type=\"email\" name=\"email-address\" class=\"short-answer\" placeholder=\"Your email address\" required>\n        </div>\n        {% endif %}\n        {% for question in form.questions.all %}\n        <div class=\"margin-top-bottom box question-box\">\n            <h1 class=\"question-title txtClr\">{{question.question}} {% if question.required %}<span class=\"require-star\">*</span>{% endif %}</h1>\n            {% if question.question_type == \"short\" %}\n                <input type=\"text\" name=\"{{question.id}}\" class=\"short-answer\" placeholder = \"Your answer\" {% if question.required %} required {% endif %}>\n            {% elif question.question_type == \"paragraph\" %}\n                <textarea name=\"{{question.id}}\" placeholder=\"Your answer\" class=\"long-answer textarea-adjust\" {% if question.required %} required {% endif %}></textarea>\n            {% elif question.question_type == \"multiple choice\" %}\n                {% for choice in question.choices.all %}\n                <div class=\"multiple-choice\">\n                    <input type=\"radio\" name=\"{{question.id}}\" id=\"{{choice.id}}\" {% if question.required %} required {% endif %} value=\"{{choice.id}}\">\n                    <label for=\"{{choice.id}}\" class=\"txtClr\">{{choice.choice}}</label>\n                </div>\n                {% endfor %}\n            {% elif question.question_type == \"checkbox\" %}\n            {% for choice in question.choices.all %}\n                <div class=\"multiple-choice\">\n                    <input type=\"checkbox\" name=\"{{question.id}}\" id=\"{{choice.id}}\" {% if question.required %} required {% endif %} value=\"{{choice.id}}\">\n                    <label for=\"{{choice.id}}\" class=\"txtClr\">{{choice.choice}}</label>\n                </div>\n                {% endfor %}\n            {% endif %}\n        </div>\n        {% endfor %}\n        <div class=\"margin-top-bottom\">\n            <input type=\"submit\" value=\"Submit\" class=\"btn btn-submit\">\n        </div>\n    </form>\n    {% if user == form.creator %}\n        <a href=\"{% url 'edit_form' form.code %}\">\n            <img src=\"{% static 'Icon/question.png' %}\" alt=\"Edit Question\" title=\"Edit this form\" class=\"edit-form-link\">\n        </a>\n    {% endif %}\n</div>\n{% endblock %}"
  },
  {
    "path": "index/templatetags/count.py",
    "content": "from django import template\nregister = template.Library()\n\n@register.filter\ndef count(array):\n    return len(array)"
  },
  {
    "path": "index/templatetags/generate_color.py",
    "content": "from django import template\nimport random\nregister = template.Library()\n\n@register.filter\ndef generate_color(_):\n    return f\"rgb({random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)})\""
  },
  {
    "path": "index/templatetags/get_property.py",
    "content": "from django import template\nregister = template.Library()\n\n@register.filter\ndef get_property(array, index):\n    return array[index]"
  },
  {
    "path": "index/templatetags/get_response.py",
    "content": "from django import template\nregister = template.Library()\n\n@register.filter\ndef get_response(responses, pk):\n    return responses.response.get(answer_to__pk = pk).answer"
  },
  {
    "path": "index/templatetags/is_response.py",
    "content": "from django import template\nregister = template.Library()\n\n@register.filter\ndef get_responses(responses, pk):\n    return responses.response.filter(answer_to__pk = pk)\n\n@register.filter\ndef is_response(responses, pk):\n    for i in responses:\n        if int(i.answer) == int(pk):\n            return True\n    return False\n"
  },
  {
    "path": "index/templatetags/score.py",
    "content": "from django import template\nregister = template.Library()\n\n@register.filter\ndef score(responses, question):\n    response = responses.response.filter(answer_to__pk = question)\n    for i in response:\n        if i.answer_to.question_type == \"short\" or i.answer_to.question_type == \"paragraph\":\n            if i.answer == i.answer_to.answer_key: return i.answer_to.score\n            else: return 0\n        elif i.answer_to.question_type == \"multiple choice\":\n            answerKey = None\n            for j in i.answer_to.choices.all():\n                if j.is_answer: answerKey = j.id\n            if answerKey is not None and int(answerKey) == int(i.answer): return i.answer_to.score\n            else: return 0\n        elif i.answer_to.question_type == \"checkbox\":\n            answers = []\n            answer_keys = []\n            for j in responses.response.filter(answer_to__pk = i.answer_to.pk):\n                answers.append(int(j.answer))\n                for k in j.answer_to.choices.all():\n                    if k.is_answer and k.pk not in answer_keys: answer_keys.append(k.pk)\n            if answers == answer_keys: return i.answer_to.score\n            else: return 0"
  },
  {
    "path": "index/templatetags/to_int.py",
    "content": "from django import template\nregister = template.Library()\n\n@register.filter\ndef to_int(number):\n    return int(number)"
  },
  {
    "path": "index/tests.py",
    "content": "from django.test import TestCase\n\n# Create your tests here.\n"
  },
  {
    "path": "index/urls.py",
    "content": "from django.urls import path\nfrom . import views\n\nurlpatterns = [\n    path('', views.index, name=\"index\"),\n    path('login', views.login_view, name=\"login\"),\n    path('register', views.register, name=\"register\"),\n    path('form/<str:code>/export_csv', views.exportcsv,name='export_csv'), \n    path('logout', views.logout_view, name=\"logout\"),\n    path('form/create', views.create_form, name=\"create_form\"),\n    path('form/create/contact', views.contact_form_template, name=\"contact_form_template\"),\n    path('form/create/feedback', views.customer_feedback_template, name=\"customer_feedback_template\"),\n    path('form/create/event', views.event_registration_template, name=\"event_registration_template\"),\n    path('form/<str:code>/edit', views.edit_form, name=\"edit_form\"),\n    path('form/<str:code>/edit_title', views.edit_title, name=\"edit_title\"),\n    path('form/<str:code>/edit_description', views.edit_description, name=\"edit_description\"),\n    path('form/<str:code>/edit_background_color', views.edit_bg_color, name=\"edit_background_color\"),\n    path('form/<str:code>/edit_text_color', views.edit_text_color, name=\"edit_text_color\"),\n    path('form/<str:code>/edit_setting', views.edit_setting, name=\"edit_setting\"),\n    path('form/<str:code>/delete', views.delete_form, name=\"delete_form\"),\n    path('form/<str:code>/edit_question', views.edit_question, name=\"edit_question\"),\n    path('form/<str:code>/edit_choice', views.edit_choice, name=\"edit_choice\"),\n    path('form/<str:code>/add_choice', views.add_choice, name=\"add_choice\"),\n    path('form/<str:code>/remove_choice', views.remove_choice, name=\"remove_choice\"),\n    path('form/<str:code>/get_choice/<str:question>', views.get_choice, name=\"get_choice\"),\n    path('form/<str:code>/add_question', views.add_question, name=\"add_question\"),\n    path('form/<str:code>/delete_question/<str:question>', views.delete_question, name=\"delete_question\"),\n    path('form/<str:code>/score', views.score, name=\"score\"),\n    path('form/<str:code>/edit_score', views.edit_score, name=\"edit_score\"),\n    path('form/<str:code>/answer_key', views.answer_key, name=\"answer_key\"),\n    path('form/<str:code>/feedback', views.feedback, name=\"feedback\"),\n    path('form/<str:code>/viewform', views.view_form, name=\"view_form\"),\n    path('form/<str:code>/submit', views.submit_form, name=\"submit_form\"),\n    path('form/<str:code>/responses', views.responses, name='responses'),\n    path('form/<str:code>/response/<str:response_code>', views.response, name=\"response\"),\n    path('form/<str:code>/response/<str:response_code>/edit', views.edit_response, name=\"edit_response\"),\n    path('form/<str:code>/responses/delete', views.delete_responses, name=\"delete_responses\"),\n    path('403', views.FourZeroThree, name=\"403\"),\n    path('404', views.FourZeroFour, name=\"404\")\n]"
  },
  {
    "path": "index/views.py",
    "content": "from django.shortcuts import render\nfrom django.http import HttpResponse, HttpResponseRedirect, JsonResponse\nfrom django.db import IntegrityError\nfrom django.urls import reverse\nfrom django.contrib.auth import authenticate, login, logout\nfrom .models import User, Choices, Questions, Answer, Form, Responses\nfrom django.core import serializers\nimport json\nimport random\nimport string\nimport csv\n\n# Create your views here.\ndef index(request):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse('login'))\n    forms = Form.objects.filter(creator = request.user)\n    return render(request, \"index/index.html\", {\n        \"forms\": forms\n    })\n\ndef login_view(request):\n    #Check if the user is logged in\n    if request.user.is_authenticated:\n        return HttpResponseRedirect(reverse('index'))\n    if request.method == \"POST\":\n        username = request.POST[\"username\"].lower()\n        password = request.POST[\"password\"]\n        user = authenticate(request, username = username, password = password)\n        # if user authentication success\n        if user is not None:\n            login(request, user)\n            return HttpResponseRedirect(reverse('index'))\n        else:\n            return render(request, \"index/login.html\", {\n                \"message\": \"Invalid username and/or password\"\n            })\n    return render(request, \"index/login.html\")\n\ndef register(request):\n    #Check if the user is logged in\n    if request.user.is_authenticated:\n        return HttpResponseRedirect(reverse('index'))\n    if request.method == \"POST\":\n        username = request.POST[\"username\"].lower()\n        password = request.POST[\"password\"]\n        email = request.POST[\"email\"]\n        confirmation = request.POST[\"confirmation\"]\n        #check if the password is the same as confirmation\n        if password != confirmation:\n            return render(request, \"index/register.html\", {\n                \"message\": \"Passwords must match.\"\n            })\n        #Checks if the username is already in use\n        if User.objects.filter(email = email).count() == 1:\n            return render(request, \"index/register.html\", {\n                \"message\": \"Email already taken.\"\n            })\n        try:\n            user = User.objects.create_user(username = username, password = password, email = email)\n            user.save()\n            login(request, user)\n            return HttpResponseRedirect(reverse('index'))\n        except IntegrityError:\n            return render(request, \"index/register.html\", {\n                \"message\": \"Username already taken\"\n            })\n    return render(request, \"index/register.html\")\n\n\ndef logout_view(request):\n    #Logout the user\n    logout(request)\n    return HttpResponseRedirect(reverse('index'))\n\ndef create_form(request):\n    # Creator must be authenticated\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    # Create a blank form API\n    if request.method == \"POST\":\n        data = json.loads(request.body)\n        title = data[\"title\"]\n        code = ''.join(random.choice(string.ascii_letters + string.digits) for x in range(30))\n        choices = Choices(choice = \"Option 1\")\n        choices.save()\n        question = Questions(question_type = \"multiple choice\", question= \"Untitled Question\", required= False)\n        question.save()\n        question.choices.add(choices)\n        question.save()\n        form = Form(code = code, title = title, creator=request.user)\n        form.save()\n        form.questions.add(question)\n        form.save()\n        return JsonResponse({\"message\": \"Sucess\", \"code\": code})\n\ndef edit_form(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse(\"404\"))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    return render(request, \"index/form.html\", {\n        \"code\": code,\n        \"form\": formInfo\n    })\n\ndef edit_title(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse(\"404\"))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if request.method == \"POST\":\n        data = json.loads(request.body)\n        if len(data[\"title\"]) > 0:\n            formInfo.title = data[\"title\"]\n            formInfo.save()\n        else:\n            formInfo.title = formInfo.title[0]\n            formInfo.save()\n        return JsonResponse({\"message\": \"Success\", \"title\": formInfo.title})\n\ndef edit_description(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse(\"404\"))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if request.method == \"POST\":\n        data = json.loads(request.body)\n        formInfo.description = data[\"description\"]\n        formInfo.save()\n        return JsonResponse({\"message\": \"Success\", \"description\": formInfo.description})\n\ndef edit_bg_color(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse(\"404\"))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if request.method == \"POST\":\n        data = json.loads(request.body)\n        formInfo.background_color = data[\"bgColor\"]\n        formInfo.save()\n        return JsonResponse({\"message\": \"Success\", \"bgColor\": formInfo.background_color})\n\ndef edit_text_color(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse(\"404\"))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if request.method == \"POST\":\n        data = json.loads(request.body)\n        formInfo.text_color = data[\"textColor\"]\n        formInfo.save()\n        return JsonResponse({\"message\": \"Success\", \"textColor\": formInfo.text_color})\n\ndef edit_setting(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse(\"404\"))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if request.method == \"POST\":\n        data = json.loads(request.body)\n        formInfo.collect_email = data[\"collect_email\"]\n        formInfo.is_quiz = data[\"is_quiz\"]\n        formInfo.authenticated_responder = data[\"authenticated_responder\"]\n        formInfo.confirmation_message = data[\"confirmation_message\"]\n        formInfo.edit_after_submit = data[\"edit_after_submit\"]\n        formInfo.allow_view_score = data[\"allow_view_score\"]\n        formInfo.save()\n        return JsonResponse({'message': \"Success\"})\n\ndef delete_form(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse(\"404\"))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if request.method == \"DELETE\":\n        #Delete all questions and choices\n        for i in formInfo.questions.all():\n            for j in i.choices.all():\n                j.delete()\n            i.delete()\n        for i in Responses.objects.filter(response_to = formInfo):\n            for j in i.response.all():\n                j.delete()\n            i.delete()\n        formInfo.delete()\n        return JsonResponse({'message': \"Success\"})\n\ndef edit_question(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if request.method == \"POST\":\n        data = json.loads(request.body)\n        question_id = data[\"id\"]\n        question = Questions.objects.filter(id = question_id)\n        if question.count() == 0:\n            return HttpResponseRedirect(reverse(\"404\"))\n        else: question = question[0]\n        question.question = data[\"question\"]\n        question.question_type = data[\"question_type\"]\n        question.required = data[\"required\"]\n        if(data.get(\"score\")): question.score = data[\"score\"]\n        if(data.get(\"answer_key\")): question.answer_key = data[\"answer_key\"]\n        question.save()\n        return JsonResponse({'message': \"Success\"})\n\ndef edit_choice(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if request.method == \"POST\":\n        data = json.loads(request.body)\n        choice_id = data[\"id\"]\n        choice = Choices.objects.filter(id = choice_id)\n        if choice.count() == 0:\n            return HttpResponseRedirect(reverse(\"404\"))\n        else: choice = choice[0]\n        choice.choice = data[\"choice\"]\n        if(data.get('is_answer')): choice.is_answer = data[\"is_answer\"]\n        choice.save()\n        return JsonResponse({'message': \"Success\"})\n\ndef add_choice(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if request.method == \"POST\":\n        data = json.loads(request.body)\n        choice = Choices(choice=\"Option\")\n        choice.save()\n        formInfo.questions.get(pk = data[\"question\"]).choices.add(choice)\n        formInfo.save()\n        return JsonResponse({\"message\": \"Success\", \"choice\": choice.choice, \"id\": choice.id})\n\ndef remove_choice(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if request.method == \"POST\":\n        data = json.loads(request.body)\n        choice = Choices.objects.filter(pk = data[\"id\"])\n        if choice.count() == 0:\n            return HttpResponseRedirect(reverse(\"404\"))\n        else: choice = choice[0]\n        choice.delete()\n        return JsonResponse({\"message\": \"Success\"})\n\ndef get_choice(request, code, question):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if request.method == \"GET\":\n        question = Questions.objects.filter(id = question)\n        if question.count() == 0: return HttpResponseRedirect(reverse('404'))\n        else: question = question[0]\n        choices = question.choices.all()\n        choices = [{\"choice\":i.choice, \"is_answer\":i.is_answer, \"id\": i.id} for i in choices]\n        return JsonResponse({\"choices\": choices, \"question\": question.question, \"question_type\": question.question_type, \"question_id\": question.id})\n\ndef add_question(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if request.method == \"POST\":\n        choices = Choices(choice = \"Option 1\")\n        choices.save()\n        question = Questions(question_type = \"multiple choice\", question= \"Untitled Question\", required= False)\n        question.save()\n        question.choices.add(choices)\n        question.save()\n        formInfo.questions.add(question)\n        formInfo.save()\n        return JsonResponse({'question': {'question': \"Untitled Question\", \"question_type\": \"multiple choice\", \"required\": False, \"id\": question.id}, \n        \"choices\": {\"choice\": \"Option 1\", \"is_answer\": False, 'id': choices.id}})\n\ndef delete_question(request, code, question):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if request.method == \"DELETE\":\n        question = Questions.objects.filter(id = question)\n        if question.count() == 0: return HttpResponseRedirect(reverse(\"404\"))\n        else: question = question[0]\n        for i in question.choices.all():\n            i.delete()\n            question.delete()\n        return JsonResponse({\"message\": \"Success\"})\n\ndef score(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if not formInfo.is_quiz:\n        return HttpResponseRedirect(reverse(\"edit_form\", args = [code]))\n    else:\n        return render(request, \"index/score.html\", {\n            \"form\": formInfo\n        })\n\ndef edit_score(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if not formInfo.is_quiz:\n        return HttpResponseRedirect(reverse(\"edit_form\", args = [code]))\n    else:\n        if request.method == \"POST\":\n            data = json.loads(request.body)\n            question_id = data[\"question_id\"]\n            question = formInfo.questions.filter(id = question_id)\n            if question.count() == 0:\n                return HttpResponseRedirect(reverse(\"edit_form\", args = [code]))\n            else: question = question[0]\n            score = data[\"score\"]\n            if score == \"\": score = 0\n            question.score = score\n            question.save()\n            return JsonResponse({\"message\": \"Success\"})\n\ndef answer_key(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if not formInfo.is_quiz:\n        return HttpResponseRedirect(reverse(\"edit_form\", args = [code]))\n    else:\n        if request.method == \"POST\":\n            data = json.loads(request.body)\n            question = Questions.objects.filter(id = data[\"question_id\"])\n            if question.count() == 0: return HttpResponseRedirect(reverse(\"edit_form\", args = [code]))\n            else: question = question[0]\n            if question.question_type == \"short\" or question.question_type == \"paragraph\":\n                question.answer_key = data[\"answer_key\"]\n                question.save()\n            else:\n                for i in question.choices.all():\n                    i.is_answer = False\n                    i.save()\n                if question.question_type == \"multiple choice\":\n                    choice = question.choices.get(pk = data[\"answer_key\"])\n                    choice.is_answer = True\n                    choice.save()\n                else:\n                    for i in data[\"answer_key\"]:\n                        choice = question.choices.get(id = i)\n                        choice.is_answer = True\n                        choice.save()\n                question.save()\n            return JsonResponse({'message': \"Success\"})\n\ndef feedback(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if not formInfo.is_quiz:\n        return HttpResponseRedirect(reverse(\"edit_form\", args = [code]))\n    else:\n        if request.method == \"POST\":\n            data = json.loads(request.body)\n            question = formInfo.questions.get(id = data[\"question_id\"])\n            question.feedback = data[\"feedback\"]\n            question.save()\n            return JsonResponse({'message': \"Success\"})\n\ndef view_form(request, code):\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    if formInfo.authenticated_responder:\n        if not request.user.is_authenticated:\n            return HttpResponseRedirect(reverse(\"login\"))\n    return render(request, \"index/view_form.html\", {\n        \"form\": formInfo\n    })\n\ndef get_client_ip(request):\n    x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')\n    if x_forwarded_for:\n        ip = x_forwarded_for.split(',')[0]\n    else:\n        ip = request.META.get('REMOTE_ADDR')\n    return ip\n\ndef submit_form(request, code):\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    if formInfo.authenticated_responder:\n        if not request.user.is_authenticated:\n            return HttpResponseRedirect(reverse(\"login\"))\n    if request.method == \"POST\":\n        code = ''.join(random.choice(string.ascii_letters + string.digits) for x in range(20))\n        if formInfo.authenticated_responder:\n            response = Responses(response_code = code, response_to = formInfo, responder_ip = get_client_ip(request), responder = request.user)\n            response.save()\n        else:\n            if not formInfo.collect_email:\n                response = Responses(response_code = code, response_to = formInfo, responder_ip = get_client_ip(request))\n                response.save()\n            else:\n                response = Responses(response_code = code, response_to = formInfo, responder_ip = get_client_ip(request), responder_email=request.POST[\"email-address\"])\n                response.save()\n        for i in request.POST:\n            #Excluding csrf token\n            if i == \"csrfmiddlewaretoken\" or i == \"email-address\":\n                continue\n            question = formInfo.questions.get(id = i)\n            for j in request.POST.getlist(i):\n                answer = Answer(answer=j, answer_to = question)\n                answer.save()\n                response.response.add(answer)\n                response.save()\n        return render(request, \"index/form_response.html\", {\n            \"form\": formInfo,\n            \"code\": code\n        })\n\ndef responses(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n\n    responsesSummary = []\n    choiceAnswered = {}\n    filteredResponsesSummary = {}\n    for question in formInfo.questions.all():\n        answers = Answer.objects.filter(answer_to = question.id)\n        if question.question_type == \"multiple choice\" or question.question_type == \"checkbox\":\n            choiceAnswered[question.question] = choiceAnswered.get(question.question, {})\n            for answer in answers:\n                choice = answer.answer_to.choices.get(id = answer.answer).choice\n                choiceAnswered[question.question][choice] = choiceAnswered.get(question.question, {}).get(choice, 0) + 1\n        responsesSummary.append({\"question\": question, \"answers\":answers })\n    for answr in choiceAnswered:\n        filteredResponsesSummary[answr] = {}\n        keys = choiceAnswered[answr].values()\n        for choice in choiceAnswered[answr]:\n            filteredResponsesSummary[answr][choice] = choiceAnswered[answr][choice]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    return render(request, \"index/responses.html\", {\n        \"form\": formInfo,\n        \"responses\": Responses.objects.filter(response_to = formInfo),\n        \"responsesSummary\": responsesSummary,\n        \"filteredResponsesSummary\": filteredResponsesSummary\n    })\n\ndef retrieve_checkbox_choices(response, question):\n    checkbox_answers = []\n\n    answers = Answer.objects.filter(answer_to=question, response=response)\n    for answer in answers:\n        selected_choice_ids = answer.answer.split(',')  # Split the string into individual choice IDs\n        selected_choices = Choices.objects.filter(pk__in=selected_choice_ids)\n        checkbox_answers.append([choice.choice for choice in selected_choices])\n\n    return checkbox_answers\n\n\n\ndef exportcsv(request,code):\n    formInfo = Form.objects.filter(code = code)\n    formInfo = formInfo[0]\n    responses=Responses.objects.filter(response_to = formInfo)\n    questions = formInfo.questions.all()\n\n\n    http_response = HttpResponse()\n    http_response['Content-Disposition'] = f'attachment; filename= {formInfo.title}.csv'\n    writer = csv.writer(http_response)\n    header = ['Response Code', 'Responder', 'Responder Email','Responder_ip']\n    \n    for question in questions:\n        header.append(question.question)\n    \n    writer.writerow(header)\n\n    for response in responses:\n        response_data = [\n        response.response_code,\n        response.responder.username if response.responder else 'Anonymous',\n        response.responder_email if response.responder_email else '',\n        response.responder_ip if response.responder_ip else ''\n    ]\n        for question in questions:\n            answer = Answer.objects.filter(answer_to=question, response=response).first()\n            \n        \n            if  question.question_type not in ['multiple choice','checkbox']:\n                response_data.append(answer.answer if answer else '')\n            elif question.question_type == \"multiple choice\":\n                response_data.append(answer.answer_to.choices.get(id = answer.answer).choice if answer else '')\n            elif question.question_type == \"checkbox\":\n                if answer and question.question_type == 'checkbox':\n                    checkbox_choices = retrieve_checkbox_choices(response,answer.answer_to)\n                    response_data.append(checkbox_choices)\n\n        print(response_data)\n        writer.writerow(response_data)\n        \n    return http_response\n\ndef response(request, code, response_code):\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if not formInfo.allow_view_score:\n        if formInfo.creator != request.user:\n            return HttpResponseRedirect(reverse(\"403\"))\n    total_score = 0\n    score = 0\n    responseInfo = Responses.objects.filter(response_code = response_code)\n    if responseInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: responseInfo = responseInfo[0]\n    if formInfo.is_quiz:\n        for i in formInfo.questions.all():\n            total_score += i.score\n        for i in responseInfo.response.all():\n            if i.answer_to.question_type == \"short\" or i.answer_to.question_type == \"paragraph\":\n                if i.answer == i.answer_to.answer_key: score += i.answer_to.score\n            elif i.answer_to.question_type == \"multiple choice\":\n                answerKey = None\n                for j in i.answer_to.choices.all():\n                    if j.is_answer: answerKey = j.id\n                if answerKey is not None and int(answerKey) == int(i.answer):\n                    score += i.answer_to.score\n        _temp = []\n        for i in responseInfo.response.all():\n            if i.answer_to.question_type == \"checkbox\" and i.answer_to.pk not in _temp:\n                answers = []\n                answer_keys = []\n                for j in responseInfo.response.filter(answer_to__pk = i.answer_to.pk):\n                    answers.append(int(j.answer))\n                    for k in j.answer_to.choices.all():\n                        if k.is_answer and k.pk not in answer_keys: answer_keys.append(k.pk)\n                    _temp.append(i.answer_to.pk)\n                if answers == answer_keys: score += i.answer_to.score\n    return render(request, \"index/response.html\", {\n        \"form\": formInfo,\n        \"response\": responseInfo,\n        \"score\": score,\n        \"total_score\": total_score\n    })\n\ndef edit_response(request, code, response_code):\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    response = Responses.objects.filter(response_code = response_code, response_to = formInfo)\n    if response.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: response = response[0]\n    if formInfo.authenticated_responder:\n        if not request.user.is_authenticated:\n            return HttpResponseRedirect(reverse(\"login\"))\n        if response.responder != request.user:\n            return HttpResponseRedirect(reverse('403'))\n    if request.method == \"POST\":\n        if formInfo.authenticated_responder and not response.responder:\n            response.responder = request.user\n            response.save()\n        if formInfo.collect_email:\n            response.responder_email = request.POST[\"email-address\"]\n            response.save()\n        #Deleting all existing answers\n        for i in response.response.all():\n            i.delete()\n        for i in request.POST:\n            #Excluding csrf token and email address\n            if i == \"csrfmiddlewaretoken\" or i == \"email-address\":\n                continue\n            question = formInfo.questions.get(id = i)\n            for j in request.POST.getlist(i):\n                answer = Answer(answer=j, answer_to = question)\n                answer.save()\n                response.response.add(answer)\n                response.save()\n        if formInfo.is_quiz:\n            return HttpResponseRedirect(reverse(\"response\", args = [formInfo.code, response.response_code]))\n        else:\n            return render(request, \"index/form_response.html\", {\n                \"form\": formInfo,\n                \"code\": response.response_code\n            })\n    return render(request, \"index/edit_response.html\", {\n        \"form\": formInfo,\n        \"response\": response\n    })\n\ndef contact_form_template(request):\n    # Creator must be authenticated\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    # Create a blank form API\n    if request.method == \"POST\":\n        code = ''.join(random.choice(string.ascii_letters + string.digits) for x in range(30))\n        name = Questions(question_type = \"short\", question= \"Name\", required= True)\n        name.save()\n        email = Questions(question_type=\"short\", question = \"Email\", required = True)\n        email.save()\n        address = Questions(question_type=\"paragraph\", question=\"Address\", required = True)\n        address.save()\n        phone = Questions(question_type=\"short\", question=\"Phone number\", required = False)\n        phone.save()\n        comments = Questions(question_type = \"paragraph\", question = \"Comments\", required = False)\n        comments.save()\n        form = Form(code = code, title = \"Contact information\", creator=request.user, background_color=\"#e2eee0\", allow_view_score = False, edit_after_submit = True)\n        form.save()\n        form.questions.add(name)\n        form.questions.add(email)\n        form.questions.add(address)\n        form.questions.add(phone)\n        form.questions.add(comments)\n        form.save()\n        return JsonResponse({\"message\": \"Sucess\", \"code\": code})\n\ndef customer_feedback_template(request):\n    # Creator must be authenticated\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    # Create a blank form API\n    if request.method == \"POST\":\n        code = ''.join(random.choice(string.ascii_letters + string.digits) for x in range(30))\n        comment = Choices(choice = \"Comments\")\n        comment.save()\n        question = Choices(choice = \"Questions\")\n        question.save()\n        bug = Choices(choice = \"Bug Reports\")\n        bug.save()\n        feature = Choices(choice = \"Feature Request\")\n        feature.save()\n        feedback_type = Questions(question = \"Feedback Type\", question_type=\"multiple choice\", required=False)\n        feedback_type.save()\n        feedback_type.choices.add(comment)\n        feedback_type.choices.add(bug)\n        feedback_type.choices.add(question)\n        feedback_type.choices.add(feature)\n        feedback_type.save()\n        feedback = Questions(question = \"Feedback\", question_type=\"paragraph\", required=True)\n        feedback.save()\n        suggestion = Questions(question = \"Suggestions for improvement\", question_type=\"paragraph\", required=False)\n        suggestion.save()\n        name = Questions(question = \"Name\", question_type=\"short\", required=False)\n        name.save()\n        email = Questions(question= \"Email\", question_type=\"short\", required=False)\n        email.save()\n        form = Form(code = code, title = \"Customer Feedback\", creator=request.user, background_color=\"#e2eee0\", confirmation_message=\"Thanks so much for giving us feedback!\",\n        description = \"We would love to hear your thoughts or feedback on how we can improve your experience!\", allow_view_score = False, edit_after_submit = True)\n        form.save()\n        form.questions.add(feedback_type)\n        form.questions.add(feedback)\n        form.questions.add(suggestion)\n        form.questions.add(name)\n        form.questions.add(email)\n        return JsonResponse({\"message\": \"Sucess\", \"code\": code})\n\ndef event_registration_template(request):\n    # Creator must be authenticated\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    # Create a blank form API\n    if request.method == \"POST\":\n        code = ''.join(random.choice(string.ascii_letters + string.digits) for x in range(30))\n        name = Questions(question=\"Name\", question_type= \"short\", required=False)\n        name.save()\n        email = Questions(question = \"email\", question_type=\"short\", required=True)\n        email.save()\n        organization = Questions(question = \"Organization\", question_type= \"short\", required=True)\n        organization.save()\n        day1 = Choices(choice=\"Day 1\")\n        day1.save()\n        day2 = Choices(choice= \"Day 2\")\n        day2.save()\n        day3 = Choices(choice= \"Day 3\")\n        day3.save()\n        day = Questions(question=\"What days will you attend?\", question_type=\"checkbox\", required=True)\n        day.save()\n        day.choices.add(day1)\n        day.choices.add(day2)\n        day.choices.add(day3)\n        day.save()\n        dietary_none = Choices(choice=\"None\")\n        dietary_none.save()\n        dietary_vegetarian = Choices(choice=\"Vegetarian\")\n        dietary_vegetarian.save()\n        dietary_kosher = Choices(choice=\"Kosher\")\n        dietary_kosher.save()\n        dietary_gluten = Choices(choice = \"Gluten-free\")\n        dietary_gluten.save()\n        dietary = Questions(question = \"Dietary restrictions\", question_type=\"multiple choice\", required = True)\n        dietary.save()\n        dietary.choices.add(dietary_none)\n        dietary.choices.add(dietary_vegetarian)\n        dietary.choices.add(dietary_gluten)\n        dietary.choices.add(dietary_kosher)\n        dietary.save()\n        accept_agreement = Choices(choice = \"Yes\")\n        accept_agreement.save()\n        agreement = Questions(question = \"I understand that I will have to pay $$ upon arrival\", question_type=\"checkbox\", required=True)\n        agreement.save()\n        agreement.choices.add(accept_agreement)\n        agreement.save()\n        form = Form(code = code, title = \"Event Registration\", creator=request.user, background_color=\"#fdefc3\", \n        confirmation_message=\"We have received your registration.\\n\\\nInsert other information here.\\n\\\n\\n\\\nSave the link below, which can be used to edit your registration up until the registration closing date.\",\n        description = \"Event Timing: January 4th-6th, 2016\\n\\\nEvent Address: 123 Your Street Your City, ST 12345\\n\\\nContact us at (123) 456-7890 or no_reply@example.com\", edit_after_submit=True, allow_view_score=False)\n        form.save()\n        form.questions.add(name)\n        form.questions.add(email)\n        form.questions.add(organization)\n        form.questions.add(day)\n        form.questions.add(dietary)\n        form.questions.add(agreement)\n        form.save()\n        return JsonResponse({\"message\": \"Sucess\", \"code\": code})\n\ndef delete_responses(request, code):\n    if not request.user.is_authenticated:\n        return HttpResponseRedirect(reverse(\"login\"))\n    formInfo = Form.objects.filter(code = code)\n    #Checking if form exists\n    if formInfo.count() == 0:\n        return HttpResponseRedirect(reverse('404'))\n    else: formInfo = formInfo[0]\n    #Checking if form creator is user\n    if formInfo.creator != request.user:\n        return HttpResponseRedirect(reverse(\"403\"))\n    if request.method == \"DELETE\":\n        responses = Responses.objects.filter(response_to = formInfo)\n        for response in responses:\n            for i in response.response.all():\n                i.delete()\n            response.delete()\n        return JsonResponse({\"message\": \"Success\"})\n\n# Error handler\ndef FourZeroThree(request):\n    return render(request, \"error/403.html\")\n\ndef FourZeroFour(request):\n    return render(request, \"error/404.html\")\n"
  },
  {
    "path": "manage.py",
    "content": "#!/usr/bin/env python\n\"\"\"Django's command-line utility for administrative tasks.\"\"\"\nimport os\nimport sys\n\n\ndef main():\n    \"\"\"Run administrative tasks.\"\"\"\n    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'form.settings')\n    try:\n        from django.core.management import execute_from_command_line\n    except ImportError as exc:\n        raise ImportError(\n            \"Couldn't import Django. Are you sure it's installed and \"\n            \"available on your PYTHONPATH environment variable? Did you \"\n            \"forget to activate a virtual environment?\"\n        ) from exc\n    execute_from_command_line(sys.argv)\n\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "renovate.json",
    "content": "{\n  \"extends\": [\n    \"config:base\"\n  ]\n}\n"
  },
  {
    "path": "requirements.txt",
    "content": "asgiref==3.5.1\ndj-database-url==0.5.0\nDjango==4.0.2\ngunicorn==20.1.0\npsycopg2==2.9.3\npytz==2022.1\nsqlparse==0.4.2\nwhitenoise==6.2.0\n"
  }
]