summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yaksh/forms.py2
-rw-r--r--yaksh/static/yaksh/css/custom.css7
-rw-r--r--yaksh/templates/yaksh/question.html45
3 files changed, 32 insertions, 22 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py
index 1cd1291..3c4d664 100644
--- a/yaksh/forms.py
+++ b/yaksh/forms.py
@@ -299,7 +299,7 @@ class QuestionForm(forms.ModelForm):
{'class': 'custom-select'}
)
self.fields['topic'].widget.attrs.update(
- {'class': 'custom-select'}
+ {'class': form_input_class, 'placeholder': 'Topic name'}
)
self.fields['type'].widget.attrs.update(
{'class': 'custom-select'}
diff --git a/yaksh/static/yaksh/css/custom.css b/yaksh/static/yaksh/css/custom.css
index 3979e3e..a9c8e27 100644
--- a/yaksh/static/yaksh/css/custom.css
+++ b/yaksh/static/yaksh/css/custom.css
@@ -117,4 +117,11 @@ body, .dropdown-menu {
.description {
font-size: 16px;
+}
+
+/* ---------------------------------------------------
+ Quiz qusetion style
+----------------------------------------------------- */
+#question_card {
+ border: none;
} \ No newline at end of file
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html
index 92d591f..640003b 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -107,10 +107,10 @@ function call_skip(url)
form.submit();
}
init_val = '{{ last_attempt|escape_quotes|safe }}';
-lang = "{{ question.language }}"
-course_id = "{{course.id}}"
-module_id = "{{module.id}}"
-question_type = "{{ question.type }}"
+lang = "{{ question.language }}";
+course_id = "{{course.id}}";
+module_id = "{{module.id}}";
+question_type = "{{ question.type }}";
</script>
{% endblock script %}
@@ -146,39 +146,42 @@ question_type = "{{ question.type }}"
<form id="code" action="{% url 'yaksh:check' question.id paper.attempt_number module.id paper.question_paper.id course.id %}" method="post" enctype="multipart/form-data">
{% csrf_token %}
<input type=hidden name="question_id" id="question_id" value="{{ question.id }}"></input>
- <div class="card">
+ <div class="card" id="question_card">
<div class="card-header">
- <div class="row">
- <div class="col-md-6">
- {{ question.summary }}
+ <div>
+ <div>
+ <h2>{{ question.summary }}</h2>
</div>
- <div class="col-md-4">
+ <div>
+ {% if question.language == "other" %}
+ <small class="text text-muted"><strong>Topic:</strong> <span class="badge badge-primary">{{question.topic}}</small></span>
+ {% else %}
+ <small class="textx text-muted"><strong>Language:</strong> <span class="badge badge-primary">{{question.language}}</span></small>
+ {% endif %}
{% if question.type == "mcq" %}
- SINGLE CORRECT CHOICE
+ <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">SINGLE CORRECT CHOICE</span></small>
{% elif question.type == "mcc" %}
- MULTIPLE CORRECT CHOICES
+ <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">MULTIPLE CORRECT CHOICES</span></small>
{% elif question.type == "code" %}
- PROGRAMMING
+ <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">PROGRAMMING</span></small>
{% elif question.type == "upload" %}
- ASSIGNMENT UPLOAD
+ <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">ASSIGNMENT UPLOAD</span></small>
{% elif question.type == "integer" %}
- FILL IN THE BLANKS WITH INTEGER ANSWER
+ <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">FILL IN THE BLANKS WITH INTEGER ANSWER</span></small>
{% elif question.type == "string" %}
- FILL IN THE BLANKS WITH STRING ANSWER
+ <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">FILL IN THE BLANKS WITH STRING ANSWER</span></small>
{% if testcase.string_check == "lower" %}
<br>(CASE INSENSITIVE)
{% else %}
<br>(CASE SENSITIVE)
{% endif %}
{% elif question.type == "float" %}
- FILL IN THE BLANKS WITH FLOAT ANSWER
+ <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">FILL IN THE BLANKS WITH FLOAT ANSWER</span></small>
{% elif question.type == "arrange" %}
- ARRANGE THE OPTIONS IN CORRECT ORDER
+ <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">ARRANGE THE OPTIONS IN CORRECT ORDER</span></small>
{% endif %}
- </div>
- <div class="col-md-2">
- <span class="badge badge-info">
- {{ question.points }} Marks
+ <span class="badge badge-info pull-right">
+ <small><strong>Marks: {{ question.points }}</strong></small>
</span>
</div>
</div>