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

<div class="np-course-details">
    <div class="np-course-detail">                 
        <strong>{{ activities_count }}</strong>
        <span class="np-details-label">
          {% if activities_count == 1 %}Activity{% else %}Activities{% endif %}
        </span>
    </div>
    <div class="np-course-detail">
      {% if course.properties.course_length contains 'missing property' %}
        missing property: course.properties.course_length
      {% else %}
        {% if course.properties.course_length %}
          {% if course.properties.course_length > 0 %}
              <strong>{{course.properties.course_length}}</strong> mins<span class="np-details-label">Duration</span>
          {% else %}
              <div>&nbsp;&nbsp;&nbsp;</div>
          {% endif %}
        {% endif %}
      {% endif %}
    </div>
    <div class="np-course-detail">
      <div class='course-detail-rating'>
        <div class='course-detail-rating-stars' style='display: flex; flex-wrap: nowrap; font-size: 18px;'>
          {% for i in (1..5) %}
            {% if course.properties.np_course_rating >= i %}
            <i class="fas fa-star full-star" style='line-height: 28px;'></i>
            {% else %}
            <i class="fas fa-star empty-star" style='line-height: 28px;'></i>
            {% endif %}
          {% endfor %}
        </div>
        <span class="np-details-label" style= 'display: flex;'>
          {{course.properties.np_course_rating}} <div style='font-weight: 500; padding-left: 5px;'>({{course.properties.np_course_rating_count}}) </div>
        </span>
      </div>
    </div>
</div>