diff options
author | adityacp | 2020-11-03 11:32:26 +0530 |
---|---|---|
committer | adityacp | 2020-11-03 11:32:26 +0530 |
commit | eac52e0198000d96b4c84f9fa6b63ea50cc59f1d (patch) | |
tree | be8de9d55aa99501ef5713cfb944c4c04021b901 /yaksh/templates | |
parent | 430c8d1480d897e9fc0dc328bad173642d0a2946 (diff) | |
download | online_test-eac52e0198000d96b4c84f9fa6b63ea50cc59f1d.tar.gz online_test-eac52e0198000d96b4c84f9fa6b63ea50cc59f1d.tar.bz2 online_test-eac52e0198000d96b4c84f9fa6b63ea50cc59f1d.zip |
Multiple changes
- Add tinymce editor to the question description in lesson quiz
- Fix katex rendering in the lesson quiz questions
- Remove unncessary preview description view function
- Keep the fixed height for the lesson table of contents div
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/add_lesson.html | 10 | ||||
-rw-r--r-- | yaksh/templates/yaksh/add_video_quiz.html | 6 | ||||
-rw-r--r-- | yaksh/templates/yaksh/show_lesson_quiz.html | 9 | ||||
-rw-r--r-- | yaksh/templates/yaksh/show_toc.html | 28 |
4 files changed, 29 insertions, 24 deletions
diff --git a/yaksh/templates/yaksh/add_lesson.html b/yaksh/templates/yaksh/add_lesson.html index 329a8e0..f05fbe0 100644 --- a/yaksh/templates/yaksh/add_lesson.html +++ b/yaksh/templates/yaksh/add_lesson.html @@ -25,8 +25,8 @@ {{error}} </div> {% endif %} - <div class="row justify-content-center form-group"> - <div class="col-md-5 col-md-offset-4"> + <div class="row"> + <div class="col-md-6"> <a class="btn btn-primary" href="{% url 'yaksh:get_course_modules' course_id %}"> <i class="fa fa-arrow-left"></i> Back </a> @@ -143,7 +143,7 @@ </form> </div> <br><br> - <div class="col-md-5"> + <div class="col-md-6"> <br> <div class="card"> <div class="card-header"> @@ -152,13 +152,13 @@ </a> </div> <div class="collapse show" id="toc-collapse"> - <div class="card-body" id="toc">{{toc}}</div> + <div class="card-body" id="toc" style="max-height: 400px; overflow-y: auto;">{{toc}}</div> </div> </div> <br> <div class="card" id="preview_text_div"> <div class="card-header"> - Setup Lesson + Create lesson table of contents </div> <div class="card-body"> {% if lesson_form.instance and lesson_form.instance.video_path %} diff --git a/yaksh/templates/yaksh/add_video_quiz.html b/yaksh/templates/yaksh/add_video_quiz.html index ad087bc..b8a788e 100644 --- a/yaksh/templates/yaksh/add_video_quiz.html +++ b/yaksh/templates/yaksh/add_video_quiz.html @@ -76,9 +76,9 @@ $('#id_type').children("option[value='code']").show(); } }); - function init_editor() { + $(function() { tinymce.init({ - selector : "textarea", + selector: 'textarea#que_description', setup : function(ed) { ed.on('change', function(e) { tinymce.triggerSave(); @@ -89,6 +89,6 @@ plugins: "image code link", convert_urls: false }); - } + }); }); </script>
\ No newline at end of file diff --git a/yaksh/templates/yaksh/show_lesson_quiz.html b/yaksh/templates/yaksh/show_lesson_quiz.html index fb5ae6c..2bb51ea 100644 --- a/yaksh/templates/yaksh/show_lesson_quiz.html +++ b/yaksh/templates/yaksh/show_lesson_quiz.html @@ -1,5 +1,8 @@ {% load custom_filters %} <script type="text/javascript"> + $(document).ready(function() { + renderMathInElement(document.body); + }); function user_arranged_options() { var temp_array = [] var add_array = document.getElementById("arrange_order"); @@ -120,11 +123,11 @@ var order_array = $(arrange).sortable(['serialize']); </script> {% endif %} - {% if question.type == "mcq" or question.type == "mcc" or question.type == "integer" or question.type == "float" or question.type == "string" %} + {% if question.type == "arrange" %} + <br><button class="btn btn-success" type="submit" name="check" id="check" onClick="return user_arranged_options();">Submit</button> + {% else %} <br><button class="btn btn-success" type="submit" name="check" id="check">Submit </button> - {% elif question.type == "arrange" %} - <br><button class="btn btn-success" type="submit" name="check" id="check" onClick="return user_arranged_options();">Submit</button> {% endif %} </div> </div> diff --git a/yaksh/templates/yaksh/show_toc.html b/yaksh/templates/yaksh/show_toc.html index 92ea0cd..680c17b 100644 --- a/yaksh/templates/yaksh/show_toc.html +++ b/yaksh/templates/yaksh/show_toc.html @@ -1,20 +1,22 @@ {% load custom_filters %} {% has_lesson_video lesson_id as has_video %} {% if has_video %} - <div> - <a href="{% url 'yaksh:download_sample_toc' %}"> - <i class="fa fa-download"></i> Download Sample - </a> - <br><br> - <form action="" method="POST" enctype="multipart/form-data"> - {% csrf_token %} - <input type="file" name="toc" required=""> - <button class="btn btn-outline-success" id="upload_toc" name="upload_toc"> - <i class="fa fa-upload"></i> Upload TOC - </button> - </form> + <div class="card"> + <div class="card-body"> + <a href="{% url 'yaksh:download_sample_toc' %}"> + <i class="fa fa-download"></i> Download Sample + </a> + <hr> + <form action="" method="POST" enctype="multipart/form-data"> + {% csrf_token %} + <input type="file" name="toc" required=""> + <button class="btn btn-outline-success" id="upload_toc" name="upload_toc"> + <i class="fa fa-upload"></i> Upload TOC + </button> + </form> + </div> </div> - <hr> + <br> {% endif %} <table class="table table-responsive-sm"> {% for toc in contents %} |