diff options
author | Prabhu Ramachandran | 2016-05-04 11:13:10 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2016-05-04 11:13:10 +0530 |
commit | 03f0aa839e4d91a3d83d68d5301f1425f18cca73 (patch) | |
tree | 26ba7a6d92878844a25d988cb57112f287b7a85c /yaksh/templates | |
parent | 825f8464ef1b2853c029cc23bf7fb89f6a9c1c09 (diff) | |
parent | 78795446d89ae5c247f5424d70d652437c93cda6 (diff) | |
download | online_test-03f0aa839e4d91a3d83d68d5301f1425f18cca73.tar.gz online_test-03f0aa839e4d91a3d83d68d5301f1425f18cca73.tar.bz2 online_test-03f0aa839e4d91a3d83d68d5301f1425f18cca73.zip |
Merge pull request #92 from adityacp/Add_Teachers
Add teachers to a course
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/addteacher.html | 77 | ||||
-rw-r--r-- | yaksh/templates/yaksh/courses.html | 41 | ||||
-rw-r--r-- | yaksh/templates/yaksh/user_data.html | 2 |
3 files changed, 116 insertions, 4 deletions
diff --git a/yaksh/templates/yaksh/addteacher.html b/yaksh/templates/yaksh/addteacher.html new file mode 100644 index 0000000..7e04f71 --- /dev/null +++ b/yaksh/templates/yaksh/addteacher.html @@ -0,0 +1,77 @@ +{% extends "manage.html" %} + +{% block title %} Add teacher {% endblock title %} +{% block subtitle %} {{ course.name }} {% endblock %} + +{% block css %} +<link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/course.css" /> +{% endblock %} + +{% block manage %} +<center><h3>Add Teachers for this course</h3><br></center> +<center><h3>Search teacher with username, firstname, lastname, email</h3><br></center> +<div align="center"> + <form action="{{ URL_ROOT }}/exam/manage/searchteacher/{{ course.id }}/" method="post"> + {% csrf_token %} + Search Teacher: <input type="text" name="uname" style="height: 25px; padding: 0px"><br><br> + <center><button class="btn" type="submit">Search</button> + <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses");'>Cancel</button> </center></form> +</div> +<br><br> +<form action="{{ URL_ROOT }}/exam/manage/addteacher/{{ course.id }}/" method="post"> +{% csrf_token %} +{% if success == True %} + {% if teachers|length == 0 %} + <center><h3>No results found</h3></center> + {% else %} + <center><b><u>Search Results</u></b></center><br> + <center><b>Search results does not include teachers already added</b></center><br> + <table> + <th></th> + <th>Username</th> + <th>First Name</th> + <th>Last Name</th> + <th>Email</th> + <th>Institute</th> + <th>Department</th> + <th>Position</th> + {% for teacher in teachers %} + {% if teacher not in course.get_teachers %} + <tr> + <td><input type="checkbox" name="check" value="{{ teacher.id }}"></td> + <td>{{ teacher.username }}</td> + <td>{{ teacher.first_name }}</td> + <td>{{ teacher.last_name }}</td> + <td>{{ teacher.email }}</td> + <td>{{ teacher.profile.institute }}</td> + <td>{{ teacher.profile.department }}</td> + <td>{{ teacher.profile.position }}</td> + </tr> + {% endif %} + {% endfor %} + </table> + <button class="btn" type="submit">Add Selected</button> + {% endif %} +{% endif %} +</form> +{% if status == True %} +<div class="row"> + <div class="span6 offset4 wrap"> + <center><b><u>Teacher(s) Added</u></b></center><br> + {% if teachers_added %} + {% for teacher in teachers_added %} + <div class="well"> + <div class="row"> + <div class="span3" style="width: auto;"> + <h5>{{ teacher.get_full_name }}</h5> + </div> + </div> + </div> + {% endfor %} + {% else %} + <center><b>No Teacher(s) Added</b></center> + {% endif %} + </div> +</div> +{% endif %} +{% endblock %} diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html index f8f8273..06c848c 100644 --- a/yaksh/templates/yaksh/courses.html +++ b/yaksh/templates/yaksh/courses.html @@ -9,10 +9,15 @@ {% endblock %} {% block manage %} +<a href="{{URL_ROOT}}/exam/manage/allotted_course/">View Allotted Courses</a><br> {% if not courses %} - <center><h5> You have not created any courses </h5></center> + <center><h4> No new Courses added </h4></center> {% else %} +<center><h3> Course(s) Added</h3></center> {% for course in courses %} + {% if user != course.creator %} + <h4> {{course.creator.get_full_name}} added you to this course</h4> + {% endif %} <div class="row show-grid"> <div class="span14"> <div class="row"> @@ -26,8 +31,39 @@ {% endif %} </p> <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}/">{{ course.name }}</a> - </br> + </br></br> + {% if user == course.creator %} + <div class="row"> + <div class="span6 wrap"> + <center><b><u>Teacher(s) Added to {{ course }}</u></b></center> + {% if course.get_teachers %} + <div align="left"> + <form action="{{URL_ROOT}}/exam/manage/remove_teachers/{{ course.id }}/" method="post"> + {% csrf_token %} + {% for teacher in course.get_teachers %} + <div class="well"> + <div class="row"> + <div class="span3" style="width: auto;"> + <input type="checkbox" name="remove" value="{{ teacher.id }}"> {{ teacher.get_full_name }} + </div> + </div> + </div> + {% endfor %} + <button class="btn success" type="submit">Remove Selected</button> + </div> + {% else %} + <center><b>No Teacher(s) Added</b></center> + {% endif %} + </form> + </div> + </div> + {% endif %} + </div> + {% if user == course.creator %} + <div class="span6"> + <p><b><a href="{{URL_ROOT}}/exam/manage/searchteacher/{{course.id}}/">Add Teacher</a></b></p> </div> + {% endif %} <div class="span6"> <p><b><u>Quiz(zes)</u></b></p> {% if course.get_quizzes %} @@ -43,7 +79,6 @@ </div> <br><br> {% endfor %} - <button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/add_course");'>Add New Course</button> <button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz");'>Add New Quiz</button> {% endif %} diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html index 3350763..22be3ed 100644 --- a/yaksh/templates/yaksh/user_data.html +++ b/yaksh/templates/yaksh/user_data.html @@ -82,7 +82,7 @@ User IP address: {{ paper.user_ip }} <a href="{{URL_ROOT}}/exam/manage/monitor/">Monitor quiz</a> {% else %} {% with data.papers.0 as paper %} -<a href="{{URL_ROOT}}/exam/manage/monitor/{{paper.quiz.id}}/">Monitor quiz</a> +<a href="{{URL_ROOT}}/exam/manage/monitor/{{paper.question_paper.id}}/">Monitor quiz</a> {% endwith %} {% endif %} |