Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e50acf6
Fix bug due to uneven number of columns
lfaucon Dec 20, 2019
61d30d7
Fix display of life time total score
lfaucon Dec 20, 2019
bf599d3
Add progress bar during quizzes (#4)
lfaucon Dec 20, 2019
ea6cc81
Sends data only once at the end of the quiz (#5)
lfaucon Dec 21, 2019
e4dae02
Add function to test quiz before submitting them (#6)
lfaucon Dec 22, 2019
968c136
Correctly number questions in the progress bar (#7)
lfaucon Dec 22, 2019
cfedd33
Refactor quiz format, metadata and FetchQuiz UI (#8)
lfaucon Dec 22, 2019
7bbe178
Updates sign-in message and home message (#9)
lfaucon Dec 22, 2019
29b1a39
Improve stats logged during quizzes (#10)
lfaucon Dec 22, 2019
83d3e28
Use csv-parser in Editor (#11)
lfaucon Dec 22, 2019
4653bcf
Display error from csv-parse (#12)
lfaucon Dec 23, 2019
b429e51
Fix typos
lfaucon Jan 6, 2020
6983d55
Add questionIds to logs for random quiz (#13)
lfaucon Jan 9, 2020
00adc3d
Remove some dark colors and add a few more (#16)
lfaucon Jan 21, 2020
7b5232b
Add public list of quiz (to be manually updated by firebase admin) (#15)
lfaucon Jan 21, 2020
3a3f5b2
Add interface to better explain the scoring system (#17)
lfaucon Jan 21, 2020
16ac0cf
Fix bug occuring when back is pressed to go back to quizList (#18)
lfaucon Jan 21, 2020
5cba867
Add possibility to access own quizzes' Share screen (#19)
lfaucon Jan 21, 2020
dabf40a
Add possibility to update own quizzes (#20)
lfaucon Jan 22, 2020
31e9ed7
New feedback for points counting
lfaucon Jan 22, 2020
1526abf
Improve feedback for scores
lfaucon Jan 22, 2020
5053732
Improve style
lfaucon Jan 22, 2020
788cb74
Add possibility to access results of quizzes (#21)
lfaucon Jan 23, 2020
0046532
Rewrite text for version beta (#22)
lfaucon Jan 23, 2020
fbffc91
Better stat visualization (#23)
lfaucon Feb 3, 2020
766e845
Add database dump
lfaucon Feb 6, 2020
ec49fe6
Create LICENSE
lfaucon Feb 6, 2020
4890404
Small UI changes (#24)
lfaucon Feb 19, 2020
e33ab7d
Update README.md
lfaucon Oct 23, 2020
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
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ This project was inspired by: https://www.lesswrong.com/posts/8wzKawHmh4d3h2otw/

Access the app at: https://bayes-up.web.app/

For anything else feel free contact any of the contributor.
For anything else feel free contact any of the contributors.
7 changes: 0 additions & 7 deletions database.rules.json

This file was deleted.

30,530 changes: 30,530 additions & 0 deletions database_dump/database.csv

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions firestore.rules
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /publicQuizzes/list {
allow read: if true;
}

match /events/{documents=**} {
allow write: if true;
}
Expand All @@ -12,5 +16,9 @@ service cloud.firestore {
match /quizzes/{userId} {
allow read, write: if request.auth.uid == userId;
}

match /results/{documents=**} {
allow read, write: if request.auth != null;
}
}
}
13 changes: 12 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import Stats from "./Stats";
import Settings from "./Settings";
import SignIn from "./SignIn";
import FetchQuiz from "./FetchQuiz";
import Share from "./Share";
import Results from "./Results";
import MyQuizzes from "./MyQuizzes";
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";

Expand All @@ -33,7 +35,10 @@ const App = () => {
<Quiz quiz={quiz} setQuiz={setQuiz} />
</Route>
<Route exact path="/editor">
<Editor quiz={quiz} />
<Editor />
</Route>
<Route exact path="/e/:quizId">
<Editor />
</Route>
<Route exact path="/stats">
<Stats />
Expand All @@ -44,6 +49,12 @@ const App = () => {
<Route exact path="/q/:quizId">
<FetchQuiz setQuiz={setQuiz} path={path} />
</Route>
<Route exact path="/r/:quizId">
<Results />
</Route>
<Route exact path="/s/:quizId">
<Share />
</Route>
<Route exact path="/myquizzes">
<MyQuizzes />
</Route>
Expand Down
50 changes: 32 additions & 18 deletions src/ChoiceBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const CustomSlider = withStyles({
height: 24,
padding: "6px 0px",
flex: "0 0 auto",
width: "80%"
width: "95%"
},
thumb: {
height: 32,
Expand All @@ -21,6 +21,7 @@ const CustomSlider = withStyles({
boxShadow: "inherit"
}
},
active: {},
track: {
height: 24,
borderRadius: 2,
Expand All @@ -33,30 +34,44 @@ const CustomSlider = withStyles({
}
})(Slider);

export default ({ choice, guess, setGuess, background, submitted }) => {
export default ({
choice,
guess,
setGuess,
submitted,
isCorrect,
baseScore
}) => {
const background = submitted && isCorrect ? "green" : "#bbbbbb";

const handleSliderChange = (event, newValue) => {
if (submitted) return;
setGuess(newValue);
};

const error = isCorrect ? (100 - guess) ** 2 / 1000 : guess ** 2 / 1000;
const scoreIfRight = 10 - (100 - guess) ** 2 / 1000;
const scoreIfWrong = guess ** 2 / 1000;
const score = isCorrect ? scoreIfRight : scoreIfWrong;

const colorRight = !submitted || isCorrect ? "black" : "transparent";
const colorWrong = !submitted || !isCorrect ? "black" : "transparent";

return (
<div className="choiceContainer" style={{ background }}>
<div className="choice">
<button
className="fullwidth-button"
disabled={guess < 1 || submitted}
onClick={() => setGuess(guess - 5)}
>
-
</button>
<span>{choice}</span>
<button
className="fullwidth-button"
disabled={guess > 99 || submitted}
onClick={() => setGuess(guess + 5)}
>
+
</button>
<div className="choiceText">
<span>{choice}</span>
</div>
</div>
<div className="sliderValue">
<span style={{ color: colorRight }}>
+{scoreIfRight.toFixed(scoreIfRight % 10 === 0 ? 0 : 2)}
</span>
<span>{guess.toFixed(0)}%</span>
<span style={{ color: colorWrong }}>
-{scoreIfWrong.toFixed(scoreIfWrong % 10 === 0 ? 0 : 2)}
</span>
</div>
<div className="sliderContainer">
<CustomSlider
Expand All @@ -65,7 +80,6 @@ export default ({ choice, guess, setGuess, background, submitted }) => {
aria-labelledby="input-slider"
step={5}
/>
<span className="sliderValue">{guess}%</span>
</div>
</div>
);
Expand Down
Loading