Commit ee8366d7 authored by Rahul-chunduru's avatar Rahul-chunduru

ui for view test

parents 4bab9768 4d542e9d
{
"python.pythonPath": "/usr/bin/python",
"python.linting.pylintEnabled": true,
"python.linting.pylamaEnabled": false,
"python.linting.enabled": true,
"python.jediEnabled": false
}
\ No newline at end of file
python3
\ No newline at end of file
/usr/bin/python3
\ No newline at end of file
...@@ -40,6 +40,7 @@ INSTALLED_APPS = [ ...@@ -40,6 +40,7 @@ INSTALLED_APPS = [
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
# 'datetimepicker',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
......
...@@ -2,8 +2,9 @@ from django import forms ...@@ -2,8 +2,9 @@ from django import forms
from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User from django.contrib.auth.models import User
from .models import * from .models import *
from django.forms.widgets import Select, Widget,DateTimeInput,TimeInput
import datetime
from datetimepicker.widgets import DateTimePicker
# class QuestionForm(forms.ModelForm): # class QuestionForm(forms.ModelForm):
# class Meta: # class Meta:
...@@ -16,7 +17,19 @@ from .models import * ...@@ -16,7 +17,19 @@ from .models import *
# model = Options # model = Options
# fields = ('option_value',) # fields = ('option_value',)
class TestForm(forms.ModelForm): VISIBILITY_CHOICES= ('1980', '1981', '1982')
# class TestForm(forms.ModelForm):
# # start_time = forms.DateTimeField(widget=DateTimePicker(), initial=datetime.datetime.now())
# start_time = forms.DateTimeField(widget=DateTimeInput, initial=datetime.datetime.now())
# expected_time_for_completion = forms.TimeField(widget=TimeInput,initial=datetime.datetime.now())
# class Meta:
# model = Test
# exclude = ['test_ID', 'ownership']
class TestForm(forms.ModelForm):
class Meta: class Meta:
model = Test model = Test
exclude = ['test_ID', 'ownsership'] exclude = ['test_ID', 'ownsership']
\ No newline at end of file
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-06 21:27 # Generated by Django 1.11.16 on 2018-11-24 13:16
from __future__ import unicode_literals from __future__ import unicode_literals
import django.core.validators import django.core.validators
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
require('../../js/transition.js')
require('../../js/alert.js')
require('../../js/button.js')
require('../../js/carousel.js')
require('../../js/collapse.js')
require('../../js/dropdown.js')
require('../../js/modal.js')
require('../../js/tooltip.js')
require('../../js/popover.js')
require('../../js/scrollspy.js')
require('../../js/tab.js')
require('../../js/affix.js')
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
...@@ -7,6 +7,14 @@ ...@@ -7,6 +7,14 @@
Create Test Create Test
{%endblock%} {%endblock%}
{%block head%}
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script>
{%endblock%}
{%block body%} {%block body%}
<h1> You CAN CREATE A Test HERE prof {{username}}</h1> <h1> You CAN CREATE A Test HERE prof {{username}}</h1>
...@@ -21,6 +29,8 @@ Create Test ...@@ -21,6 +29,8 @@ Create Test
<form method="POST" action="create_Test"> <form method="POST" action="create_Test">
{% csrf_token %} {% csrf_token %}
{{ TestForm }} {{ TestForm }}
{{TestForm.errors}}
{{TestForm.non_field_errors}}
{%for question in questions%} {%for question in questions%}
<li class="list-group-item"> <li class="list-group-item">
<!-- <li> --> <!-- <li> -->
...@@ -34,16 +44,20 @@ Create Test ...@@ -34,16 +44,20 @@ Create Test
<hr></hr> <hr></hr>
<ul> <ul>
{%for option in question.option_details%} {%for option in question.option_details%}
<li> {{option.is_answer}} {%if option.is_answer %}
{{option.option_text}} <li>
</li> <p style="color: green"> {{option.option_text}} </p>
</li>
<!-- marks --> {%else%}
<li>
{{option.option_text}}
</li>
{%endif%}
{%endfor%} {%endfor%}
<label> marks <label> marks
<input type="number" name="{{question.q_id}}1" min="0" max="10" placeholder="4" step="0.25" value="4"> <input type="number" name="{{question.q_id}}" min="0" max="10" placeholder="4" step="0.25" value="4">
<input type="number" name="{{question.q_id}}2" min="-10" max="0" placeholder="-1" step="0.25" value="0"> <input type="number" name="{{question.q_id}}" min="-10" max="0" placeholder="-1" step="0.25" value="0">
</label> </label>
</ul> </ul>
......
...@@ -5,9 +5,9 @@ profile ...@@ -5,9 +5,9 @@ profile
{%endblock%} {%endblock%}
{%block head%} {%block head%}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <!-- <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> -->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <!-- <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> -->
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!-- <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> -->
{% load static %} {% load static %}
<link rel="stylesheet" href="{% static 'ARFA_app/home.css' %}" type="text/css"> <link rel="stylesheet" href="{% static 'ARFA_app/home.css' %}" type="text/css">
...@@ -40,11 +40,11 @@ profile ...@@ -40,11 +40,11 @@ profile
}); });
</script> </script>
<script type='text/javascript'> <!-- <script type='text/javascript'>
function preventBack(){window.history.forward();} function preventBack(){window.history.forward();}
setTimeout("preventBack()",0); setTimeout("preventBack()",0);
window.onunload =function(){null}; window.onunload =function(){null};
</script> </script> -->
{%endblock%} {%endblock%}
{%block body%} {%block body%}
......
...@@ -46,11 +46,11 @@ profile ...@@ -46,11 +46,11 @@ profile
}); });
</script> </script>
<script type='text/javascript'> <!-- <script type='text/javascript'>
function preventBack(){window.history.forward();} function preventBack(){window.history.forward();}
setTimeout("preventBack()",0); setTimeout("preventBack()",0);
window.onunload =function(){null}; window.onunload =function(){null};
</script> </script> -->
{%endblock%} {%endblock%}
{%block body%} {%block body%}
...@@ -197,13 +197,13 @@ profile ...@@ -197,13 +197,13 @@ profile
</h2> </h2>
<center><i class="fa fa-cloud-upload fa-4x"></i></center> <center><i class="fa fa-cloud-upload fa-4x"></i></center>
<div class="share-links"> <div class="share-links">
<a href="/arfa/view_my_tests"> <a href="/arfa/studentTestHome">
<center><button type="button" class="btn btn-lg btn-labeled btn-success" href="#" style="margin-bottom: 15px;"> <center><button type="button" class="btn btn-lg btn-labeled btn-success" href="#" style="margin-bottom: 15px;">
<span class="btn-label"><i class="fa fa-bell-o"></i></span> Take a test <span class="btn-label"><i class="fa fa-bell-o"></i></span>Take Test
</button></center> </button></center>
</a> </a>
<center><button type="button" class="btn btn-lg btn-labeled btn-warning" href="#"> <center><button type="button" class="btn btn-lg btn-labeled btn-warning" href="#">
<span class="btn-label"><i class="fa fa-bell-o"></i></span> View previous tests <span class="btn-label"><i class="fa fa-bell-o"></i></span>Resume Test
</button></center> </button></center>
</div> </div>
</div> </div>
......
{%extends 'base2.html'%}
{%block head%}
{%endblock%}
{%block title%}
My Tests
{%endblock%}
{%block body%}
<h1>Currently Active Tests </h1>
<div class="container">
<div class="panel-default">
<div class="panel-heading">
<h3 class="panel-title">Active Tests</h3>
</div>
<ul class="list-group">
{% for t in activeTests %}
<div>
<p>{{t.test_ID}}</p>
<p>{{t.test_name}}</p>
</div>
<div style="float:right">
<form method="POST" action="loadStudentTest">
<input name="testID" value="{{t.test_ID}}" type="hidden">
<button>Load Test</button>
</form>
</div>
{% endfor %}
</ul>
</div>
</div>
</div>
{% if practiceTests %}
<div class="container">
<div class="panel-default">
<div class="panel-heading">
<h3 class="panel-title">Practice Tests</h3>
</div>
<ul class="list-group">
{% for t in practiceTests %}
<div>
<p>{{t.test_ID}}</p>
<p>{{t.test_name}}</p>
</div>
<div style="float:right">
<form method="POST" action="loadStudentTest">
<input name="testID" value="{{t.test_ID}}" type="hidden">
<button>Load Test</button>
</form>
</div>
{% endfor %}
</ul>
</div>
</div>
</div>
{% endif %}
{%endblock%}
\ No newline at end of file
...@@ -34,13 +34,15 @@ View personal Question ...@@ -34,13 +34,15 @@ View personal Question
<!-- <div class="fluid-row"> --> <!-- <div class="fluid-row"> -->
<ul> <ul>
{%for option in question.option_details%} {%for option in question.option_details%}
<!-- <div class="col-xs-1"> --> {%if option.is_answer %}
<li> {{option.is_answer}} <li>
<!-- </div> --> <p style="color: green"> {{option.option_text}} </p>
<!-- <div class="col-xs-5"> --> </li>
{{option.option_text}} {%else%}
<!-- </div> --> <li>
</li> {{option.option_text}}
</li>
{%endif%}
{%endfor%} {%endfor%}
</ul> </ul>
<!-- </div> --> <!-- </div> -->
......
...@@ -6,10 +6,34 @@ ...@@ -6,10 +6,34 @@
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script> </script>
{%endblock%} {%endblock%}
{%block title%} {%block title%}
View personal Test View personal Question
{%endblock%} {%endblock%}
{%block body%} {%block body%}
<h1> You CAN VIEW personal Test HERE prof {{username}}</h1> <h1> You CAN VIEW your tests prof {{username}}</h1>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css">
<div class="container">
<div class="panel-default">
<div class="panel-heading">
<h3 class="panel-title">LIST OF TESTS</h3>
</div>
<ul class="list-group">
<!-- <ul> -->
{%for test in tests%}
<li class="list-group-item">
<!-- <li> -->
<div class="row toggle">
<div class="col-xs-10">
{{test.test_name}}
</div>
</div>
<div>
<hr></hr>
</div>
</li>
{%endfor%}
</ul>
</div>
</div>
{%endblock%} {%endblock%}
\ No newline at end of file
{%extends 'base2.html'%} {%extends 'base2.html'%}
{%block head%} {%block head%}
{%load static%}
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML"> <script src="{% static 'ARFA_app/lib/mathjax/MathJax.js' %}">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script> </script>
{%endblock%} {%endblock%}
...@@ -29,21 +29,19 @@ View personal Question ...@@ -29,21 +29,19 @@ View personal Question
</div> </div>
<div> <div>
<hr></hr> <hr></hr>
<!-- <div class="container"> -->
<!-- <div class="fluid-row"> -->
<ul> <ul>
{%for option in question.option_details%} {%for option in question.option_details%}
<!-- <div class="col-xs-1"> --> {%if option.is_answer %}
<li> {{option.is_answer}} <li>
<!-- </div> --> <p style="color: green"> {{option.option_text}} </p>
<!-- <div class="col-xs-5"> --> </li>
{{option.option_text}} {%else%}
<!-- </div> --> <li>
</li> {{option.option_text}}
</li>
{%endif%}
{%endfor%} {%endfor%}
</ul> </ul>
<!-- </div> -->
<!-- </div> -->
</div> </div>
</li> </li>
{%endfor%} {%endfor%}
......
...@@ -3,9 +3,13 @@ ...@@ -3,9 +3,13 @@
<html> <html>
<head> <head>
<!-- Latest compiled and minified CSS --> <!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> {% load static %}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <link rel="stylesheet" href="{% static 'ARFA_app/lib/bootstrap-3.3.7-dist/css/bootstrap.min.css' %}" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> -->
<script src="{% static 'ARFA_app/lib/jquery/jquery-3.3.1.min.js' %}"></script>
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> -->
<script src="{% static 'ARFA_app/lib/bootstrap-3.3.7-dist/js/bootstrap.min.js' %}"></script>
<!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Architects+Daughter|Bellefair|Inconsolata|Indie+Flower|Lemonada|Lobster|Noto+Sans|Oswald|Plaster" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Architects+Daughter|Bellefair|Inconsolata|Indie+Flower|Lemonada|Lobster|Noto+Sans|Oswald|Plaster" rel="stylesheet">
<title> <title>
......
...@@ -25,6 +25,6 @@ urlpatterns=[ ...@@ -25,6 +25,6 @@ urlpatterns=[
url(r'^add_question',views.add_question), url(r'^add_question',views.add_question),
url(r'^register',views.register), url(r'^register',views.register),
url(r'^reg',views.reg), url(r'^reg',views.reg),
url(r'^studentTestHome', views.studentTestHome)
] ]
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment