Skip to content

Commit

Permalink
DigitalCampus#269: Added total number of media activities for each row
Browse files Browse the repository at this point in the history
  • Loading branch information
jjoseba committed May 5, 2016
1 parent d445709 commit 7a19ad4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion oppia/models.py
Expand Up @@ -116,6 +116,9 @@ def get_no_activities(self):

def get_no_quizzes(self):
return Activity.objects.filter(section__course=self,type=Activity.QUIZ,baseline=False).count()

def get_no_media(self):
return Media.objects.filter(course=self).count()

@staticmethod
def get_pre_test_score(course,user):
Expand Down Expand Up @@ -158,7 +161,6 @@ def get_badges(course,user):
@staticmethod
def get_media_viewed(course,user):
acts = Media.objects.filter(course=course).values_list('digest')
print acts
return Tracker.objects.filter(course=course,user=user,digest__in=acts).values_list('digest').distinct().count()


Expand Down
2 changes: 1 addition & 1 deletion oppia/templates/oppia/profile/user-scorecard.html
Expand Up @@ -55,7 +55,7 @@ <h3>{% trans 'Courses' %}</h3>
&nbsp;
{% endif %}
</td>
<td>{{ c.no_media_viewed }}</td>
<td>{{ c.no_media_viewed }}/{{ c.course.get_no_media }}</td>
</tr>
{% endfor %}
</tbody>
Expand Down

0 comments on commit 7a19ad4

Please sign in to comment.