diff --git a/amadeus/settings.py b/amadeus/settings.py index 18ffe36..e9297c8 100644 --- a/amadeus/settings.py +++ b/amadeus/settings.py @@ -54,6 +54,7 @@ INSTALLED_APPS = [ 'app', 'courses', 'forum', + 'exam', 'poll', 'links', 'files', diff --git a/courses/urls.py b/courses/urls.py index 4c6cfa0..f79ca30 100644 --- a/courses/urls.py +++ b/courses/urls.py @@ -27,7 +27,7 @@ urlpatterns = [ url(r'^subjects/categories$',views.IndexSubjectCategoryView.as_view(), name='subject_category_index'), url(r'^forum/', include('forum.urls', namespace = 'forum')), url(r'^poll/', include('poll.urls', namespace = 'poll')), - # url(r'^exam/', include('exam.urls', namespace = 'exam')), + url(r'^exam/', include('exam.urls', namespace = 'exam')), url(r'^files/', include('files.urls', namespace = 'file')), url(r'^upload-material/$', views.UploadMaterialView.as_view(), name='upload_material'), url(r'^links/',include('links.urls',namespace = 'links')), diff --git a/exam/templates/exam/create.html b/exam/templates/exam/create.html index e69de29..0610563 100644 --- a/exam/templates/exam/create.html +++ b/exam/templates/exam/create.html @@ -0,0 +1,116 @@ +{% extends "base.html" %} + +{% load i18n %} + +{% block content %} +
+
+ {% block title_poll %} +

{% trans "New Exam" %}

+ {% endblock title_poll %} +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+ +
+
+ +
+ +
+
+
+
+ +
+
+
+ +
+ + +{% endblock content %} diff --git a/exam/templates/exam/discursive_question.html b/exam/templates/exam/discursive_question.html new file mode 100644 index 0000000..c810344 --- /dev/null +++ b/exam/templates/exam/discursive_question.html @@ -0,0 +1,6 @@ +
+ +
+ +
+
diff --git a/exam/templates/exam/gap_filling_answer.html b/exam/templates/exam/gap_filling_answer.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/exam/templates/exam/gap_filling_answer.html diff --git a/exam/templates/exam/gap_filling_question.html b/exam/templates/exam/gap_filling_question.html new file mode 100644 index 0000000..1021842 --- /dev/null +++ b/exam/templates/exam/gap_filling_question.html @@ -0,0 +1,3 @@ + diff --git a/exam/templates/exam/multiple_choice_answer.html b/exam/templates/exam/multiple_choice_answer.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/exam/templates/exam/multiple_choice_answer.html diff --git a/exam/templates/exam/multiple_choice_question.html b/exam/templates/exam/multiple_choice_question.html new file mode 100644 index 0000000..d6e8c7c --- /dev/null +++ b/exam/templates/exam/multiple_choice_question.html @@ -0,0 +1,40 @@ +
+ + + + +
+ +
+ + +
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+
+ + +
+
diff --git a/exam/templates/exam/true_or_false_answer.html b/exam/templates/exam/true_or_false_answer.html new file mode 100644 index 0000000..e79b34d --- /dev/null +++ b/exam/templates/exam/true_or_false_answer.html @@ -0,0 +1,15 @@ +{% load i18n %} + +
+
+
+ +
+
+ +
+
+
+ +
+
diff --git a/exam/templates/exam/true_or_false_question.html b/exam/templates/exam/true_or_false_question.html new file mode 100644 index 0000000..1cc6594 --- /dev/null +++ b/exam/templates/exam/true_or_false_question.html @@ -0,0 +1,67 @@ +{# {% extends "base.html" %} #} + +{% load i18n %} +{# {% block content %} #} + +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+ {% include "exam/true_or_false_answer.html" %} +
+
+
+
+ +
+
+
+ +{# {% endblock content %} #} diff --git a/exam/urls.py b/exam/urls.py index 118cc17..b73df69 100644 --- a/exam/urls.py +++ b/exam/urls.py @@ -1,12 +1,21 @@ -# from django.conf.urls import url -# -# from . import views -# -# urlpatterns = [ -# url(r'^create/(?P[\w\-_]+)/$', views.CreateExam.as_view(), name='create_exam'), # exam slug -# url(r'^update/(?P[\w\-_]+)/$', views.UpdateExam.as_view(), name='update_exam'), # topic slug -# url(r'^view/(?P[\w\-_]+)/$', views.ViewExam.as_view(), name='view_exam'), # exam slug -# url(r'^delete/(?P[\w\-_]+)/$', views.DeleteExam.as_view(), name='delete_exam'), # exam -# url(r'^answer/$', views.AnswerExam.as_view(), name='answer_exam'), # exam -# url(r'^answer-exam/(?P[\w\-_]+)/$', views.AnswerStudentExam.as_view(), name='answer_student_exam'), # exam slug -# ] +from django.conf.urls import url + +from . import views + +urlpatterns = [ + url(r'^create/(?P[\w\-_]+)/$', views.CreateExam.as_view(), name='create_exam'), # exam slug + url(r'^update/(?P[\w\-_]+)/$', views.UpdateExam.as_view(), name='update_exam'), # topic slug + url(r'^view/(?P[\w\-_]+)/$', views.ViewExam.as_view(), name='view_exam'), # exam slug + url(r'^delete/(?P[\w\-_]+)/$', views.DeleteExam.as_view(), name='delete_exam'), # exam + url(r'^answer/$', views.AnswerExam.as_view(), name='answer_exam'), # exam + url(r'^answer-exam/(?P[\w\-_]+)/$', views.AnswerStudentExam.as_view(), name='answer_student_exam'), # exam slug + + + url(r'^discursive-question/$',views.DiscursiveQuestion.as_view(), name="discursive_question"), + url(r'^gap-filling-question/$',views.GapFillingQuestion.as_view(), name="gap_filling_question"), + url(r'^gap-filling-answer/$',views.GapFillingAnswer.as_view(), name="gap_filling_answer"), + url(r'^multiple-choice-question/$',views.MultipleChoiceQuestion.as_view(), name="multiple_choice_question"), + url(r'^multiple-choice-answer/$',views.MultipleChoiceAnswer.as_view(), name="multiple_choice_answer"), + url(r'^true-or-false-question/$',views.TrueOrFalseQuestion.as_view(), name="true_or_false_question"), + url(r'^true-or-false-answer/$',views.TrueOrFalseAnswer.as_view(), name="true_or_false_answer"), +] diff --git a/exam/views.py b/exam/views.py index 77c2c74..895cf7a 100644 --- a/exam/views.py +++ b/exam/views.py @@ -24,7 +24,7 @@ class ViewExam(LoginRequiredMixin,generic.DetailView): template_name = 'exam/view.html' def get_object(self, queryset=None): - return get_object_or_404(Exam, slug = self.kwargs.get('slug')) + return get_object_or_404(Topic, slug = self.kwargs.get('slug')) def get_context_data(self, **kwargs): context = super(ViewExam, self).get_context_data(**kwargs) @@ -227,3 +227,29 @@ class AnswerStudentExam(LoginRequiredMixin,generic.CreateView): context['keys'] = keys return context + +class MultipleChoiceQuestion(generic.TemplateView): + template_name = 'exam/multiple_choice_question.html' + + +class MultipleChoiceAnswer(generic.TemplateView): + template_name = 'exam/multiple_choice_answer.html' + + +class DiscursiveQuestion(generic.TemplateView): + template_name = 'exam/discursive_question.html' + + +class TrueOrFalseQuestion(generic.TemplateView): + template_name = 'exam/true_or_false_question.html' + + +class TrueOrFalseAnswer(generic.TemplateView): + template_name = 'exam/true_or_false_answer.html' + + +class GapFillingQuestion(generic.TemplateView): + template_name = 'exam/gap_filling_question.html' + +class GapFillingAnswer(generic.TemplateView): + template_name = 'exam/gap_filling_answer.html' -- libgit2 0.21.2