From 1ba6ed1980237d2ffa10b9f89bf4652584cb5b0e Mon Sep 17 00:00:00 2001 From: tkupek Date: Sat, 5 Mar 2016 13:14:33 +0100 Subject: [PATCH] added rich text functionality for questions --- README.md | 2 +- db.sqlite3 | Bin 107520 -> 137216 bytes tkupek_elearning/elearning/admin.py | 2 +- .../migrations/0022_auto_20160305_1128.py | 32 ++++++++++++++++++ .../migrations/0023_auto_20160305_1158.py | 21 ++++++++++++ tkupek_elearning/elearning/models.py | 5 +-- .../elearning/templates/elearning.html | 4 +-- tkupek_elearning/settings.py | 3 +- tkupek_elearning/urls.py | 4 +-- 9 files changed, 64 insertions(+), 9 deletions(-) create mode 100644 tkupek_elearning/elearning/migrations/0022_auto_20160305_1128.py create mode 100644 tkupek_elearning/elearning/migrations/0023_auto_20160305_1158.py diff --git a/README.md b/README.md index 6b70009..54b6b09 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,4 @@ requirements: - python - django - sqlite3 - +- tinymce \ No newline at end of file diff --git a/db.sqlite3 b/db.sqlite3 index 9c08e693dafc36e105c9780b380d8a3faadc83ef..14df51fac4272fa000f4acb40f89dbcbe0fb502c 100644 GIT binary patch delta 2853 zcmd5;dr(y86~E{E?y}4Ba#aKbt)0f0OyW3}bdt{4shv!wkMw+Z!D^iT z-#hy|bMKztIp6utIp1UC-I$R#P1EU?VUFVtBYF`Th!19p?D4}~@t=qRzs&Ugv))ch zD@Xar@2JSH3UYDeaw7SP+@OiHo!aQ9w3@y`r|GZBWpX)U;h!PO>*iIdD@v#YvQPE| z{Js9}j=f0c|fU#sROH+#uJ zZcEA{^MjeOCNupF3$!^BU;7Rv8=R5fKP~a`gyeGMF_H@#pjEN(KKK~r`|t_MYcW!B zOv?H!W!KqMrRjKbyHFSd1}+~zuU*Jj&R!^Z z>4l6$vp&cmM}JBO=~W!WNBJV!4$Ry@^|v;BBahJbSY~tXVoZ@56N2rQBaa`FYds;^ zAKcv&4h;&D_E8w}h&s0hmTO}n*a7iu1_W+$aFbp{*M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o4G*YB)Ns;E1>o zQc2SaFsWCYK%l0T)HGNPFYrCm`{Rj<;2`^_fkplEVbFv6SvBZT3JvDE!EgnKkKiY8 z1?9E`lZwgkDK>KFh>!}RoWg&so=b&H%wE1&70cla5V;$?Dqj!Ec%q!DHoyZ&<;$pI za2uRRi`>^=w_NH7yIX^yfO|tgTHg{99b`=@(x;Q0x57epYc z^7lY1jukWKW$IT2ph3jf1&dVP4)0BH@PPv=DF;?~66jbK;czfWE=`3DVqXCQ`N{}Z za&a5fs(c>QW3}r=(D8Jb64Zpna2>0B2JLTJPuuSNJ9sN%yqU>K1I!m`4G;BJXa&v@ zSsJz60d+FyOQr^YND7FK;sS9=`~Y>yjV)uDb0ozGBjn6fs3jw_AVp2n!P|%(N4H)i zPk`epuYo)~$iwTCyGx#Hd~m#h?oDF3x79-%Y1LB55D%@0ovACBJ2AJz=zBbvv5pND zVrRM+KBQDMPU*YfAaJw09~rRR9>__iU>GICTcIYK`mEYrYNWU)?|RyGJFbYFu|cZZ z`#7`%iG*N3>t*AsEfc4QDu!Vf?O7*mK~Il0nzl4XnlE!#Ui)n& zDE_gTDAoZyPZEqs

{{ question.id }}: {{ question.title }}

-

{{ question.text }}

+

{{ question.text|safe }}

    {% for option in options %} @@ -59,7 +59,7 @@

    {{ settings.text_answer }}

    -

    {{ question.explanation }}

    +

    {{ question.explanation|safe }}

    diff --git a/tkupek_elearning/settings.py b/tkupek_elearning/settings.py index a3cb137..381b514 100644 --- a/tkupek_elearning/settings.py +++ b/tkupek_elearning/settings.py @@ -37,7 +37,8 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'tkupek_elearning.elearning' + 'tkupek_elearning.elearning', + 'tinymce', ] MIDDLEWARE_CLASSES = [ diff --git a/tkupek_elearning/urls.py b/tkupek_elearning/urls.py index 646d63b..71391f1 100644 --- a/tkupek_elearning/urls.py +++ b/tkupek_elearning/urls.py @@ -13,7 +13,7 @@ Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ -from django.conf.urls import url +from django.conf.urls import url, include from django.contrib import admin import tkupek_elearning.elearning.views @@ -23,5 +23,5 @@ urlpatterns = [ url(r'start', tkupek_elearning.elearning.views.start), url(r'api', tkupek_elearning.elearning.views.get_answer), url(r'statistic', tkupek_elearning.elearning.views.statistic), - + url(r'^tinymce/', include('tinymce.urls')), ]