When there is no marks self.total_mark is 0. Condition is used to avoid division by 0.
Fix issue #1388
New test: if an assigment has no marks and was completed and released to student should has values median and average results values equal to 0. 

Equation that divides by total marks (0 if no marks in the assingment) should not be reached.
Correcting lines that are setup and verification.
Correcting comment.
Verify if students_counts is not zero, avoiding division by zero
Merge pull request #1394 from tiagochst/issue-1388

Closes #1388: when marks are not used in assignments, releasing marks produces an error.