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

Update QUIZ_leaderboard.ipynb

parent de86315f
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])
summary = qh.combine_weeks('_SUBMISSIONS/', week_list = [1, 2, 3])
qh.print_leaderboard(summary)
```
%% Output
w1 w2
1 2 3 1 2 3
LeventeBuzga 6 ✓ ✓ ✓ ✓ ✓ ✓
PaulineS 6 ✓ ✓ ✓ ✓ ✓ ✓
Jojo 6 ✓ ✓ ✓ ✓ ✓ ✓
David 5 ✓ ✓ ✓ ✓
AndrewK 4 ✓ ✓
Anonyms 3 ✓ ✗ ✗ ✓ ✗ ✓
Luca Saladino 3 ✓ ✓ - - -
vince 3 ✓ ✓ ✗ ✗ ✗ ✓
mp 3- - -
Rasmus 3 ✓ ✗ ✗ ✗ ✓ ✓
pbn 3 ✓ ✓ ✗ ✗ ✓ ✗
Mathias 3 ✓ ✓ ✓ - - -
KnudMondrup 2 ✓ ✓ ✗ - - -
Emil 2 ✓ ✓ - - -
Anna_E 2 ✓ ✗ ✓ - - -
SportySpice 2 ✓ ✓ ✗ ✗ ✗ ✗
JensL 2 ✓ ✓ ✗ - - -
johnslim 2 ✗ ✓ - - -
snoopy 1 - - -
Joakim_P 1 ✓ ✗ ✗ - - -
JBorregaard 1 ✗ ✓ ✗ - - -
Sofia 1 ✓ ✗ ✗ - - -
Thomas Hornum 1 ✓ ✗ - - -
Ninna 1 ✗ ✗ - - -
andreama 1 ✓ ✗ ✗ ✗ ✗ ✗
GenieVickery 1 ✓ ✗ ✗ - - -
Jerry 1 ✓ ✗ ✗ - - -
kathariner 1 ✗ ✗ - - -
JWH 1 ✓ ✗ ✗ - - -
100rocks 0 ✗ ✗ ✗ - - -
w1 w2 w3
1 2 3 1 2 3 1 2 3
PaulineS 9 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
Jojo 9 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
David 8 ✓ ✓ ✓ ✓ ✓ ✓
AndrewK 7 ✗ ✓ ✓ ✗ ✓ ✓ ✓
vince 6 ✓ ✓ ✗ ✓ ✓
LeventeBuzga 6 ✓ ✓ ✓ ✓ ✓ ✓ - - -
johnslim 5 ✓ ✓ - - - ✓ ✓ ✓
Luca Saladino 5 ✓ ✓ ✓ - - - ✓ ✗ ✓
Anonyms 5 ✓ ✗ ✗✗ ✓ ✓
pbn 5 ✓ ✓ ✗ ✗ ✓ ✗ ✗ ✓ ✓
SportySpice 5 ✓ ✓ ✗ ✗ ✗ ✗ ✓ ✓ ✓
mp 5 ✓ ✓ ✓ - - - ✗ ✓ ✓
Mathias 3 ✓ ✓ ✓ - - - - - -
Rasmus 3 ✓ ✗ ✗ ✗ ✓ ✓ - - -
KnudMondrup 2 ✓ ✓ ✗ - - - - - -
JensL 2 ✓ ✓ ✗ - - - - - -
Emil 2 ✓ ✓ ✗ - - - - - -
Anna_E 2 ✗ ✓ - - - - - -
Ninna 1 ✓ - - - - - -
Jerry 1 ✓ ✗ ✗ - - - - - -
kathariner 1 ✗ ✗ ✓ - - - - - -
Thomas Hornum 1 ✗ ✓ ✗ - - - - - -
JWH 1 ✓ ✗ ✗ - - - - - -
Sofia 1 ✗ ✗ - - - - - -
JBorregaard 1 ✓ ✗ - - - - - -
GenieVickery 1 ✓ ✗ ✗ - - - - - -
snoopy 1 ✓ ✗ ✗ - - - - - -
Joakim_P 1 ✗ ✗ - - - - - -
andreama 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