Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nirav branch #1

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bosm/settings.py
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/

# SITE_ID = 2
SITE_ID = 2

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
1 change: 0 additions & 1 deletion bosm/urls.py
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
urlpatterns = [
url(r'^$', main, name='main'),
url(r'^admin/', admin.site.urls),
#url(r'^accounts/', include('allauth.urls')),
url(r'^accounts/', include('social_django.urls')),
url(r'^accounts/profile/', include('sportzilla.urls')),
url(r'^logout/$', views.logout, name='logout'),
17 changes: 9 additions & 8 deletions sportzilla/static/js/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
av=[1,1,1,1,1] ; // availabilty of questions for each stadium 1:available 0:not available
av=[1,1,1,1,1] ; // availabilty of questions for each Arena 1:available 0:not available
left=[0.125,0.31,0.52,0.72,0.92]; // left constraint for popup visibility
right=[0.16,0.36,0.56,0.77,0.97]; // right constraint for popup visibility
// device detection
@@ -123,9 +123,10 @@ function skipQues(x) {

// --------------AJAX Code after this------------

function getInitialQuestions(current) { //Invoked when first time any Stadium div is opened.
function getInitialQuestions(current) { //Invoked when first time any Arena div is opened.
$.ajax({
url : "http://127.0.0.1:8000/accounts/profile/"+current+"/",
// url : "http://127.0.0.1:8000/accounts/profile/"+current+"/",
url : "http://abhishekspeer.pythonanywhere.com/accounts/profile/"+current+"/",
type: "GET",
data: {'number':current},
dataType: 'json',
@@ -158,7 +159,7 @@ function getInitialQuestions(current) { //Invoked when first time any Stadium di
});
}
function getAnsResponse(answer, qno, current) { //Question no. Answer is passed. Check Answer and return.
var url1="http://127.0.0.1:8000/accounts/profile/"+current+"/answer/";
var url1="http://abhishekspeer.pythonanywhere.com/accounts/profile/"+current+"/answer/"; // change to 127.0.0.1:8000 when testing locally
$.ajax({
url : url1,
type: "GET",
@@ -194,7 +195,7 @@ function getAnsResponse(answer, qno, current) { //Question no. Answer is passed.
}
function getSkipResponse(qno, current) { //Question Number attempted passed when skip is clicked. Deduct 25 points.
$.ajax({
url : "http://127.0.0.1:8000/accounts/profile/"+current+"/skip/",
url : "http://abhishekspeer.pythonanywhere.com/accounts/profile/"+current+"/skip/", // change to 127.0.0.1:8000 when testing locally
type: "GET",
data: {'number':current},
dataType: 'json',
@@ -227,9 +228,9 @@ function getSkipResponse(qno, current) { //Question Number attempted passed when
});
}
function getCloseDivResponse (current) {
//Stadium number is passed when Leave Stadium is clicked deduct 50 points
//Arena number is passed when Leave Arena is clicked deduct 50 points
$.ajax({
url : "http://127.0.0.1:8000/accounts/profile/"+current+"/leave/",
url : "http://abhishekspeer.pythonanywhere.com/accounts/profile/"+current+"/leave/", // change to 127.0.0.1:8000 when testing locally
type: "GET",
//data: {'number':current},
//dataType: 'json',
@@ -246,7 +247,7 @@ function getCloseDivResponse (current) {
}
function getLeaderboard() {
$.ajax({
url : "http://127.0.0.1:8000/accounts/profile/leaderboard/",
url : "http://abhishekspeer.pythonanywhere.com/accounts/profile/leaderboard/",// change to 127.0.0.1:8000 when testing locally
type : "GET",
beforeSend : function() {
document.getElementById('position').innerHTML = "Please Wait...";
26 changes: 13 additions & 13 deletions sportzilla/templates/index.html
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@
<div class="front scroll">
<img src="{% static 'images/front.png'%}" alt="" />

<!-- Stadium one, popup question availability -->
<!-- Arena one, popup question availability -->
<div class="quesAvailableDiv wow zoomInDown stad1 popup" id="Available1" data-wow-duration="0.5s">
<span class="questionAvailable">Football Quiz <br/> Questions are available</span><br/>
<span class="play" onclick="displayQuiz(0)">Play</span>
@@ -81,7 +81,7 @@
<span class="leave" onclick="dismissPopUp(0)">Leave</span>
</div>

<!-- stadium two, popup question availability-->
<!-- Arena two, popup question availability-->
<div class="quesAvailableDiv wow zoomInDown stad2 popup" id="Available2" data-wow-duration="0.5s">
<span class="questionAvailable">Cricket Quiz <br/>Questions are available</span><br/>
<span class="play" onclick="displayQuiz(1)">Play</span>
@@ -92,7 +92,7 @@
<span class="leave" onclick="dismissPopUp(1)">Leave</span>
</div>

<!-- stadium three, popup question availability-->
<!-- Arena three, popup question availability-->
<div class="quesAvailableDiv wow zoomInDown stad3 popup" id="Available3" data-wow-duration="0.5s">
<span class="questionAvailable">Miscellaneous Quiz <br/>Questions are available</span><br/>
<span class="play" onclick="displayQuiz(2)">Play</span>
@@ -103,7 +103,7 @@
<span class="leave" onclick="dismissPopUp(2)">Leave</span>
</div>

<!-- stadium four, popup question availability-->
<!-- Arena four, popup question availability-->
<div class="quesAvailableDiv wow zoomInDown stad4 popup" id="Available4" data-wow-duration="0.5s">
<span class="questionAvailable">Track & Field Quiz <br/>Questions are available</span><br/>
<span class="play" onclick="displayQuiz(3)">Play</span>
@@ -114,7 +114,7 @@
<span class="leave" onclick="dismissPopUp(3)">Leave</span>
</div>

<!-- stadium five, popup question availability-->
<!-- Arena five, popup question availability-->
<div class="quesAvailableDiv wow zoomInDown stad5 popup" id="Available5" data-wow-duration="0.5s">
<span class="questionAvailable">Extras Quiz <br/>Questions are available</span><br/>
<span class="play" onclick="displayQuiz(4)">Play</span>
@@ -140,7 +140,7 @@
</div>
<div class="skips-left">Skips Left : <span class="skipsLeft">{{skip}}</span></div>
</div>
<div class="quiz-sim-Footer-1"><span onclick="dismissDiv(1)" id="button">LEAVE STADIUM</span></div>
<div class="quiz-sim-Footer-1"><span onclick="dismissDiv(1)" id="button">LEAVE Arena</span></div>
</div>

<!-- Second Quiz -->
@@ -157,7 +157,7 @@
</div>
<div class="skips-left">Skips Left : <span class="skipsLeft">{{skip}}</span></div>
</div>
<div class="quiz-sim-Footer-2"><span onclick="dismissDiv(2)" id="button">LEAVE STADIUM</span></div>
<div class="quiz-sim-Footer-2"><span onclick="dismissDiv(2)" id="button">LEAVE Arena</span></div>
</div>

<!-- Third Quiz -->
@@ -174,7 +174,7 @@
</div>
<div class="skips-left">Skips Left : <span class="skipsLeft">{{skip}}</span></div>
</div>
<div class="quiz-sim-Footer-3"><span onclick="dismissDiv(3)" id="button">LEAVE STADIUM</span></div>
<div class="quiz-sim-Footer-3"><span onclick="dismissDiv(3)" id="button">LEAVE Arena</span></div>
</div>

<!-- Fourth Quiz -->
@@ -191,7 +191,7 @@
</div>
<div class="skips-left">Skips Left : <span class="skipsLeft">{{skip}}</span></div>
</div>
<div class="quiz-sim-Footer-4"><span onclick="dismissDiv(4)" id="button">LEAVE STADIUM</span></div>
<div class="quiz-sim-Footer-4"><span onclick="dismissDiv(4)" id="button">LEAVE Arena</span></div>
</div>

<!-- Fifth Quiz -->
@@ -208,17 +208,17 @@
</div>
<div class="skips-left">Skips Left : <span class="skipsLeft">{{skip}}</span></div>
</div>
<div class="quiz-sim-Footer-5"><span onclick="dismissDiv(5)" id="button">LEAVE STADIUM</span></div>
<div class="quiz-sim-Footer-5"><span onclick="dismissDiv(5)" id="button">LEAVE Arena</span></div>
</div>

<!-- Instructions -->
<div class="ins-sim-Div wow slideInDown" id="instructionsDiv">
<div class="ins-sim-Title"><img src="images/instruct.svg" height="25vh">Instructions</div>
<div class="ins-sim-Body" style="display: flex; flex-direction: column; justify-content: center; align-items: flex-start; justify-content: space-around; ">
<span>1. Swipe Up/Down or use Up/Down Arrow keys to roam around the city of "Sportsville".</span>
<span>2. Reach near the arrow close to unique stadiums and answer pic-connect type questions to gain maximum points and make it to the leaderboard.</span>
<span>3. You can skip at most 3 questions and have liberty to leave a stadium to reach other.</span>
<span>4. Correct Answer: x points. Skipping Question: -y points. Leaving Stadium: -z points.</span>
<span>2. Reach near the arrow close to unique Arenas and answer pic-connect type questions to gain maximum points and make it to the leaderboard.</span>
<span>3. You can skip at most 3 questions and have liberty to leave a Arena to reach other.</span>
<span>4. Correct Answer: x points. Skipping Question: -y points. Leaving Arena: -z points.</span>
</div>
<div class="ins-sim-Footer"><span onclick="dismissDiv()" id="button">CLOSE</span></div>
</div>
3 changes: 3 additions & 0 deletions sportzilla/views.py
Original file line number Diff line number Diff line change
@@ -83,6 +83,9 @@ def answer(request, number):
list1 = list(user.answers_given)
list1[30 * (no - 1) + qsno] = '3'
user.answers_given = ''.join(list1)
print(list1)
print(user.answers_given)
print(user.score)
user.save()
return HttpResponseRedirect('/accounts/profile/%s/' % number)

18 changes: 11 additions & 7 deletions static/js/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<<<<<<< HEAD
av=[1,1,1,1,1] ; // availabilty of questions for each stadium 1:available 0:not available
=======
av=[1,1,1,1,1] ; // availabilty of questions for each Arena 1:available 0:not available
>>>>>>> master
left=[0.125,0.50,0.85]; // left constraint for popup visibility
right=[0.16,0.57,0.92]; // right constraint for popup visibility
// device detection
@@ -127,9 +131,9 @@ function skipQues(x) {

// --------------AJAX Code after this------------

function getInitialQuestions(current) { //Invoked when first time any Stadium div is opened.
function getInitialQuestions(current) { //Invoked when first time any Arena div is opened.
$.ajax({
url : "http://127.0.0.1:8000/accounts/profile/"+current+"/",
url : "http://abhishekspeer.pythonanywhere.com/accounts/profile/"+current+"/", // change to 127.0.0.1:8000 when testing locally
type: "GET",
data: {'number':current},
dataType: 'json',
@@ -162,7 +166,7 @@ function getInitialQuestions(current) { //Invoked when first time any Stadium di
});
}
function getAnsResponse(answer, qno, current) { //Question no. Answer is passed. Check Answer and return.
var url1="http://127.0.0.1:8000/accounts/profile/"+current+"/answer/";
var url1="http://abhishekspeer.pythonanywhere.com/accounts/profile/"+current+"/answer/"; // change to 127.0.0.1:8000 when testing locally
$.ajax({
url : url1,
type: "GET",
@@ -198,7 +202,7 @@ function getAnsResponse(answer, qno, current) { //Question no. Answer is passed.
}
function getSkipResponse(qno, current) { //Question Number attempted passed when skip is clicked. Deduct 25 points.
$.ajax({
url : "http://127.0.0.1:8000/accounts/profile/"+current+"/skip/",
url : "http://abhishekspeer.pythonanywhere.com/accounts/profile/"+current+"/skip/", // change to 127.0.0.1:8000 when testing locally
type: "GET",
data: {'number':current},
dataType: 'json',
@@ -231,9 +235,9 @@ function getSkipResponse(qno, current) { //Question Number attempted passed when
});
}
function getCloseDivResponse (current) {
//Stadium number is passed when Leave Stadium is clicked deduct 50 points
//Arena number is passed when Leave Arena is clicked deduct 50 points
$.ajax({
url : "http://127.0.0.1:8000/accounts/profile/"+current+"/leave/",
url : "http://abhishekspeer.pythonanywhere.com/accounts/profile/"+current+"/leave/", // change to 127.0.0.1:8000 when testing locally
type: "GET",
//data: {'number':current},
//dataType: 'json',
@@ -250,7 +254,7 @@ function getCloseDivResponse (current) {
}
function getLeaderboard() {
$.ajax({
url : "http://127.0.0.1:8000/accounts/profile/leaderboard/",
url : "http://abhishekspeer.pythonanywhere.com/accounts/profile/leaderboard/", // change to 127.0.0.1:8000 when testing locally
type : "GET",
beforeSend : function() {
document.getElementById('position').innerHTML = "Please Wait...";
9 changes: 9 additions & 0 deletions static/main/style/newCss.css
Original file line number Diff line number Diff line change
@@ -76,6 +76,11 @@ canvas{ display: block; vertical-align: bottom; opacity: 1}
{
display: none;
}
<<<<<<< HEAD
=======
<<<<<<< HEAD
=======
>>>>>>> master

.rotate {
display: none;
@@ -105,3 +110,7 @@ canvas{ display: block; vertical-align: bottom; opacity: 1}
font-size: 100px;
}
}
<<<<<<< HEAD
=======
>>>>>>> upstream/master
>>>>>>> master
39 changes: 39 additions & 0 deletions templates/front.html
Original file line number Diff line number Diff line change
@@ -9,6 +9,45 @@
<link rel="stylesheet" type="text/css" href="{% static 'main/style/newCss.css' %}">
<link href="https://fonts.googleapis.com/css?family=Allerta+Stencil" rel="stylesheet">

<<<<<<< HEAD
=======
<<<<<<< HEAD
<style>

.rotate {
display: none;
}

@media all and (orientation:portrait) {
.rotate {
height: 100vh;
display: block;
}
canvas {
display: none;
}
#particles-js {
display: none;
}
#title {
display: none;
}
img, a {
display: none;
}
}

@media screen and (max-width: 1050px) and (max-height: 800px) {
#title {
font-size: 100px;
}
}

</style>

=======
>>>>>>> upstream/master
>>>>>>> master
</head>
<body>

26 changes: 13 additions & 13 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -111,7 +111,7 @@
<div class="front scroll">
<img id="road" src="{% static 'images/FullFront.png' %}" alt="" />

<!-- Stadium one, popup question availability -->
<!-- Arena one, popup question availability -->
<div class="quesAvailableDiv wow zoomInDown stad1 popup" id="Available1" data-wow-duration="0.5s">
<span class="questionAvailable">Football Quiz <br/> Questions are available</span><br/>
<span class="play" onclick="displayQuiz(0)">Play</span>
@@ -122,7 +122,7 @@
<span class="leave" onclick="dismissPopUp(0)">Leave</span>
</div>

<!-- stadium two, popup question availability-->
<!-- Arena two, popup question availability-->
<!-- <div class="quesAvailableDiv wow zoomInDown stad2 popup" id="Available2" style="display:none" data-wow-duration="0.5s">
<span class="questionAvailable">Cricket Quiz <br/>Questions are available</span><br/>
<span class="play" onclick="displayQuiz(1)">Play</span> -->
@@ -133,7 +133,7 @@
<span class="leave" onclick="dismissPopUp(1)">Leave</span>
</div> -->

<!-- stadium three, popup question availability-->
<!-- Arena three, popup question availability-->
<div class="quesAvailableDiv wow zoomInDown stad2 popup" id="Available2" data-wow-duration="0.5s">
<span class="questionAvailable">Miscellaneous Quiz <br/>Questions are available</span><br/>
<span class="play" onclick="displayQuiz(1)">Play</span>
@@ -144,7 +144,7 @@
<span class="leave" onclick="dismissPopUp(1)">Leave</span>
</div>

<!-- stadium four, popup question availability-->
<!-- Arena four, popup question availability-->
<!-- <div class="quesAvailableDiv wow zoomInDown stad4 popup" id="Available4" data-wow-duration="0.5s">
<span class="questionAvailable">Track & Field Quiz <br/>Questions are available</span><br/>
<span class="play" onclick="displayQuiz(3)">Play</span> -->
@@ -155,7 +155,7 @@
<span class="leave" onclick="dismissPopUp(3)">Leave</span>
</div> -->

<!-- stadium five, popup question availability-->
<!-- Arena five, popup question availability-->
<div class="quesAvailableDiv wow zoomInDown stad3 popup" id="Available3" data-wow-duration="0.5s">
<span class="questionAvailable">Extras Quiz <br/>Questions are available</span><br/>
<span class="play" onclick="displayQuiz(2)">Play</span>
@@ -181,7 +181,7 @@
</div>
<div class="skips-left">Skips Left : <span class="skipsLeft">{{skip}}</span></div>
</div>
<div class="quiz-sim-Footer-1"><span onclick="dismissDiv(1)" id="button">LEAVE STADIUM</span></div>
<div class="quiz-sim-Footer-1"><span onclick="dismissDiv(1)" id="button">LEAVE Arena</span></div>
</div>

<!-- Second Quiz -->
@@ -198,7 +198,7 @@
</div>
<div class="skips-left">Skips Left : <span class="skipsLeft">{{skip}}</span></div>
</div>
<div class="quiz-sim-Footer-2"><span onclick="dismissDiv(2)" id="button">LEAVE STADIUM</span></div>
<div class="quiz-sim-Footer-2"><span onclick="dismissDiv(2)" id="button">LEAVE Arena</span></div>
</div> -->

<!-- Third Quiz -->
@@ -215,7 +215,7 @@
</div>
<div class="skips-left">Skips Left : <span class="skipsLeft">{{skip}}</span></div>
</div>
<div class="quiz-sim-Footer-2"><span onclick="dismissDiv(2)" id="button">LEAVE STADIUM</span></div>
<div class="quiz-sim-Footer-2"><span onclick="dismissDiv(2)" id="button">LEAVE Arena</span></div>
</div>

<!-- Fourth Quiz -->
@@ -232,7 +232,7 @@
</div>
<div class="skips-left">Skips Left : <span class="skipsLeft">{{skip}}</span></div>
</div>
<div class="quiz-sim-Footer-4"><span onclick="dismissDiv(4)" id="button">LEAVE STADIUM</span></div>
<div class="quiz-sim-Footer-4"><span onclick="dismissDiv(4)" id="button">LEAVE Arena</span></div>
</div> -->

<!-- Fifth Quiz -->
@@ -249,17 +249,17 @@
</div>
<div class="skips-left">Skips Left : <span class="skipsLeft">{{skip}}</span></div>
</div>
<div class="quiz-sim-Footer-3"><span onclick="dismissDiv(3)" id="button">LEAVE STADIUM</span></div>
<div class="quiz-sim-Footer-3"><span onclick="dismissDiv(3)" id="button">LEAVE Arena</span></div>
</div>

<!-- Instructons -->
<div class="ins-sim-Div wow slideInDown" id="instructionsDiv">
<div class="ins-sim-Title"><img src="{% static 'images/instruct.svg' %}" height="25vh">&nbsp;<b>Instructions</b></div>
<div class="ins-sim-Body" style="display: flex; flex-direction: column; justify-content: center; align-items: flex-start; justify-content: space-around; ">
<span>1. Swipe Up/Down or use Up/Down Arrow keys to roam around the map.</span>
<span>2. Reach near the arrow close to unique stadiums and answer pic-connect type questions to gain maximum points and make it to the leaderboard.</span>
<span>3. You can skip at most 3 questions and have liberty to leave a stadium to reach other.</span>
<span>4. Correct Answer: 100 points. Skipping Question: -25 points. Leaving Stadium: -50 points.</span>
<span>2. Reach near the arrow close to unique Arenas and answer pic-connect type questions to gain maximum points and make it to the leaderboard.</span>
<span>3. You can skip at most 3 questions and have liberty to leave a Arena to reach other.</span>
<span>4. Correct Answer: 100 points. Skipping Question: -25 points. Leaving Arena: -50 points.</span>
</div>
<div class="ins-sim-Footer"><span onclick="dismissDiv()" id="button">CLOSE</span></div>
</div>