diff options
author | Akshen | 2018-11-02 15:24:00 +0530 |
---|---|---|
committer | Akshen | 2018-11-02 15:24:00 +0530 |
commit | b42cc399fd70cc45ca7a5e075b39885eeec97d30 (patch) | |
tree | 092501202b3462f18720d842754fbcd065ef9cc8 | |
parent | d61a7d730f1fe6ef863ffec51c169cb261c2a86b (diff) | |
download | nccps-2018-b42cc399fd70cc45ca7a5e075b39885eeec97d30.tar.gz nccps-2018-b42cc399fd70cc45ca7a5e075b39885eeec97d30.tar.bz2 nccps-2018-b42cc399fd70cc45ca7a5e075b39885eeec97d30.zip |
Add instructions for dwsim flowsheet test
-rw-r--r-- | nccps2018/settings.py | 10 | ||||
-rw-r--r-- | static/website/templates/take_quiz.html | 75 | ||||
-rw-r--r-- | website/views.py | 60 |
3 files changed, 115 insertions, 30 deletions
diff --git a/nccps2018/settings.py b/nccps2018/settings.py index 9ce4c32..dae82f5 100644 --- a/nccps2018/settings.py +++ b/nccps2018/settings.py @@ -80,11 +80,11 @@ WSGI_APPLICATION = 'nccps2018.wsgi.application' DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.mysql', - 'NAME': DB_NAME_DEFAULT, # Or path to database file if using sqlite3. - 'USER': DB_USER_DEFAULT, - 'PASSWORD': DB_PASS_DEFAULT, - 'HOST': DB_HOST_DEFAULT, + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + 'TEST': { + 'NAME': 'mytestdatabase', + }, } } diff --git a/static/website/templates/take_quiz.html b/static/website/templates/take_quiz.html index 15bb05e..3e62018 100644 --- a/static/website/templates/take_quiz.html +++ b/static/website/templates/take_quiz.html @@ -3,7 +3,9 @@ {% load static %} {% block content %} <br><br><br><br> -<div class="container"> + +{% if set_visible %} + <div class="container"> {% if messages %} <ul class="messages"> @@ -43,6 +45,75 @@ <button class="btn btn-primary center-block" type="Submit">Submit</button> <br> </form> {% endif %} + </div> + + {% else %} + + <div class="container"> + <h2> DWSIM Flowsheeting Creation Competition</h2> + <br> + <ul> + <li> Top 8 participants in the leaderboard by end of 02-11-2018, 11:59 PM are eligible for this competition.</li> + <li> These participants will receive the problem statement to be solved in DWSIM directly through e-mail by 03-11-2018, 12:00 noon.</li> + <li>Participants have to propose the assigned flowsheet in the DWSIM Flowsheeting Project webpage using the proposal form + <a href="https://dwsim.fossee.in/flowsheeting-project/proposal" style="color: #cc0000">here.</a> + The proposal should be submitted by 04-11-2018, 12:00 noon.</li> + <li>In case of any issues regarding submission of proposal, please write to us at <a href="mailto:contact-dwsim@fossee.in" style="color: hsl(236, 95%, 50%)">contact-dwsim@fossee.in</a> before the deadline for proposal submission.</li> + <li>Participants can start creating the simulation for the assigned flowsheet as soon as they submit the proposal. Participants need not wait for approval of the proposal to start working on the flowsheet.</li> + <li>No extension in deadline will be granted for submission of proposal. If any of the participant doesn’t submit the proposal by the given deadline, flowsheet will be assigned to the next participant i.e. the 9th participant in the leaderboard and so on.</li> + <li>Solve the flowsheet using <u>DWSIM Version 5.4 Update 2.</u></li> + <li>Flowsheet and a well written abstract should be submitted <a href="https://dwsim.fossee.in/flowsheeting-project/abstract-code/upload" style="color: #cc0000">here.</a></li> + <li>Flowsheet creation competition would carry 50 marks in total divided in the following manner.</li> + <ol> + <li>Approach to the flowsheet - 10</li> + <li>Validation / Accuracy of results in the flowsheet - 20 </li> + <li>Presentation of the flowsheet - 10 </li> + <li>Abstract - 10</li> + </ol> + <li>Please adhere to the guidelines for the flowsheet development and abstract mentioned <a href="https://dwsim.fossee.in/flowsheeting-project/coding-guidelines-flowsheeting" style="color: #cc0000">here.</a></li> + <li>The last date for submission of flow sheet is 8-11-2018, 11:59 PM.</li> + <li>Submission of correct flowsheet by 04-11-2018, 11:59 PM will attract bonus of 10 marks.</li> + <li>Submission of correct flowsheet by 05-11-2018, 11:59 PM will attract bonus of 7 marks.</li> + <li> Submission of correct flowsheet by 06-11-2018, 11:59 PM will attract bonus of 5 marks.</li> + <li>If the flowsheet is not as per the given problem statement, participants will be given chance to correct and re-upload the flowsheet. In that case, no bonus marks will be rewarded.</li> + <li>Decision of the NCCPS team regarding marking of the flowsheeting competition will be final.</li> + <br> + </ul> + </div> + + <br> + + <section> + <div class="container"> + <h3>Leaderboard</h3> + <table border="1" width="90%"> + <thead> + <tr> + <th>Participant Name</th> +   + <th>Score</th> + </tr> + </thead> + + {% for participant in leaderboard %} + <tbody> + <tr> + <td> +   {{ participant.0.user.get_full_name }} + </td> + + <td> +   {{ participant.1 }} + </td> + </tr> + </tbody> + {% endfor %} + </table> + + </div> + </section> +<br><br> + + {% endif %} -</div> {% endblock %}
\ No newline at end of file diff --git a/website/views.py b/website/views.py index 3c4f737..4076945 100644 --- a/website/views.py +++ b/website/views.py @@ -1094,6 +1094,30 @@ def edit_question(request, qid=None): def quiz_intro(request): return render(request, 'quiz_intro.html') + +def calculate_leader(): + profiles = Profile.objects.all() + leaderboard = {p:0 for p in profiles} + marks = { + '5': [date(2018, 10, 29), date(2018, 11, 4)], + '10': [date(2018, 11, 5), date(2018, 11, 12)] + } + answers = AnswerPaper.objects.all() + + for i in leaderboard: + profiles = AnswerPaper.objects.filter(participant=i) + for p in profiles: + if p.validate_ans==1: + if marks['5'][0] <= p.answered_q.question_day <= marks['5'][1]: + leaderboard[i] +=5 + else: + leaderboard[i] +=1 + + + sorted_leaderboard = sorted(leaderboard.items(), key=lambda kv: kv[1]) + return sorted_leaderboard + + @login_required def take_quiz(request): user = request.user @@ -1162,31 +1186,23 @@ def take_quiz(request): except: pass + today = datetime.today().date() + if today > date(2018, 11, 4): + set_visible = 0 + else: + set_visible = 1 + sorted_leaderboard = calculate_leader() + return render(request, 'take_quiz.html', { - 'question_list' : questions + 'question_list' : questions, + 'set_visible': set_visible, + "leaderboard": sorted_leaderboard[::-1] }) -def leaderboard(request): - profiles = Profile.objects.all() - leaderboard = {p:0 for p in profiles} - marks = { - '5': [date(2018, 10, 29), date(2018, 11, 4)], - '10': [date(2018, 11, 5), date(2018, 11, 12)] - } - answers = AnswerPaper.objects.all() - for i in leaderboard: - profiles = AnswerPaper.objects.filter(participant=i) - for p in profiles: - if p.validate_ans==1: - if marks['5'][0] <= p.answered_q.question_day <= marks['5'][1]: - leaderboard[i] +=5 - else: - leaderboard[i] +=1 - - - sorted_leaderboard = sorted(leaderboard.items(), key=lambda kv: kv[1]) +def leaderboard(request): + sorted_leaderboard = calculate_leader() return render(request, "leaderboard.html", {'leaderboard': sorted_leaderboard[::-1]}) @@ -1194,7 +1210,6 @@ def leaderboard(request): def view_solutions(request,id=None): ''''Show solutions to participants after a specific date''' question_ans_list = Question.objects.all() - today = datetime.today().date() if today < date(2018, 11, 15): set_visible = 0 @@ -1219,8 +1234,7 @@ def view_solutions(request,id=None): response.write(zipfile_name.read()) return response - - + return render(request, 'view_solutions.html', {"question_ans_list": question_ans_list, "set_visible": set_visible }) |