From dfb9c4b5d6de17187bffd0e3c793737275202cb9 Mon Sep 17 00:00:00 2001 From: adityacp Date: Mon, 20 Jun 2016 14:58:08 +0530 Subject: added form to upload files --- yaksh/templates/yaksh/add_question.html | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'yaksh/templates') diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html index 255deaa..858a8f3 100644 --- a/yaksh/templates/yaksh/add_question.html +++ b/yaksh/templates/yaksh/add_question.html @@ -15,19 +15,27 @@ {% block onload %} onload='javascript:textareaformat();' {% endblock %} {% block manage %} -
+ {% csrf_token %}
Summary: {{ form.summary }}{{ form.summary.errors }}
Language: {{form.language}}{{form.language.errors}}
Active: {{ form.active }}{{form.active.errors}}   Type:  {{ form.type }}{{form.type.errors}} -
Points:{{ form.points }}{{ form.points.errors }} +
Points:{{form.points }}{{ form.points.errors }}
Rendered:

Description: {{ form.description}} {{form.description.errors}}
Tags: {{ form.tags }}
Snippet: {{ form.snippet }}
Test Case Type: {{ form.test_case_type }}{{ form.test_case_type.errors }} - +
File: {{ upload_form.file_field }}{{ upload_form.file_field.errors }} + {% if uploaded_files %}
Uploaded files:
Check the box to delete or extract files
+ {% for file in uploaded_files %} +  delete  + {% if file.extract %} dont extract{% else %} + extract{% endif %}
+ {{ file.files.name }} +
+ {% endfor %}{% endif %}
{{ test_case_formset.management_form }} @@ -43,6 +51,7 @@
+
{% endblock %} -- cgit From 1785d2613b8a56b0204c257b31e721be7032515a Mon Sep 17 00:00:00 2001 From: adityacp Date: Mon, 20 Jun 2016 14:58:53 +0530 Subject: students can download files --- yaksh/templates/yaksh/question.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'yaksh/templates') diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 40d4482..24de815 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -142,7 +142,14 @@ function call_skip(url)

{{ question.summary }} (Marks : {{ question.points }})


{{ question.description|safe }}
Language: {{ question.language }}
- + {% if files %} +

Files to download for this question

+ {% for file in files %} + {% if file.question_id == question.id %} +
{{file.files.name}}
+ {% endif %} + {% endfor %} + {% endif %} {% if question.type == "code" %}

Output:


{% if error_message %} -- cgit From 83bee9d89e163e98504c8aa210ce60200bd1cd1d Mon Sep 17 00:00:00 2001 From: adityacp Date: Thu, 28 Jul 2016 15:55:35 +0530 Subject: changes in templates to get question file url and name --- yaksh/templates/yaksh/add_question.html | 2 +- yaksh/templates/yaksh/question.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'yaksh/templates') diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html index 858a8f3..f003256 100644 --- a/yaksh/templates/yaksh/add_question.html +++ b/yaksh/templates/yaksh/add_question.html @@ -33,7 +33,7 @@  delete  {% if file.extract %} dont extract{% else %} extract{% endif %}
- {{ file.files.name }} + {{ file.file.name }}
{% endfor %}{% endif %}
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 24de815..2d52009 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -146,7 +146,7 @@ function call_skip(url)

Files to download for this question

{% for file in files %} {% if file.question_id == question.id %} -
{{file.files.name}}
+
{{file.file.name}}
{% endif %} {% endfor %} {% endif %} -- cgit