Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Evaluation student #422

Draft
wants to merge 41 commits into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a5dedaa
Added evaluation app
n-hackert Apr 12, 2020
d2547df
Added url mapping to evaluation app
n-hackert Apr 12, 2020
ac4244e
Added Dummy-Model and View
n-hackert Apr 12, 2020
4033577
Added basic(est) permission check to student-evaluation form and eval…
n-hackert Apr 13, 2020
8ac3414
migrations
n-hackert Apr 13, 2020
db52494
Revert changes to scripts and docker-compose
n-hackert Apr 13, 2020
04ef4d4
Merge remote-tracking branch 'upstream/staging' into evaluation_student
n-hackert Apr 13, 2020
71c7f2c
Merge branch 'staging' into evaluation_student
Baschdl Apr 14, 2020
bdf30a2
Merge remote-tracking branch 'upstream/staging' into evaluation_student
n-hackert Apr 17, 2020
8aca609
Removed permission checks for evaluation
n-hackert Apr 17, 2020
f776b39
Removed obsolete migration
n-hackert Apr 17, 2020
ce60729
Added evaluation models for institutions and students
n-hackert Apr 18, 2020
b63318b
shortened URL
n-hackert Apr 18, 2020
6fb782c
Added StudentEvaluationForm
n-hackert Apr 23, 2020
26eafab
Added Completed URL; added Name to URL-Mappings
n-hackert Apr 26, 2020
5e84c47
Small model related fixes
n-hackert Apr 26, 2020
d43cc65
Fixed Form and added Template
n-hackert Apr 26, 2020
cf503e8
Added form to views.py
n-hackert Apr 26, 2020
8699fdf
Added basic "Completed" Template
n-hackert Apr 26, 2020
a261e94
Merge remote-tracking branch 'upstream/staging' into evaluation_student
n-hackert Apr 26, 2020
bfea9be
Improved form layout and redirect
n-hackert Apr 28, 2020
6705100
Improved form layout and redirect
n-hackert Apr 28, 2020
68c8555
Improved Form layout Vol 2
n-hackert Apr 28, 2020
ddd8227
Improved eval model
n-hackert Apr 28, 2020
f9d7ca5
Implemented skeleton for institution eval
n-hackert Apr 28, 2020
2d53737
Migrations
n-hackert Apr 28, 2020
56fe700
Merge branch 'staging' into evaluation_student
Baschdl May 1, 2020
7bf120c
Merge branch 'staging' into evaluation_student
Baschdl May 1, 2020
7b92bf4
Merge branch 'staging' into evaluation_student
Baschdl May 1, 2020
596ebfc
Merge branch 'staging' into evaluation_student
Baschdl May 2, 2020
02d786d
Delete migration because already on staging
Baschdl May 2, 2020
b45f805
Merge branch 'staging' into evaluation_student
Baschdl May 3, 2020
ac77117
Merge remote-tracking branch 'upstream/staging' into evaluation_student
n-hackert May 18, 2020
9fd3f78
Completed form and model for institution eval
n-hackert May 19, 2020
bb1dcb6
Migrations
n-hackert May 19, 2020
444d7b0
Small fixes
n-hackert May 19, 2020
47a2b0b
Added referer check to thank you page
n-hackert May 19, 2020
8c1a133
Added translations
n-hackert May 19, 2020
0b1f532
Merge branch 'staging' into evaluation_student
Baschdl Jul 1, 2020
021fcbb
Fix translations
Baschdl Jul 1, 2020
6530c2c
Format code with pre-commit
Baschdl Jul 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions backend/apps/accounts/migrations/0005_user_has_evaluated.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.0.5 on 2020-04-13 09:41

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('accounts', '0004_custom_migration_timestamps'),
]

operations = [
migrations.AddField(
model_name='user',
name='has_evaluated',
field=models.BooleanField(default=False),
),
]
3 changes: 3 additions & 0 deletions backend/apps/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
from django.db import models
from datetime import datetime


class User(AbstractUser):

is_student = models.BooleanField(default=False)
is_hospital = models.BooleanField(default=False)
has_evaluated = models.BooleanField(default=False)
n-hackert marked this conversation as resolved.
Show resolved Hide resolved
validated_email = models.BooleanField(default=False)
email_validation_date = models.DateTimeField(blank=True, null=True)
REQUIRED_FIELDS = ['email']
Empty file.
3 changes: 3 additions & 0 deletions backend/apps/evaluation/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
5 changes: 5 additions & 0 deletions backend/apps/evaluation/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class EvaluationConfig(AppConfig):
name = 'evaluation'
21 changes: 21 additions & 0 deletions backend/apps/evaluation/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 3.0.5 on 2020-04-13 09:41

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='StudentEvaluation',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in this project we have never used verbose_name before. This usage here is straight-forward, but it could create confusion with the additional translation layer later on and the separate setting of labels in the form class. I'm thinking about whether this is helping or complicating the understanding in other code files.

('test', models.CharField(default='', max_length=50)),
n-hackert marked this conversation as resolved.
Show resolved Hide resolved
],
),
]
Empty file.
5 changes: 5 additions & 0 deletions backend/apps/evaluation/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.db import models


class StudentEvaluation(models.Model):
test = models.CharField(max_length=50, default='')
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends 'base.html' %}
{% load static %}
{% load i18n %}

{% block title %}
Evaluation Studis
n-hackert marked this conversation as resolved.
Show resolved Hide resolved
{% endblock %}

{% block content %}

<form>

{{ form }}

</form>

{% endblock %}
3 changes: 3 additions & 0 deletions backend/apps/evaluation/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
10 changes: 10 additions & 0 deletions backend/apps/evaluation/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from django.urls import path

from . import views

urlpatterns = [
# path for Student-Evaluations
path('student/', views.StudentEvaluationForm.as_view()),
# path for Institution-Evaluations
# path('institution/', views.InstitutionEvaluationForm.as_view()),
]
12 changes: 12 additions & 0 deletions backend/apps/evaluation/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django.views.generic import CreateView
from django.contrib.auth.mixins import UserPassesTestMixin
from . import models


class StudentEvaluationForm(UserPassesTestMixin, CreateView):

def test_func(self):
return self.request.user.is_student and not self.request.user.has_evaluated

model = models.StudentEvaluation
fields = '__all__'
1 change: 1 addition & 0 deletions backend/match4healthcare/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
'apps.ineedstudent',
'apps.accounts',
'apps.use_statistics',
'apps.evaluation'
]

MIDDLEWARE = [
Expand Down
1 change: 1 addition & 0 deletions backend/match4healthcare/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
path('ineedstudent/', include('apps.ineedstudent.urls')),
path('accounts/', include('apps.accounts.urls')),
path('use_statistics/', include('apps.use_statistics.urls')),
path('evaluation/', include('apps.evaluation.urls')),
path('admin/', admin.site.urls),
path('404/', views.handler404),
path('500/', views.handler500),
Expand Down