Elfsong commited on
Commit
7368e62
·
1 Parent(s): bcd8088
Files changed (1) hide show
  1. app.py +19 -6
app.py CHANGED
@@ -15,14 +15,27 @@ with st.spinner("Loading data...", show_time=True):
15
 
16
  if "problem" in st.query_params:
17
  problem_id = int(st.query_params["problem"])
18
- st.write(f"Problem Description - [{problem_id}]")
19
  problem_instance = problem_dict[problem_id]
 
 
 
20
 
21
- st.markdown(problem_instance["question_content"])
22
-
23
- st.code(problem_instance["test_case_generator"])
24
-
25
- st.write(problem_instance["test_cases"])
 
 
 
 
 
 
 
 
 
 
26
 
27
  else:
28
  with st.spinner("Loading Framework...", show_time=True):
 
15
 
16
  if "problem" in st.query_params:
17
  problem_id = int(st.query_params["problem"])
18
+ st.write(f"Problem [{problem_id}]")
19
  problem_instance = problem_dict[problem_id]
20
+
21
+ with st.expander("Problem Description"):
22
+ st.markdown(problem_instance["question_content"])
23
 
24
+ with st.expander("Test Cases"):
25
+ df = pd.DataFrame(
26
+ {
27
+ "input": [problem['input'] for problem in problem_instance["test_cases"]],
28
+ "output": [problem['output'] for problem in problem_instance["test_cases"]],
29
+ }
30
+ )
31
+ st.dataframe(
32
+ df,
33
+ column_config={
34
+ "input": st.column_config.TextColumn("Problem ID"),
35
+ "output": st.column_config.TextColumn("Dynamic Point"),
36
+ },
37
+ column_order=("input", "output"),
38
+ )
39
 
40
  else:
41
  with st.spinner("Loading Framework...", show_time=True):