gnowledge/gstudio — pull request #653 by AvadootNachankar (2014-08-02 16:14:54+00:00)
Title: MIS - Students' assignments lising setup as hyperlink on No. of students count given in college group's detail-view

**Functionalities implemented:**

**1) NodeJSONEncoder class added in models.**

- Helpful mostly in ajax-calls where you want to send data (Node document) as json.dumps().
- Generally get few errors regarding json non-compatible types i.e. ObjectId and datetime
- This problem can be tackle by passing second parameter to json.dumps() function call as shown below:
``` return HttpResponse(json.dumps(student_dict, cls=NodeJSONEncoder)) ```
- For reference, search in file (views/ajax_views.py)

- Files modified:

1) gnowsys-ndf/gnowsys_ndf/ndf/models.py

**2) Students' assignments lising setup as hyperlink on No. of students count given in college group's detail-view.**

- Files modified:

1) templates/ndf/college_group_details.html

- This is a new template added for displaying college group details
- Extends templates/ndf/groupdashboard.html

- Ajax call added on click of No. of students count which displays all students' statistics

2) templates/ndf/student_statistics.html

- This is also a new template created which lists Student's statistics in two parts:

a) Student name along with the count i.e., total no. of assignemnts done (along with listing how many pages, videos, or files they have created)
b) For more detailed view, once you click on above shown data... corresponding accordions are shown each for page, video and files just below that record.

3) templates/ndf/node_ajax_view.html

- Id added, required for making an ajax-call.

4) views/ajax_views.py

- get_student_assignments() function added

5) urls/ajax-urls.py

- Ajax-url added which makes call to get_student_assignments() function of ajax_views

6) views/group.py

- Code added for template redirection
- If college group found, select above created template.
- Else use fallback template, i.e. groupdashboard.html

7) templatetags/ndf_tags.py

- Author is added into the query, so that public user-groups are also accessible via urls. Needed to access student's resources!

**3) Minor changes**

- Files modified:

1) models.py

- Modified: Check for correct GSystemType match in AttributeType and GAttribute, similarly for RelationType and GRelation
- If instersection is not found with member_of fields' ObjectIds, then check for type_of field of each one of the member_of node

2) views/page.py

- In publish_page(), content and content_org values converted to unicode first then assigned.

3) management/commands/data_entry.py

- Additional check of "member_of" field is added in one of the query.

4) management/commands/mis_college_group.py