![]() |
COURSEBOOK
|
File documentation. More...
Functions | |
def | discussion.views.login (request) |
This function is used for login. More... | |
def | discussion.views.logout (request) |
This function is used for logout. More... | |
def | discussion.views.signup (request) |
This function is used for signup. More... | |
def | discussion.views.default (request) |
This function is used for setting context if the user is professor. | |
def | discussion.views.prof_home (request) |
This function is used for rendering the homepage of Professor. | |
def | discussion.views.prof_subjects (request) |
This function is used for displaying the subject cnd adding new subjects. More... | |
def | discussion.views.student_list (request, sub_code) |
This function is used for displaying the list of students. More... | |
def | discussion.views.accept_student (request, sub_code, pid) |
This function is used by Professor to accept student's Requests. More... | |
def | discussion.views.request_subject (request, sub_code) |
This function is used by Student to request for a Subject. More... | |
def | discussion.views.reject_student (request, sub_code, pid) |
This function is used by Professor to reject student's Requests or remove the accepted students. More... | |
def | discussion.views.reject_subject (request, sub_code) |
This function is used by Student to reject existing Requests. More... | |
def | discussion.views.withdraw_subject (request, sub_code) |
This function is used by Student to withdraw the registered subject. More... | |
def | discussion.views.show_subjects (request) |
This function is used by Student to list accepted subjects corresponding to student. More... | |
def | discussion.views.show_all_subjects (request) |
This function is used by Student to list all available subjects. More... | |
def | discussion.views.show_pending_subjects (request) |
This function is used by Student to list pending subject corresponding to student. More... | |
def | discussion.views.show_topics (request, id) |
This function is used by both Student and Professor to list Topics of corresponding Subject. More... | |
def | discussion.views.show_threads (request, id) |
This function is used by both Student and Professor to list Threads in particular Topics of a Subject. More... | |
def | discussion.views.update_thread_like_count (request, thread_id, topic_id) |
This function is used by Student to like a thread. More... | |
def | discussion.views.update_thread_dislike_count (request, thread_id, topic_id) |
This function is used by Studentto dislike a thread. More... | |
File documentation.
def discussion.views.accept_student | ( | request, | |
sub_code, | |||
pid | |||
) |
This function is used by Professor to accept student's Requests.
This function update the entry in the Subject_Student table i.e. is_accepted=True
sub_code | This varible store the subject code of subject for which students has applied |
pid | This contain the id of Person whos has applied for ths course |
def discussion.views.login | ( | request | ) |
This function is used for login.
This is the function which we call form the login page, here we validate the user for Person table in database ad redirect as per the user that is, if user is proessor we will redirect it to proper webpage
def discussion.views.logout | ( | request | ) |
This function is used for logout.
This function is use to logout the current session
def discussion.views.prof_subjects | ( | request | ) |
This function is used for displaying the subject cnd adding new subjects.
This function is used show the corresponding subjects of the Professor and Also provide him option to add new subjects
def discussion.views.reject_student | ( | request, | |
sub_code, | |||
pid | |||
) |
This function is used by Professor to reject student's Requests or remove the accepted students.
This function deletes the entry in the Subject_Student table i.e. corrosponding to student with given pid and subject code
sub_code | This varible store the subject code of subject for which students has applied or get accepted |
pid | This contain the id of Person whos has applied for ths course or get accepted in the course |
def discussion.views.reject_subject | ( | request, | |
sub_code | |||
) |
This function is used by Student to reject existing Requests.
This function deletes the entry in the Subject_Student table i.e. corrosponding to student with given context and subject code
sub_code | This varible store the subject code of subject for which students has pending request |
def discussion.views.request_subject | ( | request, | |
sub_code | |||
) |
This function is used by Student to request for a Subject.
This function adds a entry in the Subject_Student table with the field is_accepted=False
sub_code | This varible store the subject code of subject for which students has applied |
def discussion.views.show_all_subjects | ( | request | ) |
This function is used by Student to list all available subjects.
This function filter the subjects for which student has already requested
def discussion.views.show_pending_subjects | ( | request | ) |
This function is used by Student to list pending subject corresponding to student.
Here in this function we fetch all the requests made by the student and requests are pending.
def discussion.views.show_subjects | ( | request | ) |
This function is used by Student to list accepted subjects corresponding to student.
Here in this function we fetch all the requests made by the student and get accepted.
def discussion.views.show_threads | ( | request, | |
id | |||
) |
This function is used by both Student and Professor to list Threads in particular Topics of a Subject.
In this function we fetch threads from Thread table filtering as per the Topic
sub_code | This varible store the Topic id of Topic for which we wants threads |
def discussion.views.show_topics | ( | request, | |
id | |||
) |
This function is used by both Student and Professor to list Topics of corresponding Subject.
In this function we check if the request came from Professor. I yes then we hide the topics in which professor is not included. To Students we provide while list.Allow user to add new Topics. Again Students have right to exclude the Professor.But Professor doesnot have such option
id | This varible store the subject code of subject |
def discussion.views.signup | ( | request | ) |
This function is used for signup.
This function is used for signup, here we redirct to the the login page if successfulll done the signup
def discussion.views.student_list | ( | request, | |
sub_code | |||
) |
This function is used for displaying the list of students.
This list is made availabe to the Professor so that he can see which student's requsts are accepted and, which have pending status
sub_code | This varible store the subject code of subject for which Professor has to see the Student List |
def discussion.views.update_thread_dislike_count | ( | request, | |
thread_id, | |||
topic_id | |||
) |
This function is used by Studentto dislike a thread.
Here we maintain the like table that stores the like and dislikes per thread, Here we increment the disike count and decrement the like count if already disliked
thread_id | This stores the id of thread of which we want to dislike |
topic_id | This stores the id of topic of which the thread belong,This is use to redirectIf already disliked then no change occurs |
def discussion.views.update_thread_like_count | ( | request, | |
thread_id, | |||
topic_id | |||
) |
This function is used by Student to like a thread.
Here we maintain the like table that stores the like and dislikes per thread, Here we increment the like count and decrement the dislike count if already liked
thread_id | This stores the id of thread of which we want to like |
topic_id | This stores the id of topic of which the thread belong,This is use to redirectIf already liked then no change occurs |
def discussion.views.withdraw_subject | ( | request, | |
sub_code | |||
) |
This function is used by Student to withdraw the registered subject.
This function deletes the entry in the Subject_Student table i.e. corrosponding to student with given context and subject code
sub_code | This varible store the subject code of subject for which students has been accepted and student wants to withdraw the same |