Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr alpha test 0.1.33a1 #94

Closed
Closed
2 changes: 1 addition & 1 deletion chatroom/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pynecone>=0.1.32
pynecone==0.1.33a1
2 changes: 1 addition & 1 deletion clock/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pynecone>=0.1.32
pynecone==0.1.33a1
pytz==2022.7.1
2 changes: 1 addition & 1 deletion counter/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pynecone>=0.1.32
pynecone==0.1.33a1
2 changes: 1 addition & 1 deletion crm/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pynecone>=0.1.32
pynecone==0.1.33a1
2 changes: 1 addition & 1 deletion dalle/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pynecone>=0.1.32
pynecone==0.1.33a1
openai
2 changes: 1 addition & 1 deletion fragments/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pynecone>=0.1.32
pynecone==0.1.33a1
2 changes: 1 addition & 1 deletion gpt/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pynecone>=0.1.32
pynecone==0.1.33a1
openai
2 changes: 1 addition & 1 deletion nba/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pynecone>=0.1.32
pynecone==0.1.33a1
plotly-express
plotly
pandas
21 changes: 14 additions & 7 deletions quiz/quiz/quiz.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"""Welcome to Pynecone! This file outlines the steps to create a basic app."""
import pynecone as pc
import copy
from .results import results
from typing import Any
from typing import List

question_style = {
"bg": "white",
Expand All @@ -13,10 +16,12 @@

class State(pc.State):
"""The app state."""

answers = ["False", "None", [False, False, False, False, False]]
default_answers = [None, None, [False, False, False, False, False]]
answers:List[Any]
answer_key = ["False", "[10, 20, 30, 40]", [False, False, True, True, True]]
score: int
def onload(self):
self.answers = copy.deepcopy(self.default_answers)

def set_answers(self, answer, index, sub_index=None):
if sub_index is None:
Expand All @@ -29,10 +34,7 @@ def submit(self):
for i in range(len(self.answers)):
if self.answers[i] == self.answer_key[i]:
correct += 1
else:
print(self.answers[i], self.answer_key[i])
total += 1

self.score = int(correct / total * 100)
return pc.redirect("/result")

Expand All @@ -58,7 +60,10 @@ def question1():
),
pc.divider(),
pc.radio_group(
["True", "False"], on_change=lambda answer: State.set_answers(answer, 0)
["True", "False"],
default_value=State.default_answers[0],
default_checked=True,
on_change=lambda answer: State.set_answers(answer, 0)
),
style=question_style,
)
Expand All @@ -77,6 +82,8 @@ def question2():
),
pc.radio_group(
["[10, 20, 30, 40]", "[10, 20]"],
default_value=State.default_answers[1],
default_check=True,
on_change=lambda answer: State.set_answers(answer, 1),
),
style=question_style,
Expand Down Expand Up @@ -150,6 +157,6 @@ def result():

# Add state and page to the app.
app = pc.App(state=State)
app.add_page(index, title="Pynecone Quiz")
app.add_page(index, title="Pynecone Quiz", on_load=State.onload)
app.add_page(result, title="Quiz Results")
app.compile()
2 changes: 1 addition & 1 deletion quiz/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pynecone>=0.1.32
pynecone==0.1.33a1
Binary file added sales/assets/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion sales/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pynecone>=0.1.32
pynecone==0.1.33a1
openai
2 changes: 1 addition & 1 deletion snakegame/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pynecone>=0.1.32
pynecone==0.1.33a1
2 changes: 1 addition & 1 deletion todo/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pynecone>=0.1.32
pynecone==0.1.33a1
2 changes: 1 addition & 1 deletion translator/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pynecone>=0.1.32
pynecone==0.1.33a1
googletrans-py==4.0.0
requests>=2.28.1
2 changes: 1 addition & 1 deletion traversal/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pynecone>=0.1.32
pynecone==0.1.33a1
2 changes: 1 addition & 1 deletion twitter/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pynecone>=0.1.32
pynecone==0.1.33a1
2 changes: 1 addition & 1 deletion upload/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pynecone>=0.1.32
pynecone==0.1.33a1