{% extends "notes/base.html" %}
{%load static%}
{%load viewans%}
{% block content %}
{%if user.is_authenticated%}
<p style="font-size: small;">Practice <a href="{%url 'coder:list-python'%}">Python</a> | <a
        href="{%url 'coder:list-java'%}">Java</a> | <a href="{%url 'coder:list-general'%}">General</a> |<a
        href="{%url 'coder:home'%}"> Look at what "Practice is all
        about".</a></p>
{%notsolved user question as result%}
{%if result%}
<h2 class="article-title" style="color: rgb(255, 255, 255);">{{ question.title }}</h2>
<span class="badge badge-light badge-pill">{{question.category}}</span>
<span class="badge badge-dark badge-pill">{{question.typeof}}</span>
{%else%}
<h2 class="article-title" style="color: rgb(255, 255, 255);">{{ question.title }} </h2>
<span class="badge badge-light badge-pill">{{question.category}}</span>
<span class="badge badge-dark badge-pill">{{question.typeof}}</span>
<small>Solved <img src="{%static 'coder/check.svg'%}" height="14" width="14"></a> </small>
{%endif%}
{%else%}
<h2 class="article-title" style="color: rgb(255, 255, 255);">{{ question.title }}</h2>
<span class="badge badge-light badge-pill">{{question.category}}</span>
<span class="badge badge-dark badge-pill">{{question.typeof}}</span>
{%endif%}

<div class="article-content shadow">
    {{question.content|safe}}
</div>



<br>

{%if user.is_authenticated%}
{%notsolved user question as result%}
{%if result%}
<span class="badge badge-dark badge-pill"> <a class="nav-item nav-link" href="{%url 'coder:submit' object.slug%}">Submit
        Answer</a></span>
<small><a href="{%url 'coder:submissions'%}">View your submissions and results here.</a></small>
{%else%}
<small><a href="{%url 'coder:submissions'%}">View your submissions and results here.</a></small>
{%endif%}
{%else%}
<span class="badge badge-dark badge-pill"> <a class="nav-item nav-link" href="{%url 'coder:submit' object.slug%}">Submit
        Answer</a></span>
{%endif%}
<hr>
<br>
<div class="article-content shadow">
    <p> <strong>NOTE</strong>

        These questions can be solved in either <i class="fab fa-java"> Java </i>, <i class="fab fa-python"> Python
        </i>,
        <i class="fab fa-rust"> Rust</i>, <i class="devicon-cplusplus-plain"> C++</i>, <i
            class="devicon-go-plain">Go</i> or <i class="devicon-c-plain"></i> !

        However, the language intended for these questions is mentioned along with the question on the top.
        You need to submit the solution file for the autograder to grade the submission.

        <strong>If you are submitting in Java, make sure that the class name is Main (with a capital M)</strong>
    </p>
</div>
<br>

{%if question.typeof == "PYTHON"%}
<p>Optional Python Editor for your use</p>
<iframe src="https://trinket.io/embed/python3/9d578a67e3" width="90%" height="400" frameborder="0" marginwidth="0"
    marginheight="0"></iframe>
{%elif question.typeof == "JAVA"%}
<p>Optional Java Editor for your use</p>
<iframe src="https://trinket.io/embed/java/d1fcaa7e44" width="90%" height="500" frameborder="0" marginwidth="0"
    marginheight="0" allowfullscreen></iframe>
{%elif question.typeof == "General"%}
<p>Optional Python Editor for your use</p>
<iframe src="https://trinket.io/embed/python3/9d578a67e3" width="90%" height="400" frameborder="0" marginwidth="0"
    marginheight="0"></iframe>
<p>Optional Java Editor for your use</p>
<iframe src="https://trinket.io/embed/java/d1fcaa7e44" width="90%" height="500" frameborder="0" marginwidth="0"
    marginheight="0" allowfullscreen></iframe>
{%endif%}
{% endblock content %}
