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:
# LEADERBOARD
%% Cell type:code id:e5396acf tags:
``` python
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)
```
%% Output
w1 w2 w3 w4 w5
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
Jojo 15 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
PaulineS 14 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✓
David 13 ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓
AndrewK 12 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
LeventeBuzga 12 ✓ ✓ ✓ ✓ ✓ - - - ✓ ✓ ✓ ✓
SportySpice 11 ✓ ✓ ✗ ✗ ✗ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
Luca Saladino 11 ✓ ✓ ✓ - - - ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓
johnslim 11 ✗ ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pbn 10 ✓ ✓ ✗ ✗ ✓ ✗ ✗ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓
mp 10 ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ ✓ ✓
vince 9 ✓ ✓ ✗ ✗ ✗ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✗ ✗
Rasmus 9 ✓ ✗ ✗ ✗ ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓
Anonyms 7 ✓ ✗ ✗ ✓ ✓ ✓ ✓ ✗ - - -
Mathias 7 ✓ ✓ ✓ - - - - - - ✓ ✓ ✓ ✗ ✓ ✗
andreama 5 ✓ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✓ ✓ ✓ ✗ ✓ ✗
kathariner 3 ✗ ✗ ✓ - - - - - - ✓ ✓ ✗ - - -
Emil 2 ✓ ✓ ✗ - - - - - - - - - - - -
KnudMondrup 2 ✓ ✓ ✗ - - - - - - - - - - - -
Anna_E 2 ✓ ✗ ✓ - - - - - - - - - - - -
kathariner 2 - - - - - - - - - - - - ✓ ✓ ✗
JensL 2 ✓ ✓ ✗ - - - - - - - - - - - -
Joakim_P 2 ✓ ✗ ✗ - - - - - - - - - ✗ ✓ ✗
Sofia 1 ✓ ✗ ✗ - - - - - - - - - - - -
JBorregaard 1 ✗ ✓ ✗ - - - - - - - - - - - -
Thomas Hornum 1 ✗ ✓ ✗ - - - - - - - - - - - -
snoopy 1 ✓ ✗ ✗ - - - - - - - - - - - -
Ninna 1 ✗ ✗ ✓ - - - - - - - - - - - -
GenieVickery 1 ✓ ✗ ✗ - - - - - - - - - - - -
Jerry 1 ✓ ✗ ✗ - - - - - - - - - - - -
JWH 1 ✓ ✗ ✗ - - - - - - - - - - - -
100rocks 0 ✗ ✗ ✗ - - - - - - - - - - - -
w1 w2 w3 w4 w5 w6
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
Jojo 17 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗
PaulineS 16 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✗
David 16 ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
LeventeBuzga 15 ✓ ✓ ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
AndrewK 14 ✗ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
SportySpice 13 ✓ ✓ ✗ ✗ ✗ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗
Luca Saladino 12 ✓ ✓ ✓ - - - ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✗ ✗
Rasmus 11 ✓ ✗ ✗ ✗ ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pbn 11 ✓ ✓ ✗ ✗ ✓ ✗ ✗ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓ ✗ ✓ ✗
johnslim 11 ✓ ✓ - - - ✓ ✓ ✓ ✓ ✓ ✓ ✓ - - -
Mathias 10 ✓ ✓ ✓ - - - - - - ✓ ✓ ✓ ✓ ✗ ✓ ✓ ✓
mp 10 ✓ ✓ ✓ - - - ✗ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓ - - -
vince 9 ✓ ✓ ✗ ✓ ✓ ✗ - - -
Anonyms 7 ✓ ✗ ✗ ✗ ✓ ✓ ✓ ✓ ✗ - - - - - -
andreama 6 ✓ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✗ ✓ ✓ ✓ ✗ ✓ ✗ ✓ ✗ ✗
kathariner 3 ✗ ✗ ✓ - - - - - - ✓ ✓ ✗ - - - - - -
KnudMondrup 2 ✓ ✓ ✗ - - - - - - - - - - - - - - -
Emil 2 ✓ ✓ ✗ - - - - - - - - - - - - - - -
Anna_E 2 ✓ ✗ ✓ - - - - - - - - - - - - - - -
kathariner 2 - - - - - - - - - - - - ✓ ✓ ✗ - - -
JensL 2 ✓ ✓ ✗ - - - - - - - - - - - - - - -
Joakim_P 2 ✓ ✗ ✗ - - - - - - - - - ✗ ✓ ✗ - - -
Sofia 1 ✓ ✗ ✗ - - - - - - - - - - - - - - -
JBorregaard 1 ✗ ✓ ✗ - - - - - - - - - - - - - - -
Thomas Hornum 1 ✗ ✓ ✗ - - - - - - - - - - - - - - -
snoopy 1 ✓ ✗ ✗ - - - - - - - - - - - - - - -
Ninna 1 ✗ ✗ ✓ - - - - - - - - - - - - - - -
GenieVickery 1 ✓ ✗ ✗ - - - - - - - - - - - - - - -
Jerry 1 ✓ ✗ ✗ - - - - - - - - - - - - - - -
JWH 1 ✓ ✗ ✗ - - - - - - - - - - - - - - -
100rocks 0 ✗ ✗ ✗ - - - - - - - - - - - - - - -
%% Cell type:markdown id:ddf7eb78 tags:
# At the end of the course - finding the lucky quiz participant
%% Cell type:code id:a0d98b67 tags:
``` python
# qh.plot_overview(summary)
```
%% Cell type:code id:65872a3f tags:
``` python
# chance = summary[['display name']].copy()
# chance[['from', 'to']] = 0
# chance['to'] = summary.iloc[:, 2:].notna().sum(axis=1).cumsum()
# chance['from'] = chance['to'].shift(1).fillna(0).astype(int)
# chance['to'] = chance['to'] - 1
# print(chance.to_string(index=False, header=True))
```
%% Cell type:code id:4c14c648 tags:
``` python
# import random
# import time
# random.seed(time.time())
# i = random.randint(0, chance['to'][-1])
# print(f'Random number is {i}')
# winner = (chance['from']<= i) & (chance['to']>= i)
# print(f'Lucky quiz participant is {chance[winner]["display name"].values[0]}')
```
%% Cell type:code id:feb044aa tags:
``` 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