diff --git a/README.md b/README.md
index bd66bd0..90be3d0 100644
--- a/README.md
+++ b/README.md
@@ -4,10 +4,10 @@
- [X] Timer is not working properly, fix it
- [X] When user gets a question correct, automatically redirect to next question
- [X] Add a live leaderboard
-- [ ] Change frontend
-- [ ] Add details in about section
-- [ ] Cursor does not goes up in the editor, fix it
+- [X] Change frontend - Leaderboard opening animation is inserted, might require to change other background colors and stuff later.
+- [X] Add details in about section
+- [X] Cursor does not goes up in the editor, fix it
- [ ] Do Backend stuff - do not put keys as it is within the files
-- [ ] Add feature to show code for sometime, say 5-10 seconds once per question
+- [X] Add feature to show code for sometime, say 5-10 seconds once per question
- [ ] Disable run button for the time compiler runs the code and returns the result to prevent multiple compiler runs
-- [ ] Limit number of runs per question per user
+- [X] Limit number of runs per question per user - feature not needed anymore
diff --git a/blind_coding/blind_coding/settings.py b/blind_coding/blind_coding/settings.py
index 7cf4434..d4e7522 100644
--- a/blind_coding/blind_coding/settings.py
+++ b/blind_coding/blind_coding/settings.py
@@ -137,5 +137,5 @@
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(REPOSITORY_ROOT, 'media/')
-clientId: "222a2ef84f6881409d32ae21369d1a32"
-clientSecret:"67872757630a355db890ee74b6b20926cb9e025dbb444182df2bd2700fc64af1"
+clientId = "222a2ef84f6881409d32ae21369d1a32"
+clientSecret = "67872757630a355db890ee74b6b20926cb9e025dbb444182df2bd2700fc64af1"
diff --git a/blind_coding/db.sqlite3 b/blind_coding/db.sqlite3
index b5ab100..6b7e412 100644
Binary files a/blind_coding/db.sqlite3 and b/blind_coding/db.sqlite3 differ
diff --git a/blind_coding/main_app/__pycache__/urls.cpython-36.pyc b/blind_coding/main_app/__pycache__/urls.cpython-36.pyc
new file mode 100644
index 0000000..c686f04
Binary files /dev/null and b/blind_coding/main_app/__pycache__/urls.cpython-36.pyc differ
diff --git a/blind_coding/main_app/__pycache__/views.cpython-36.pyc b/blind_coding/main_app/__pycache__/views.cpython-36.pyc
new file mode 100644
index 0000000..c6d899f
Binary files /dev/null and b/blind_coding/main_app/__pycache__/views.cpython-36.pyc differ
diff --git a/blind_coding/main_app/admin.py b/blind_coding/main_app/admin.py
index 9e89a0c..3f569ee 100644
--- a/blind_coding/main_app/admin.py
+++ b/blind_coding/main_app/admin.py
@@ -1,7 +1,8 @@
from __future__ import unicode_literals
from django.contrib import admin
-from .models import Question,Userdata
+from .models import Question,Userdata,Time_Penalty
# Register your models here.
admin.site.register(Question)
admin.site.register(Userdata)
+admin.site.register(Time_Penalty)
\ No newline at end of file
diff --git a/blind_coding/main_app/migrations/0002_auto_20200104_1324.py b/blind_coding/main_app/migrations/0002_auto_20200104_1324.py
new file mode 100644
index 0000000..a500cd2
--- /dev/null
+++ b/blind_coding/main_app/migrations/0002_auto_20200104_1324.py
@@ -0,0 +1,43 @@
+# Generated by Django 2.2.7 on 2020-01-04 07:54
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('main_app', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='question',
+ name='weight',
+ field=models.IntegerField(default=10),
+ preserve_default=False,
+ ),
+ migrations.AddField(
+ model_name='userdata',
+ name='total_penalty',
+ field=models.IntegerField(default=0),
+ ),
+ migrations.CreateModel(
+ name='Time_Penalty',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('time_penalty', models.IntegerField(default=0)),
+ ('no_wa', models.IntegerField(default=0)),
+ ('player', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main_app.Userdata')),
+ ('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='questions', to='main_app.Question')),
+ ],
+ options={
+ 'unique_together': {('player', 'question')},
+ },
+ ),
+ migrations.AddField(
+ model_name='question',
+ name='time_penalty',
+ field=models.ManyToManyField(blank=True, null=True, through='main_app.Time_Penalty', to='main_app.Userdata'),
+ ),
+ ]
diff --git a/blind_coding/main_app/migrations/0003_auto_20200104_1332.py b/blind_coding/main_app/migrations/0003_auto_20200104_1332.py
new file mode 100644
index 0000000..ff0fc09
--- /dev/null
+++ b/blind_coding/main_app/migrations/0003_auto_20200104_1332.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.7 on 2020-01-04 08:02
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('main_app', '0002_auto_20200104_1324'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='question',
+ name='weight',
+ field=models.IntegerField(default=20),
+ ),
+ ]
diff --git a/blind_coding/main_app/models.py b/blind_coding/main_app/models.py
index f58d542..c5b5808 100644
--- a/blind_coding/main_app/models.py
+++ b/blind_coding/main_app/models.py
@@ -8,13 +8,16 @@ class Userdata(models.Model):
score = models.IntegerField(default = 0)
answerGiven = models.CharField(max_length = 10, default="00000")
timeElapsed = models.IntegerField(default = 0)
-
+ total_penalty=models.IntegerField(default = 0)
+
def __str__(self):
return str(self.user_id.username)
class Question(models.Model):
qno=models.IntegerField(default=0)
+ weight = models.IntegerField(default=20)
text = models.CharField(max_length=45000)
+ time_penalty = models.ManyToManyField(Userdata, through="Time_Penalty",blank=True,null=True)
testcaseno=models.IntegerField(default=0)
samplein = models.CharField(max_length=45000,default='')
sampleout = models.CharField(max_length=45000,default='')
@@ -27,3 +30,15 @@ class Question(models.Model):
def __str__(self):
return str(self.pk)
+
+class Time_Penalty(models.Model):
+ player = models.ForeignKey(Userdata, on_delete=models.CASCADE)
+ question = models.ForeignKey(Question, on_delete=models.CASCADE,related_name='questions')
+ time_penalty = models.IntegerField(default=0)
+ no_wa = models.IntegerField(default=0)
+
+ class Meta:
+ unique_together = ("player", "question")
+
+ def __str__(self):
+ return "{} : {}".format(self.player.name, self.question.qno)
diff --git a/blind_coding/main_app/templates/loggedIn.html b/blind_coding/main_app/templates/loggedIn.html
index 34eaf9e..724b4e2 100644
--- a/blind_coding/main_app/templates/loggedIn.html
+++ b/blind_coding/main_app/templates/loggedIn.html
@@ -11,6 +11,7 @@
+
@@ -60,20 +61,23 @@
-
-
+
+
-
About
-
1. What is Lorem Ipsum?
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
-
2. Where does it come from?
-
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested.
-
+
Instructions
+
- There are five questions of varying difficulties and points associated with them. Score associated are 20, 30, 40, 50, 60 points respectively.
+
- For every question, the first time you submit the correct answer, you are awarded points corresponding to that question and the time penalty is
+ also calculated which takes into consideration the time taken until last successful solve together with the number of wrong attempts
+
- Standings will be based on the points scored and in cases of clashes, time penalties are compared and one with lesser time penalty is better ranker
+
- Every time you give a correct answer, the question is automatically changed and code editor is reset.
+
- You have only two attempts throughout the event to see the code you have written. To see the code, press Show Code button near Run button.
+
- Don't try to open up the console or changing the window/tab. You'll be logged out immediately