Skip to content
Snippets Groups Projects
Commit 6bd55cb2 authored by Vedrana Andersen Dahl's avatar Vedrana Andersen Dahl
Browse files

Update QUIZ_leaderboard.ipynb

parent d67c97e3
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id:608c7b2a tags: %% Cell type:markdown id:608c7b2a tags:
# LEADERBOARD # LEADERBOARD
%% Cell type:code id:e5396acf tags: %% Cell type:code id:e5396acf tags:
``` python ``` python
import quizzes_helper as qh import quizzes_helper as qh
summary = qh.combine_weeks('_SUBMISSIONS/', week_list = [1, 2, 3, 4, 5]) summary = qh.combine_weeks('_SUBMISSIONS/', week_list = [1, 2, 3, 4, 5, 6])
qh.print_leaderboard(summary) qh.print_leaderboard(summary)
``` ```
%% Output %% Output
w1 w2 w3 w4 w5 w1 w2 w3 w4 w5 w6
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
Jojo 15 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ Jojo 17 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗
PaulineS 14 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✓ PaulineS 16 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✗
David 13 ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓ David 16 ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
AndrewK 12 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ LeventeBuzga 15 ✓ ✓ ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
LeventeBuzga 12 ✓ ✓ ✓ ✓ ✓ - - - ✓ ✓ ✓ ✓ AndrewK 14 ✗ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
SportySpice 11 ✓ ✓ ✗ ✗ ✗ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ SportySpice 13 ✓ ✓ ✗ ✗ ✗ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗
Luca Saladino 11 ✓ ✓ ✓ - - - ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ Luca Saladino 12 ✓ ✓ ✓ - - - ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✗
johnslim 11 ✗ ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ Rasmus 11 ✓ ✗ ✗ ✗ ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pbn 10 ✓ ✓ ✗ ✗ ✓ ✗ ✗ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓ pbn 11 ✓ ✓ ✗ ✗ ✓ ✗ ✗ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✗
mp 10 ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ ✓ ✓ johnslim 11 ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ ✓ ✓ - - -
vince 9 ✓ ✓ ✗ ✗ ✗ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✗ ✗ Mathias 10 ✓ ✓ ✓ - - - - - - ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓
Rasmus 9 ✓ ✗ ✗ ✗ ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ mp 10 ✓ ✓ ✓ - - - ✗ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓ - - -
Anonyms 7 ✓ ✗ ✗ ✓ ✓ ✓ ✓ ✗ - - - vince 9 ✓ ✓ ✗ ✓ ✓ ✗ - - -
Mathias 7 ✓ ✓ ✓ - - - - - - ✓ ✓ ✓ ✗ ✓ ✗ Anonyms 7 ✓ ✗ ✗ ✗ ✓ ✓ ✓ ✓ ✗ - - - - - -
andreama 5 ✓ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✓ ✓ ✓ ✗ ✓ ✗ andreama 6 ✓ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✓ ✓ ✓ ✗ ✓ ✗ ✓ ✗ ✗
kathariner 3 ✗ ✗ ✓ - - - - - - ✓ ✓ ✗ - - - kathariner 3 ✗ ✗ ✓ - - - - - - ✓ ✓ ✗ - - - - - -
Emil 2 ✓ ✓ ✗ - - - - - - - - - - - - KnudMondrup 2 ✓ ✓ ✗ - - - - - - - - - - - - - - -
KnudMondrup 2 ✓ ✓ ✗ - - - - - - - - - - - - Emil 2 ✓ ✓ ✗ - - - - - - - - - - - - - - -
Anna_E 2 ✓ ✗ ✓ - - - - - - - - - - - - Anna_E 2 ✓ ✗ ✓ - - - - - - - - - - - - - - -
kathariner 2 - - - - - - - - - - - - ✓ ✓ ✗ kathariner 2 - - - - - - - - - - - - ✓ ✓ ✗ - - -
JensL 2 ✓ ✓ ✗ - - - - - - - - - - - - JensL 2 ✓ ✓ ✗ - - - - - - - - - - - - - - -
Joakim_P 2 ✓ ✗ ✗ - - - - - - - - - ✗ ✓ ✗ Joakim_P 2 ✓ ✗ ✗ - - - - - - - - - ✗ ✓ ✗ - - -
Sofia 1 ✓ ✗ ✗ - - - - - - - - - - - - Sofia 1 ✓ ✗ ✗ - - - - - - - - - - - - - - -
JBorregaard 1 ✗ ✓ ✗ - - - - - - - - - - - - JBorregaard 1 ✗ ✓ ✗ - - - - - - - - - - - - - - -
Thomas Hornum 1 ✗ ✓ ✗ - - - - - - - - - - - - Thomas Hornum 1 ✗ ✓ ✗ - - - - - - - - - - - - - - -
snoopy 1 ✓ ✗ ✗ - - - - - - - - - - - - snoopy 1 ✓ ✗ ✗ - - - - - - - - - - - - - - -
Ninna 1 ✗ ✗ ✓ - - - - - - - - - - - - Ninna 1 ✗ ✗ ✓ - - - - - - - - - - - - - - -
GenieVickery 1 ✓ ✗ ✗ - - - - - - - - - - - - GenieVickery 1 ✓ ✗ ✗ - - - - - - - - - - - - - - -
Jerry 1 ✓ ✗ ✗ - - - - - - - - - - - - Jerry 1 ✓ ✗ ✗ - - - - - - - - - - - - - - -
JWH 1 ✓ ✗ ✗ - - - - - - - - - - - - JWH 1 ✓ ✗ ✗ - - - - - - - - - - - - - - -
100rocks 0 ✗ ✗ ✗ - - - - - - - - - - - - 100rocks 0 ✗ ✗ ✗ - - - - - - - - - - - - - - -
%% Cell type:markdown id:ddf7eb78 tags: %% Cell type:markdown id:ddf7eb78 tags:
# At the end of the course - finding the lucky quiz participant # At the end of the course - finding the lucky quiz participant
%% Cell type:code id:a0d98b67 tags: %% Cell type:code id:a0d98b67 tags:
``` python ``` python
# qh.plot_overview(summary) # qh.plot_overview(summary)
``` ```
%% Cell type:code id:65872a3f tags: %% Cell type:code id:65872a3f tags:
``` python ``` python
# chance = summary[['display name']].copy() # chance = summary[['display name']].copy()
# chance[['from', 'to']] = 0 # chance[['from', 'to']] = 0
# chance['to'] = summary.iloc[:, 2:].notna().sum(axis=1).cumsum() # chance['to'] = summary.iloc[:, 2:].notna().sum(axis=1).cumsum()
# chance['from'] = chance['to'].shift(1).fillna(0).astype(int) # chance['from'] = chance['to'].shift(1).fillna(0).astype(int)
# chance['to'] = chance['to'] - 1 # chance['to'] = chance['to'] - 1
# print(chance.to_string(index=False, header=True)) # print(chance.to_string(index=False, header=True))
``` ```
%% Cell type:code id:4c14c648 tags: %% Cell type:code id:4c14c648 tags:
``` python ``` python
# import random # import random
# import time # import time
# random.seed(time.time()) # random.seed(time.time())
# i = random.randint(0, chance['to'][-1]) # i = random.randint(0, chance['to'][-1])
# print(f'Random number is {i}') # print(f'Random number is {i}')
# winner = (chance['from']<= i) & (chance['to']>= i) # winner = (chance['from']<= i) & (chance['to']>= i)
# print(f'Lucky quiz participant is {chance[winner]["display name"].values[0]}') # print(f'Lucky quiz participant is {chance[winner]["display name"].values[0]}')
``` ```
%% Cell type:code id:feb044aa tags: %% Cell type:code id:feb044aa tags:
``` python ``` python
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment