more bootstrap nav convresion
This commit is contained in:
@@ -5,17 +5,40 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block navigation %}
|
{% block navigation %}
|
||||||
Anatomy:
|
|
||||||
{% if request.user.is_authenticated %}
|
<nav class="navbar navbar-expand-lg navbar-dark submenu">
|
||||||
<a href="{% url 'anatomy:index' %}">Packets</a> /
|
<div class="container-fluid">
|
||||||
<a href="{% url 'anatomy:exam_list' %}">Exams</a> /
|
<a class="navbar-brand" href="{% url 'anatomy:index' %}">Anatomy</a>
|
||||||
<a href="{% url 'anatomy:exam_create' %}" title="Create a new exam">Create Exam</a> /
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<a href="{% url 'anatomy:question_list' %}">Questions</a> /
|
<span class="navbar-toggler-icon"></span>
|
||||||
<a href="{% url 'anatomy:anatomy_question_create' %}" title="Create a new question">Create Question</a>
|
</button>
|
||||||
{% if request.user.is_superuser %}
|
<div class="collapse navbar-collapse">
|
||||||
/ <a href="{% url 'anatomy:user_answer_table_view' %}" title="User answers">Answers</a>
|
<ul class="navbar-nav">
|
||||||
{% endif %}
|
{% if request.user.is_authenticated %}
|
||||||
{% endif %}
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'anatomy:exam_list' %}"><i class="bi bi-mortarboard"></i> Exams</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'anatomy:question_view' %}"><i class="bi bi-question-circle"></i> Questions</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false"><i class="bi bi-file-earmark-plus"></i> Create</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a class="dropdown-item" href="{% url 'anatomy:exam_create' %}" title="Create a new exam"><i class="bi bi-mortarboard"></i> Exam</a></li>
|
||||||
|
<li><a class="dropdown-item" href="{% url 'anatomy:question_create' %}" title="Create a new question"><i class="bi bi-question-circle"></i> Question</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
{% if request.user.is_superuser %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'anatomy:user_answer_table_view' %}" title="User answers">Answers</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if simple_content %}
|
{% if simple_content %}
|
||||||
|
|||||||
+3
-8
@@ -7,21 +7,16 @@ from django.views.decorators.cache import cache_page
|
|||||||
app_name = "anatomy"
|
app_name = "anatomy"
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
# path('', views.question_list, name='question_list'),
|
# path('', views.question_view, name='question_view'),
|
||||||
path(
|
path(
|
||||||
"question/",
|
"question/",
|
||||||
views.AnatomyQuestionView.as_view(),
|
views.AnatomyQuestionView.as_view(),
|
||||||
name="question_list",
|
name="question_view",
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
"question/create/",
|
"question/create/",
|
||||||
views.AnatomyQuestionCreate.as_view(),
|
views.AnatomyQuestionCreate.as_view(),
|
||||||
name="anatomy_question_create",
|
name="question_create",
|
||||||
),
|
|
||||||
path(
|
|
||||||
"create/exam/<int:pk>",
|
|
||||||
views.AnatomyQuestionCreate.as_view(),
|
|
||||||
name="anatomy_create_exam",
|
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
"question/<int:pk>/update",
|
"question/<int:pk>/update",
|
||||||
|
|||||||
+3
-3
@@ -109,14 +109,14 @@ def user_is_admin(user):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def question_list(request):
|
def question_view(request):
|
||||||
questions = AnatomyQuestion.objects.all()
|
questions = AnatomyQuestion.objects.all()
|
||||||
|
|
||||||
if not request.user.groups.filter(name="anatomy_checker").exists():
|
if not request.user.groups.filter(name="anatomy_checker").exists():
|
||||||
questions = questions.filter(open_access=False)
|
questions = questions.filter(open_access=False)
|
||||||
# raise PermissionDenied()
|
# raise PermissionDenied()
|
||||||
|
|
||||||
return render(request, "anatomy/question_list.html", {"questions": questions})
|
return render(request, "anatomy/question_view.html", {"questions": questions})
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@@ -794,7 +794,7 @@ class UserAnswerDelete(SuperuserRequiredMixin, DeleteView):
|
|||||||
|
|
||||||
class QuestionDelete(AuthorOrCheckerRequiredMixin, DeleteView):
|
class QuestionDelete(AuthorOrCheckerRequiredMixin, DeleteView):
|
||||||
model = AnatomyQuestion
|
model = AnatomyQuestion
|
||||||
success_url = reverse_lazy("anatomy:question_list")
|
success_url = reverse_lazy("anatomy:question_view")
|
||||||
|
|
||||||
|
|
||||||
class ExamCreate(ExamCreateBase):
|
class ExamCreate(ExamCreateBase):
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ from generic.views import ExamViews as GenericExamViews, GenericViewBase
|
|||||||
app_name = "generic"
|
app_name = "generic"
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
# path('', views.question_list, name='question_list'),
|
|
||||||
path("examination/", views.ExaminationView.as_view(), name="examination_view"),
|
path("examination/", views.ExaminationView.as_view(), name="examination_view"),
|
||||||
path("examination/<int:pk>", views.examination_detail, name="examination_detail"),
|
path("examination/<int:pk>", views.examination_detail, name="examination_detail"),
|
||||||
path(
|
path(
|
||||||
|
|||||||
+1
-1
@@ -417,7 +417,7 @@ class LongCreationDefault(models.Model):
|
|||||||
# help_text="Default site to use when creating a new long")
|
# help_text="Default site to use when creating a new long")
|
||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse("longs:long_create")
|
return reverse("longs:question_create")
|
||||||
|
|
||||||
class ExamQuestionDetail(models.Model):
|
class ExamQuestionDetail(models.Model):
|
||||||
sort_order = models.IntegerField(default=1000)
|
sort_order = models.IntegerField(default=1000)
|
||||||
|
|||||||
@@ -1,33 +1,66 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
Longs
|
Longs
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block css %}
|
{% block css %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block js %}
|
{% block js %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block navigation %}
|
{% block navigation %}
|
||||||
Longs:
|
<nav class="navbar navbar-expand-lg navbar-dark submenu">
|
||||||
{% if request.user.is_authenticated %}
|
<div class="container-fluid">
|
||||||
<a href="{% url 'longs:exam_list' %}">Exams</a> /
|
<a class="navbar-brand" href="{% url 'longs:index' %}">Longs</a>
|
||||||
<a href="{% url 'longs:exam_create' %}" title="Create a new exam">Create Exam</a> /
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<a href="{% url 'longs:long_view' %}">Cases</a> /
|
<span class="navbar-toggler-icon"></span>
|
||||||
<a href="{% url 'longs:long_series_view' %}">Series</a> /
|
</button>
|
||||||
<a href="{% url 'longs:long_create' %}" title="Create a new long case">Create Case</a> /
|
<div class="collapse navbar-collapse">
|
||||||
<a href="{% url 'longs:long_series_create' %}" title="Create a new image series">Create Series</a>
|
<ul class="navbar-nav">
|
||||||
{% endif %}
|
{% if request.user.is_authenticated %}
|
||||||
{% if request.user.is_superuser %}
|
<li class="nav-item">
|
||||||
/ <a href="{% url 'longs:user_answer_table_view' %}" title="User answers">Answers</a>
|
<a class="nav-link" href="{% url 'longs:exam_list' %}"><i class="bi bi-mortarboard"></i> Exams</a>
|
||||||
{% endif %}
|
</li>
|
||||||
{% comment %} </br>
|
<li class="nav-item">
|
||||||
Questions by:
|
<a class="nav-link" href="{% url 'longs:question_view' %}"><i class="bi bi-question-circle"></i> Questions</a>
|
||||||
<span id="authors-link"><a href="{% url 'longs:author_list' %}">author</a></span> {% endcomment %}
|
</li>
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false"><i class="bi bi-file-earmark-plus"></i> Create</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a class="dropdown-item" href="{% url 'longs:exam_create' %}" title="Create a new exam"><i class="bi bi-mortarboard"></i> Exam</a></li>
|
||||||
|
<li><a class="dropdown-item" href="{% url 'longs:question_create' %}" title="Create a new question"><i class="bi bi-question-circle"></i> Question</a></li>
|
||||||
|
<li><a class="dropdown-item" href="{% url 'longs:series_create' %}" title="Create a new image series">Create Series</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
{% if request.user.is_superuser %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'longs:user_answer_table_view' %}" title="User answers">Answers</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
Longs:
|
||||||
|
{% if request.user.is_authenticated %}
|
||||||
|
<a href="{% url 'longs:exam_list' %}">Exams</a> /
|
||||||
|
<a href="{% url 'longs:exam_create' %}" title="Create a new exam">Create Exam</a> /
|
||||||
|
<a href="{% url 'longs:question_view' %}">Cases</a> /
|
||||||
|
<a href="{% url 'longs:series_view' %}">Series</a> /
|
||||||
|
<a href="{% url 'longs:question_create' %}" title="Create a new long case">Create Case</a> /
|
||||||
|
{% endif %}
|
||||||
|
{% if request.user.is_superuser %}
|
||||||
|
/ <a href="{% url 'longs:user_answer_table_view' %}" title="User answers">Answers</a>
|
||||||
|
{% endif %}
|
||||||
|
{% comment %} </br>
|
||||||
|
Questions by:
|
||||||
|
<span id="authors-link"><a href="{% url 'longs:author_list' %}">author</a></span> {% endcomment %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -318,7 +318,6 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Series Form</h2>
|
<h2>Series Form</h2>
|
||||||
<!-- <a href="{% url 'longs:long_create_defaults' %}">Edit defaults</a> -->
|
|
||||||
This form will create a image set that can be associated with a long question. If the question has already been created it can be linked below.
|
This form will create a image set that can be associated with a long question. If the question has already been created it can be linked below.
|
||||||
<form action="" method="post" enctype="multipart/form-data" id="long-form">
|
<form action="" method="post" enctype="multipart/form-data" id="long-form">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|||||||
+4
-10
@@ -6,11 +6,10 @@ from . import views
|
|||||||
app_name = "longs"
|
app_name = "longs"
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
# path('', views.question_list, name='question_list'),
|
|
||||||
path("author/<int:pk>/", views.author_detail, name="author_detail"),
|
path("author/<int:pk>/", views.author_detail, name="author_detail"),
|
||||||
path("author/", views.author_list, name="author_list"),
|
path("author/", views.author_list, name="author_list"),
|
||||||
path("question/", views.LongView.as_view(), name="long_view"),
|
path("question/", views.LongView.as_view(), name="question_view"),
|
||||||
path("series/", views.LongSeriesView.as_view(), name="long_series_view"),
|
path("series/", views.LongSeriesView.as_view(), name="series_view"),
|
||||||
path("series/<int:pk>", views.series_detail, name="series_detail"),
|
path("series/<int:pk>", views.series_detail, name="series_detail"),
|
||||||
path(
|
path(
|
||||||
"series/<int:pk>/order_dicom",
|
"series/<int:pk>/order_dicom",
|
||||||
@@ -100,18 +99,13 @@ urlpatterns = [
|
|||||||
path("exam/<int:exam_id>/clone", views.ExamClone.as_view(), name="exam_clone"),
|
path("exam/<int:exam_id>/clone", views.ExamClone.as_view(), name="exam_clone"),
|
||||||
path("exam/<int:pk>/update", views.ExamUpdate.as_view(), name="exam_update"),
|
path("exam/<int:pk>/update", views.ExamUpdate.as_view(), name="exam_update"),
|
||||||
path("exam/<int:pk>/delete", views.ExamDelete.as_view(), name="exam_delete"),
|
path("exam/<int:pk>/delete", views.ExamDelete.as_view(), name="exam_delete"),
|
||||||
path("create/", views.LongCreate.as_view(), name="long_create"),
|
path("create/", views.LongCreate.as_view(), name="question_create"),
|
||||||
path("create/series", views.LongSeriesCreate.as_view(), name="long_series_create"),
|
path("create/series", views.LongSeriesCreate.as_view(), name="series_create"),
|
||||||
path(
|
path(
|
||||||
"create/series/<int:pk>",
|
"create/series/<int:pk>",
|
||||||
views.LongSeriesCreate.as_view(),
|
views.LongSeriesCreate.as_view(),
|
||||||
name="long_series_id_create",
|
name="long_series_id_create",
|
||||||
),
|
),
|
||||||
path(
|
|
||||||
"create/defaults",
|
|
||||||
views.LongCreationDefaultView.as_view(),
|
|
||||||
name="long_create_defaults",
|
|
||||||
),
|
|
||||||
# path("region/create/", views.create_region, name="create_region"),
|
# path("region/create/", views.create_region, name="create_region"),
|
||||||
# path("region/ajax/get_region_id", views.get_region_id, name="get_region_id"),
|
# path("region/ajax/get_region_id", views.get_region_id, name="get_region_id"),
|
||||||
# path("abnormality/create/", views.create_abnormality, name="create_abnormality"),
|
# path("abnormality/create/", views.create_abnormality, name="create_abnormality"),
|
||||||
|
|||||||
+2
-2
@@ -273,12 +273,12 @@ class LongCreationDefaultView(LoginRequiredMixin, UpdateView):
|
|||||||
|
|
||||||
class LongDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
|
class LongDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
|
||||||
model = Long
|
model = Long
|
||||||
success_url = reverse_lazy("longs:long_view")
|
success_url = reverse_lazy("longs:question_view")
|
||||||
|
|
||||||
|
|
||||||
class LongSeriesDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
|
class LongSeriesDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
|
||||||
model = LongSeries
|
model = LongSeries
|
||||||
success_url = reverse_lazy("longs:long_series_view")
|
success_url = reverse_lazy("longs:series_view")
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
|||||||
@@ -1,18 +1,43 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
Physics
|
Physics
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block navigation %}
|
{% block navigation %}
|
||||||
Physics:
|
<nav class="navbar navbar-expand-lg navbar-dark submenu">
|
||||||
{% if request.user.is_authenticated %}
|
<div class="container-fluid">
|
||||||
<a href="{% url 'physics:exam_list' %}">Exams</a> /
|
<a class="navbar-brand" href="{% url 'physics:index' %}">Physics</a>
|
||||||
<a href="{% url 'physics:question_view' %}">Questions</a>
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
{% if request.user.is_superuser %}
|
<span class="navbar-toggler-icon"></span>
|
||||||
/ <a href="{% url 'physics:user_answer_table_view' %}" title="User answers">Answers</a>
|
</button>
|
||||||
{% endif %}
|
<div class="collapse navbar-collapse">
|
||||||
{% endif %}
|
<ul class="navbar-nav">
|
||||||
|
{% if request.user.is_authenticated %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'physics:exam_list' %}"><i class="bi bi-mortarboard"></i> Exams</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'physics:question_view' %}"><i class="bi bi-question-circle"></i> Questions</a>
|
||||||
|
</li>
|
||||||
|
{% comment %} <li class="nav-item dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false"><i class="bi bi-file-earmark-plus"></i> Create</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a class="dropdown-item" href="{% url 'physics:exam_create' %}" title="Create a new exam"><i class="bi bi-mortarboard"></i> Exam</a></li>
|
||||||
|
<li><a class="dropdown-item" href="{% url 'physics:question_create' %}" title="Create a new question"><i class="bi bi-question-circle"></i> Question</a></li>
|
||||||
|
</ul>
|
||||||
|
</li> {% endcomment %}
|
||||||
|
|
||||||
|
{% if request.user.is_superuser %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'physics:user_answer_table_view' %}" title="User answers">Answers</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
-19
@@ -31,30 +31,12 @@ from longs import views as long_views
|
|||||||
|
|
||||||
from generic import views as generic_views
|
from generic import views as generic_views
|
||||||
|
|
||||||
from rest_framework import routers
|
|
||||||
|
|
||||||
from django.conf.urls import handler400, handler403, handler404, handler500
|
from django.conf.urls import handler400, handler403, handler404, handler500
|
||||||
|
|
||||||
from .api import api
|
from .api import api
|
||||||
from autocomplete import HTMXAutoComplete
|
from autocomplete import HTMXAutoComplete
|
||||||
|
|
||||||
|
|
||||||
router_drf = routers.DefaultRouter()
|
|
||||||
#router_drf.register(r"rapids/exams", rapid_views.ExamViewSet, basename="rapid-exam")
|
|
||||||
#router_drf.register(r"anatomy/exams", anatomy_views.ExamViewSet, basename="anatomy-exam")
|
|
||||||
#router_drf.register(r"longs/exams", long_views.ExamViewSet, basename="long-exam")
|
|
||||||
#router_drf.register(
|
|
||||||
# r"rapids/answers",
|
|
||||||
# rapid_views.QuestionAnswerViewSet,
|
|
||||||
# basename="rapid-question-answers",
|
|
||||||
#)
|
|
||||||
#router_drf.register(
|
|
||||||
# r"rapids/user_answer",
|
|
||||||
# rapid_views.UserAnswerViewSet,
|
|
||||||
# basename="rapid-question-answers",
|
|
||||||
#)
|
|
||||||
#router_drf.register(r"rapids", rapid_views.RapidViewSet, basename="rapid")
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("admin/", admin.site.urls, name="admin"),
|
path("admin/", admin.site.urls, name="admin"),
|
||||||
path("api/", api.urls),
|
path("api/", api.urls),
|
||||||
@@ -164,7 +146,6 @@ urlpatterns = [
|
|||||||
name="answer_suggestion_confirm",
|
name="answer_suggestion_confirm",
|
||||||
),
|
),
|
||||||
path("feedback/view", views.view_feedback, name="view_feedback"),
|
path("feedback/view", views.view_feedback, name="view_feedback"),
|
||||||
#path("api/", include(router_drf.urls)),
|
|
||||||
#path("api-auth/", include("rest_framework.urls")),
|
#path("api-auth/", include("rest_framework.urls")),
|
||||||
path("tinymce/", include("tinymce.urls")),
|
path("tinymce/", include("tinymce.urls")),
|
||||||
path("cookies/", include("cookie_consent.urls")),
|
path("cookies/", include("cookie_consent.urls")),
|
||||||
|
|||||||
+1
-1
@@ -605,7 +605,7 @@ class RapidCreationDefault(models.Model):
|
|||||||
# help_text="Default site to use when creating a new rapid")
|
# help_text="Default site to use when creating a new rapid")
|
||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse("rapids:rapid_create")
|
return reverse("rapids:question_create")
|
||||||
|
|
||||||
class ExamQuestionDetail(models.Model):
|
class ExamQuestionDetail(models.Model):
|
||||||
exam = models.ForeignKey("Exam", on_delete=models.CASCADE)
|
exam = models.ForeignKey("Exam", on_delete=models.CASCADE)
|
||||||
|
|||||||
@@ -18,17 +18,39 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block navigation %}
|
{% block navigation %}
|
||||||
Rapids:
|
<nav class="navbar navbar-expand-lg navbar-dark submenu">
|
||||||
{% if request.user.is_authenticated %}
|
<div class="container-fluid">
|
||||||
<a href="{% url 'rapids:index' %}">Packets</a> /
|
<a class="navbar-brand" href="{% url 'rapids:index' %}">Rapids</a>
|
||||||
<a href="{% url 'rapids:exam_list' %}">Exams</a> /
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<a href="{% url 'rapids:exam_create' %}" title="Create a new exam">Create Exam</a> /
|
<span class="navbar-toggler-icon"></span>
|
||||||
<a href="{% url 'rapids:rapid_view' %}">Questions</a> /
|
</button>
|
||||||
<a href="{% url 'rapids:rapid_create' %}" title="Create a new question">Create Question</a>
|
<div class="collapse navbar-collapse">
|
||||||
{% endif %}
|
<ul class="navbar-nav">
|
||||||
{% if request.user.is_superuser %}
|
{% if request.user.is_authenticated %}
|
||||||
/ <a href="{% url 'rapids:user_answer_table_view' %}" title="User answers">Answers</a>
|
<li class="nav-item">
|
||||||
{% endif %}
|
<a class="nav-link" href="{% url 'rapids:exam_list' %}"><i class="bi bi-mortarboard"></i> Exams</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'rapids:question_view' %}"><i class="bi bi-question-circle"></i> Questions</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false"><i class="bi bi-file-earmark-plus"></i> Create</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a class="dropdown-item" href="{% url 'rapids:exam_create' %}" title="Create a new exam"><i class="bi bi-mortarboard"></i> Exam</a></li>
|
||||||
|
<li><a class="dropdown-item" href="{% url 'rapids:question_create' %}" title="Create a new question"><i class="bi bi-question-circle"></i> Question</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
{% if request.user.is_superuser %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'rapids:user_answer_table_view' %}" title="User answers">Answers</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
{% comment %} </br>
|
{% comment %} </br>
|
||||||
Questions by:
|
Questions by:
|
||||||
<span id="authors-link"><a href="{% url 'rapids:author_list' %}">author</a></span> {% endcomment %}
|
<span id="authors-link"><a href="{% url 'rapids:author_list' %}">author</a></span> {% endcomment %}
|
||||||
|
|||||||
@@ -11,5 +11,5 @@
|
|||||||
<a href="{% url 'rapids:exam_cids' exam_id=exam.pk %}">Candidates</a> /
|
<a href="{% url 'rapids:exam_cids' exam_id=exam.pk %}">Candidates</a> /
|
||||||
<a href="{% url 'rapids:exam_stats' exam_id=exam.pk %}">Stats</a> /
|
<a href="{% url 'rapids:exam_stats' exam_id=exam.pk %}">Stats</a> /
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="{% url 'rapids:rapid_create_exam' pk=exam.pk %}">Add New Question</a>
|
<a href="{% url 'rapids:question_create_exam' pk=exam.pk %}">Add New Question</a>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -319,7 +319,6 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<h2>Submit Rapid</h2>
|
<h2>Submit Rapid</h2>
|
||||||
{% comment %} <a href="{% url 'rapids:rapid_create_defaults' %}">Edit defaults</a> {% endcomment %}
|
|
||||||
<p>
|
<p>
|
||||||
<h3>Instructions</h3>
|
<h3>Instructions</h3>
|
||||||
Abnormality, Region and Laterality are used to categorise within the system (they are not used for marking). String
|
Abnormality, Region and Laterality are used to categorise within the system (they are not used for marking). String
|
||||||
|
|||||||
+3
-9
@@ -11,11 +11,10 @@ app_name = "rapids"
|
|||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
# path('', views.question_list, name='question_list'),
|
|
||||||
#path("", views.GenericExamViews.index, name="index"),
|
#path("", views.GenericExamViews.index, name="index"),
|
||||||
#path("exam", generic_exam_urls(views.GenericExamViews), name="index"),
|
#path("exam", generic_exam_urls(views.GenericExamViews), name="index"),
|
||||||
path("question_viewer", views.question_viewer, name="question_viewer"),
|
path("question_viewer", views.question_viewer, name="question_viewer"),
|
||||||
path("question/", views.RapidView.as_view(), name="rapid_view"),
|
path("question/", views.RapidView.as_view(), name="question_view"),
|
||||||
path("question/hash", views.get_question_by_hash, name="rapid_question_by_hash"),
|
path("question/hash", views.get_question_by_hash, name="rapid_question_by_hash"),
|
||||||
# path("unchecked/", views.unchecked_list, name="unchecked_list"),
|
# path("unchecked/", views.unchecked_list, name="unchecked_list"),
|
||||||
# path("verified/<int:pk>/", views.verified_detail, name="verified_detail"),
|
# path("verified/<int:pk>/", views.verified_detail, name="verified_detail"),
|
||||||
@@ -64,13 +63,8 @@ urlpatterns = [
|
|||||||
path("exam/<int:exam_id>/clone", views.ExamClone.as_view(), name="exam_clone"),
|
path("exam/<int:exam_id>/clone", views.ExamClone.as_view(), name="exam_clone"),
|
||||||
path("exam/<int:pk>/update", views.ExamUpdate.as_view(), name="exam_update"),
|
path("exam/<int:pk>/update", views.ExamUpdate.as_view(), name="exam_update"),
|
||||||
path("exam/<int:pk>/delete", views.ExamDelete.as_view(), name="exam_delete"),
|
path("exam/<int:pk>/delete", views.ExamDelete.as_view(), name="exam_delete"),
|
||||||
path("create/", views.RapidCreate.as_view(), name="rapid_create"),
|
path("create/", views.RapidCreate.as_view(), name="question_create"),
|
||||||
path("create/exam/<int:pk>", views.RapidCreate.as_view(), name="rapid_create_exam"),
|
path("create/exam/<int:pk>", views.RapidCreate.as_view(), name="question_create_exam"),
|
||||||
path(
|
|
||||||
"create/defaults",
|
|
||||||
views.RapidCreationDefaultView.as_view(),
|
|
||||||
name="rapid_create_defaults",
|
|
||||||
),
|
|
||||||
path("region/create/", views.create_region, name="create_region"),
|
path("region/create/", views.create_region, name="create_region"),
|
||||||
path("region/ajax/get_region_id", views.get_region_id, name="get_region_id"),
|
path("region/ajax/get_region_id", views.get_region_id, name="get_region_id"),
|
||||||
path("abnormality/create/", views.create_abnormality, name="create_abnormality"),
|
path("abnormality/create/", views.create_abnormality, name="create_abnormality"),
|
||||||
|
|||||||
+1
-1
@@ -733,7 +733,7 @@ def mark(request, exam_pk, sk, unmarked_exam_answers_only=True, review=False):
|
|||||||
|
|
||||||
class QuestionDelete(AuthorOrCheckerRequiredMixin, DeleteView):
|
class QuestionDelete(AuthorOrCheckerRequiredMixin, DeleteView):
|
||||||
model = Rapid
|
model = Rapid
|
||||||
success_url = reverse_lazy("rapids:rapid_view")
|
success_url = reverse_lazy("rapids:question_view")
|
||||||
|
|
||||||
|
|
||||||
GenericExamViews = ExamViews(
|
GenericExamViews = ExamViews(
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ pydicom
|
|||||||
django-dbbackup
|
django-dbbackup
|
||||||
#django-hashedfilenamestorage
|
#django-hashedfilenamestorage
|
||||||
git+https://github.com/allysonbarros/django-hashedfilenamestorage#egg=django-hashedfilenamestorage
|
git+https://github.com/allysonbarros/django-hashedfilenamestorage#egg=django-hashedfilenamestorage
|
||||||
djangorestframework
|
|
||||||
django-tinymce
|
django-tinymce
|
||||||
django-zipview
|
django-zipview
|
||||||
pymemcache
|
pymemcache
|
||||||
|
|||||||
+4
-4
@@ -80,9 +80,9 @@ class AuthorOrCheckerRequiredMixin(object):
|
|||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
|
||||||
def question_list(request):
|
# def question_view(request):
|
||||||
questions = Question.objects.all()
|
# questions = Question.objects.all()
|
||||||
return render(request, "sbas/question_list.html", {"questions": questions})
|
# return render(request, "sbas/question_view.html", {"questions": questions})
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@@ -383,7 +383,7 @@ GenericViews = GenericViewBase("sbas", Question, UserAnswer, Exam)
|
|||||||
|
|
||||||
class QuestionDelete(AuthorOrCheckerRequiredMixin, DeleteView):
|
class QuestionDelete(AuthorOrCheckerRequiredMixin, DeleteView):
|
||||||
model = Question
|
model = Question
|
||||||
success_url = reverse_lazy("sbas:question_list")
|
success_url = reverse_lazy("sbas:question_view")
|
||||||
|
|
||||||
|
|
||||||
class ExamCreate(ExamCreateBase):
|
class ExamCreate(ExamCreateBase):
|
||||||
|
|||||||
Reference in New Issue
Block a user