{% assign activities_count = 0 %}
{% assign quizzes_count = 0 %}

{% for course_section in course.sections %}
  {% for course_activity in course_section.activities %}
    {% assign activities_count = activities_count | plus: 1 %}

    {% if course_activity.type == "quiz" %}
      {% assign quizzes_count = quizzes_count | plus: 1 %}
    {% endif %}
  {% endfor %}
{% endfor %} 

<div class="np-course-details" style="text-align: center">
    <div class="np-course-detail" style="margin-right: 10%">                 
        <strong>{{ activities_count }}</strong>
        <span class="np-details-label">
          {% if activities_count == 1 %}Activity{% else %}Activities{% endif %}
        </span>
    </div>
    <div class="np-course-detail">
        <strong>{{ quizzes_count }}</strong>
        <span class="np-details-label">
          {% if quizzes_count == 1 %}Quiz{% else %}Quizzes{% endif %}
        </span>
    </div>
</div>