.
This commit is contained in:
@@ -6,3 +6,4 @@ __pycache__
|
|||||||
rad/settings_local.py
|
rad/settings_local.py
|
||||||
venv
|
venv
|
||||||
.venv/
|
.venv/
|
||||||
|
.env
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 3.2.13 on 2022-05-03 17:48
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('anatomy', '0059_exam_include_history'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='exam',
|
||||||
|
name='authors_only',
|
||||||
|
field=models.BooleanField(default=False, help_text='If true only exam authors will be able to view.'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# Generated by Django 3.2.13 on 2022-05-03 17:48
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
import django.core.validators
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
('atlas', '0043_alter_casecollection_cid_user_groups'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='UserReportAnswer',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('answer', models.TextField(blank=True)),
|
||||||
|
('feedback', models.TextField(blank=True)),
|
||||||
|
('created', models.DateTimeField(auto_now_add=True)),
|
||||||
|
('updated', models.DateTimeField(auto_now=True)),
|
||||||
|
('score', models.IntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(10), django.core.validators.MinValueValidator(0)])),
|
||||||
|
('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='atlas.casedetail')),
|
||||||
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -66,6 +66,16 @@ class Condition(tagulous.models.TagModel):
|
|||||||
class Sign(tagulous.models.TagModel):
|
class Sign(tagulous.models.TagModel):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class QuestionBase(models.Model):
|
||||||
|
|
||||||
|
authors_only = models.BooleanField(
|
||||||
|
help_text="If true only question authors will be able to view.",
|
||||||
|
default=False,
|
||||||
|
)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
abstract = True
|
||||||
|
|
||||||
|
|
||||||
class ExamBase(models.Model):
|
class ExamBase(models.Model):
|
||||||
name = models.CharField(max_length=200, help_text="Name of the exam")
|
name = models.CharField(max_length=200, help_text="Name of the exam")
|
||||||
@@ -108,6 +118,11 @@ class ExamBase(models.Model):
|
|||||||
default=False,
|
default=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
authors_only = models.BooleanField(
|
||||||
|
help_text="If true only exam authors will be able to view.",
|
||||||
|
default=False,
|
||||||
|
)
|
||||||
|
|
||||||
stats_mean = models.FloatField(default=0)
|
stats_mean = models.FloatField(default=0)
|
||||||
stats_mode = models.CharField(default=0, max_length=25)
|
stats_mode = models.CharField(default=0, max_length=25)
|
||||||
stats_median = models.FloatField(default=0)
|
stats_median = models.FloatField(default=0)
|
||||||
|
|||||||
@@ -299,6 +299,9 @@ class ExamViews(View, LoginRequiredMixin):
|
|||||||
if (exam.open_access and exam.active) or user in exam.get_author_objects():
|
if (exam.open_access and exam.active) or user in exam.get_author_objects():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
if exam.authors_only:
|
||||||
|
return False
|
||||||
|
|
||||||
if (
|
if (
|
||||||
self.app_name == "rapids"
|
self.app_name == "rapids"
|
||||||
and not user.groups.filter(name="rapid_checker").exists()
|
and not user.groups.filter(name="rapid_checker").exists()
|
||||||
@@ -350,6 +353,9 @@ class ExamViews(View, LoginRequiredMixin):
|
|||||||
if exam.open_access or user in exam.get_author_objects():
|
if exam.open_access or user in exam.get_author_objects():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
if exam.authors_only:
|
||||||
|
return False
|
||||||
|
|
||||||
if (
|
if (
|
||||||
self.app_name == "rapids"
|
self.app_name == "rapids"
|
||||||
and not user.groups.filter(name="rapid_checker").exists()
|
and not user.groups.filter(name="rapid_checker").exists()
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 3.2.13 on 2022-05-03 17:48
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('longs', '0058_exam_include_history'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='exam',
|
||||||
|
name='authors_only',
|
||||||
|
field=models.BooleanField(default=False, help_text='If true only exam authors will be able to view.'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 3.2.13 on 2022-05-03 17:48
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('physics', '0018_exam_include_history'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='exam',
|
||||||
|
name='authors_only',
|
||||||
|
field=models.BooleanField(default=False, help_text='If true only exam authors will be able to view.'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 3.2.13 on 2022-05-03 17:48
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('rapids', '0050_alter_exam_cid_user_groups'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='exam',
|
||||||
|
name='authors_only',
|
||||||
|
field=models.BooleanField(default=False, help_text='If true only exam authors will be able to view.'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 3.2.13 on 2022-05-03 17:48
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('sbas', '0010_exam_include_history'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='exam',
|
||||||
|
name='authors_only',
|
||||||
|
field=models.BooleanField(default=False, help_text='If true only exam authors will be able to view.'),
|
||||||
|
),
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user