<commit_before>{% extends "base.html" %}

{% load staticfiles %}
{% load crispy_forms_tags %}
{% load add_get_parameter %} 

{% block title %}{% with 'Assignments' as subtitle  %}
{{ block.super }}
{% endwith %}{% endblock %}

{% block navbar-left %}
{% include "_navbar.html" with active_link="Assignments" %}
{% endblock %}

{% block splash %}
{% endblock splash %}

{% block container %}
<div class="row-fluid">

  <div class="input-group-btn">
    <button type="button" class="btn btn-info">Courses:</button>
    <select class="selectpicker show-tick" >
        {% for course in courses  %}
            <option value="{{course.id}}" href="{% add_get selected_course_id=course.id %}" >{{course}}</option>
        {% empty %}
            <option >You are not enrolled in any course</option>
        {% endfor %}
    </select>
  </div>



</div>
<br>

<div class="row-fluid">
    <div class="list-group">


      {% for assignment in assignments %}
        <div class="list-group-item list-group-item-info toggle clearfix" id="dropdown-detail-{{ assignment.id }}" data-toggle="detail-{{ assignment.id }}" style="cursor: pointer; cursor: hand;">
                <h4 class="list-group-item-heading ">{{ assignment.Title }}
                </h4> 
        </div>

        <div id="detail-{{ assignment.id }}" style="display:none">
            <div class="panel panel-primary">                  
              <div class="panel-body">
                <ul class="list-group">
                    {% for exercise in exercises  %}
                        {% if exercise.Assignment == assignment %}
                            <li class="list-group-item clearfix">
                                <div class="col-xs-6">
                                    <h4 class="list-group-item-heading ">{{exercise.Description}}</h4>    
                                    {% for result in results  %}
                                        {% if result.Exercise == exercise %}
                                            <p class="list-group-item-text" style="margin-left:10px"> Last submit on: {{ result.Creation_date|date:"D d M Y" }} {{ result.Creation_date|time:"H:i" }} 
                                            {% if result.Pass %}
                                                , Status: <span class="label label-success">Passed</span>
                                            {% else %}    
                                                , Status: <span class="label label-warning">Not Passed</span>
                                            {% endif %}
                                                <a href="{% url 'courses:result-list' %}"> ( Show details ) </a>
                                            </p>                      
                                        {% endif %}
                                    {% endfor %}
                                    
                                </div>
                                <div class="col-xs-6">
                                    <a href="{% url 'courses:download-user-file' %}?ex_id={{exercise.id}}" type="button" class="btn btn-sm btn-primary pull-right">
                                    Download assignment</a>
                                </div>             
                            </li>
                            

                        {% endif %}
                    {% empty %}
                        <p> There are no exercises assigned. </p>
                    {% endfor %}                    
                </ul><commit_msg>download assignment renamed in download exercise<commit_after>{% extends "base.html" %}

{% load staticfiles %}
{% load crispy_forms_tags %}
{% load add_get_parameter %} 

{% block title %}{% with 'Assignments' as subtitle  %}
{{ block.super }}
{% endwith %}{% endblock %}

{% block navbar-left %}
{% include "_navbar.html" with active_link="Assignments" %}
{% endblock %}

{% block splash %}
{% endblock splash %}

{% block container %}
<div class="row-fluid">

  <div class="input-group-btn">
    <button type="button" class="btn btn-info">Courses:</button>
    <select class="selectpicker show-tick" >
        {% for course in courses  %}
            <option value="{{course.id}}" href="{% add_get selected_course_id=course.id %}" >{{course}}</option>
        {% empty %}
            <option >You are not enrolled in any course</option>
        {% endfor %}
    </select>
  </div>



</div>
<br>

<div class="row-fluid">
    <div class="list-group">


      {% for assignment in assignments %}
        <div class="list-group-item list-group-item-info toggle clearfix" id="dropdown-detail-{{ assignment.id }}" data-toggle="detail-{{ assignment.id }}" style="cursor: pointer; cursor: hand;">
                <h4 class="list-group-item-heading ">{{ assignment.Title }}
                </h4> 
        </div>

        <div id="detail-{{ assignment.id }}" style="display:none">
            <div class="panel panel-primary">                  
              <div class="panel-body">
                <ul class="list-group">
                    {% for exercise in exercises  %}
                        {% if exercise.Assignment == assignment %}
                            <li class="list-group-item clearfix">
                                <div class="col-xs-6">
                                    <h4 class="list-group-item-heading ">{{exercise.Description}}</h4>    
                                    {% for result in results  %}
                                        {% if result.Exercise == exercise %}
                                            <p class="list-group-item-text" style="margin-left:10px"> Last submit on: {{ result.Creation_date|date:"D d M Y" }} {{ result.Creation_date|time:"H:i" }} 
                                            {% if result.Pass %}
                                                , Status: <span class="label label-success">Passed</span>
                                            {% else %}    
                                                , Status: <span class="label label-warning">Not Passed</span>
                                            {% endif %}
                                                <a href="{% url 'courses:result-list' %}"> ( Show details ) </a>
                                            </p>                      
                                        {% endif %}
                                    {% endfor %}
                                    
                                </div>
                                <div class="col-xs-6">
                                    <a href="{% url 'courses:download-user-file' %}?ex_id={{exercise.id}}" type="button" class="btn btn-sm btn-primary pull-right">
                                    Download exercise</a>
                                </div>             
                            </li>
                            

                        {% endif %}
                    {% empty %}
                        <p> There are no exercises assigned. </p>
                    {% endfor %}                    
                </ul>
{'fraction_non_alphanumeric': 0.1369592785684092, 'fraction_numerical': 0.0022544737212906864, 'mean_word_length': 1.1600730371272063, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 58, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6635460', 'n_tokens_mistral': 1831, 'n_tokens_neox': 1622, 'n_words': 378}