Skip to content

Commit

Permalink
Merge pull request #256 from ankitjavalkar/fix-tags
Browse files Browse the repository at this point in the history
Fix issue and allow tags to be saved while saving questions
  • Loading branch information
prabhuramachandran authored Mar 22, 2017
2 parents 99addf8 + 4fc13ee commit f9a787b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
32 changes: 17 additions & 15 deletions yaksh/templates/yaksh/moderator_dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,26 @@
</table>
<hr>
<center>
<h5>Click on the button given below to add a new course.</h5>
<button class="btn" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/add_course");'>Add New Course</button>
<h5>Click on the button to Create a Demo course.</h5>
<button class="btn" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/create_demo_course");'>Create Demo Course</button>
<a data-toggle="collapse" data-target="#help">
<span class="glyphicon glyphicon-info-sign">Help</span></a>
<a href="{{URL_ROOT}}/exam/manage/add_course" class="btn btn-default">
Add New Course
</a>
<a href="{{URL_ROOT}}/exam/manage/create_demo_course" class="btn btn-default">
Create Demo Course
</a>
<a data-toggle="collapse" data-target="#help">
<span class="glyphicon glyphicon-question-sign"></span> What's This
</a>
<div id="help" class="collapse">
<ul>
<li>A Demo Course and Demo Quiz will be created (Click Courses link on nav bar to view courses).</li>
<li>Some Demo Questions are also created for you (Click Questions link on nav bar to view questions).</li>
<li>In Courses you can view Demo Quiz.</li>
<li>Click on the Demo Quiz and Click on User Mode or God Mode to take the quiz.</li>
<li>You can also edit the Demo quiz.</li>
</ul>
</p>
<ul>
<li>A Demo Course and Demo Quiz will be created (Click Courses link on nav bar to view courses).</li>
<li>Some Demo Questions are also created for you (Click Questions link on nav bar to view questions).</li>
<li>In Courses you can view Demo Quiz.</li>
<li>Click on the Demo Quiz and Click on User Mode or God Mode to take the quiz.</li>
<li>You can also edit the Demo quiz.</li>
</ul>
</div>
{% if msg %}
<h4>{{ msg }}</h4>
<h4>{{ msg }}</h4>
{% endif %}
</center>
{% if trial_paper %}
Expand Down
2 changes: 2 additions & 0 deletions yaksh/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ def add_question(request, question_id=None):
question = qform.save(commit=False)
question.user = user
question.save()
# many-to-many field save function used to save the tags
qform.save_m2m()
for formset in formsets:
if formset.is_valid():
formset.save()
Expand Down

0 comments on commit f9a787b

Please sign in to comment.