<commit_before>{% assign page_data = site.collections | where: "label", page.collection | first %}
{% assign found_projects = "" %}
{% assign first_entry = true %}
{% assign datetimes = false %}
{% assign week_count = -1 %}
{% assign course_details = false %}

{% assign total_videos = 0 %}
{% assign total_activities = 0 %}
{% assign total_lessons = 0 %}
{% assign total_exercises = 0 %}
{% assign total_projects = 0 %}

{% for doc in page_data.docs %}
  {% if doc.slug == "index" %}
    {% assign weight_activities = doc.grades.activities %}
    {% assign weight_exercises = doc.grades.exercises %}
    {% assign weight_videos = doc.grades.videos %}
    {% assign weight_projects = doc.grades.projects %}
    {% if doc.datetimes %}
      {% assign datetimes = doc.datetimes %}
    {% endif %}
    {% assign course_details = doc %}
  {% endif %}
{% endfor %}

{
  "course": "{{page.collection}}",
  "title": "{{course_details.title}}",
  {% if course_details.short_title %}"short_title": "{{course_details.short_title}}",{% endif %}
  "description": "{{course_details.desc}}",
  "url": "https://learn-the-web.algonquindesign.ca/courses/{{page.collection}}/",
  "course_code": "{{course_details.course_code}}",
  "year": {% if course_details.datetimes.year %}{{course_details.datetimes.year}}{% else %}{{site.time | date:'%Y'}}{% endif %},
  "start_week": {% if course_details.datetimes.start_week %}{{course_details.datetimes.start_week}}{% else %}1{% endif %},
  "professor": {
    "name": "{{course_details.prof.name}}",
    "email": "{{course_details.prof.email}}",
    "url": "{{course_details.prof.url}}",
    "github": "{{course_details.prof.github}}",
    "office": {% if course_details.prof.office %}"{{course_details.prof.office}}"{% else %}false{% endif %},
    "office_hours": [
      {% for hour in course_details.prof.hours %}
        {
          "day": {{hour.day}},
          "start_time": {{hour.start_time}},
          "end_time": {{hour.end_time}}
        }
        {% unless forloop.last %},{% endunless %}
      {% endfor %}
    ]
  },
  "grading_scheme": {
    "activities": 10,
    "activities_plus_lessons": 10,
    "exercises": 60,
    "projects": 15,
    "videos": 15
  },
  "grading_scheme_algonquin": {
    "activities": {{weight_activities}},
    "activities_plus_lessons": {{weight_activities}},
    "exercises": {{weight_exercises}},
    "projects": {{weight_projects}},
    {% if weight_videos > 0 %}
    "videos": {{weight_videos}}
    {% else %}
    "videos": 0
    {% endif %}
  },
  "assessments": [
{% for doc in page_data.docs %}
  {% unless doc.layout contains "week" %}{% continue %}{% endunless %}

  {% assign week_count = week_count | plus:1 %}
  {% assign week_number = datetimes.start_week | plus:week_count %}

  {% for tut in doc.video_tutorials %}
    {% if tut.videos %}
      {% capture url %}/topics/{{tut.url}}/{% endcapture %}
      {% include api-course-row.json title=tut.title group="video" id=tut.url grading_type="pass_fail" points=1 url=url first=first_entry datetimes=datetimes week_number=week_number due_offset=0 markbot_slug=tut.url course=page.collection %}
      {% assign first_entry = false %}
      {% capture total_videos %}{{total_videos | plus:1}}{% endcapture %}
    {% endif %}
  {% endfor %}

  {% for exercise in doc.tasks %}
    {% if exercise.graded-as %}
      {% unless found_projects contains exercise.graded-as %}<commit_msg>Add sections and multiple professor information<commit_after>{% assign page_data = site.collections | where: "label", page.collection | first %}
{% assign found_projects = "" %}
{% assign first_entry = true %}
{% assign datetimes = false %}
{% assign week_count = -1 %}
{% assign course_details = false %}

{% assign total_videos = 0 %}
{% assign total_activities = 0 %}
{% assign total_lessons = 0 %}
{% assign total_exercises = 0 %}
{% assign total_projects = 0 %}

{% for doc in page_data.docs %}
  {% if doc.slug == "index" %}
    {% assign weight_activities = doc.grades.activities %}
    {% assign weight_exercises = doc.grades.exercises %}
    {% assign weight_videos = doc.grades.videos %}
    {% assign weight_projects = doc.grades.projects %}
    {% if doc.datetimes %}
      {% assign datetimes = doc.datetimes %}
    {% endif %}
    {% assign course_details = doc %}
  {% endif %}
{% endfor %}

{
  "course": "{{page.collection}}",
  "title": "{{course_details.title}}",
  {% if course_details.short_title %}"short_title": "{{course_details.short_title}}",{% endif %}
  "description": "{{course_details.desc}}",
  "url": "https://learn-the-web.algonquindesign.ca/courses/{{page.collection}}/",
  "course_code": "{{course_details.course_code}}",
  "year": {% if course_details.datetimes.year %}{{course_details.datetimes.year}}{% else %}{{site.time | date:'%Y'}}{% endif %},
  "start_week": {% if course_details.datetimes.start_week %}{{course_details.datetimes.start_week}}{% else %}1{% endif %},
  "professors": [
    {% if course_details.prof %}
      {
        "name": "{{course_details.prof.name}} {{course_details.prof.family_name}}",
        "email": "{{course_details.prof.email}}",
        "url": "{{course_details.prof.url}}",
        "github": "{{course_details.prof.github}}",
        "office": {% if course_details.prof.office %}"{{course_details.prof.office}}"{% else %}false{% endif %},
        "office_hours": [
          {% for hour in course_details.prof.hours %}
            {
              "day": {{hour.day}},
              "start_time": {{hour.start_time}},
              "end_time": {{hour.end_time}}
            }
            {% unless forloop.last %},{% endunless %}
          {% endfor %}
        ]
      }
    {% endif %}
    {% if course_details.prof and course_details.multi_profs %},{% endif %}
    {% if course_details.multi_profs %}
      {% for prof in course_details.multi_profs %}
        {
          "name": "{{prof.name}} {{prof.family_name}}",
          "email": "{{prof.email}}",
          "url": "{{prof.url}}",
          "github": "{{prof.github}}",
          "office": {% if prof.office %}"{{prof.office}}"{% else %}false{% endif %},
          "office_hours": [
            {% for hour in prof.hours %}
              {
                "day": {{hour.day}},
                "start_time": {{hour.start_time}},
                "end_time": {{hour.end_time}}
              }
              {% unless forloop.last %},{% endunless %}
            {% endfor %}
          ]
        }{% unless forloop.last %},{% endunless %}
      {% endfor %}
    {% endif %}
  ],
  "grading_scheme": {
    "activities": 10,
    "activities_plus_lessons": 10,
    "exercises": 60,
    "projects": 15,
    "videos": 15
  },
  "grading_scheme_algonquin": {
    "activities": {{weight_activities}},
    "activities_plus_lessons": {{weight_activities}},
    "exercises": {{weight_exercises}},
    "projects": {{weight_projects}},
    {% if weight_videos > 0 %}
    "videos": {{weight_videos}}
    {% else %}
    "videos": 0
    {% endif %}
  },
  "sections": [
    {% for section in course_details.datetimes.sections %}
      {
        "title": "{{section.title}}",
        "room": "{{section.room}}",
        "day": {{section.day}},
        "start_time": {{section.start_time}},
        "end_time": {{section.end_time}}
      }{% unless forloop.last %},{% endunless %}
    {% endfor %}
  ],
  "assessments": [
{% for doc in page_data.docs %}
  {% unless doc.layout contains "week" %}{% continue %}{% endunless %}

  {% assign week_count = week_count | plus:1 %}
  {% assign week_number = datetimes.start_week | plus:week_count %}

  {% for tut in doc.video_tutorials %}
    {% if tut.videos %}
      {% capture url %}/topics/{{tut.url}}/{% endcapture %}
      {% include api-course-row.json title=tut.title group="video" id=tut.url grading_type="pass_fail" points=1 url=url first=first_entry datetimes=datetimes week_number=week_number due_offset=0 markbot_slug=tut.url course=page.collection %}
      {% assign first_entry = false %}
      {% capture total_videos %}{{total_videos | plus:1}}{% endcapture %}
    {% endif %}
  {% endfor %}

  {% for exercise in doc.tasks %}
    {% if exercise.graded-as %}
      {% unless found_projects contains exercise.graded-as %}
{'fraction_non_alphanumeric': 0.18728648121034652, 'fraction_numerical': 0.005612493899463153, 'mean_word_length': 3.212230215827338, 'pattern_counts': {'":': 79, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3708690', 'n_tokens_mistral': 2983, 'n_tokens_neox': 2618, 'n_words': 515}