koutch commited on
Commit
5e02f4e
·
1 Parent(s): 3574fda

Removed dpft

Browse files
data/2022_1/execution_2022_1.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:091ea74c6f92d2a4249a8e1c41f4496756609821ba221d1da7a074a5595ee38c
3
- size 197868626
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2ba8f6e7489572f1adba56e178f497ea79068d23edc3e3d3f423742513e03fd
3
+ size 214975993
data/2022_2/execution_2022_2.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f8550b63d80b713290f8614d8393690a877b97306f85a055ddf66f8430a65253
3
- size 139093895
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6bc3bca89ebd2bc8fb79a27b599a312c253fa221f21c2fc4e21e13851c12269
3
+ size 149451225
data/2023_1/execution_2023_1.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:938ea5f4a51d9e81773c4f2d563586007eae2b498773c0ddce0d8cf123e944bb
3
- size 220913718
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8229e3a760469930226cbb44e0423599e324c88519a1b794b4da64efee5b561d
3
+ size 239178319
data/2023_2/execution_2023_2.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8ffde0d67fb1be0a1f5a97d5da6a587e548ca26ac472c4cfff2b3c032309e827
3
- size 193928128
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0dbf83d5c05be49a09cd5e5776a6ac2d88fd0ffd8f2e4771f3c54e0efdfd305c
3
+ size 210315046
data/2024_1/execution_2024_1.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:be679909963b9f02590d76a0d9732a63bc1fa93e963efa6354b7ce4670543f06
3
- size 209840142
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:800786fda852d641e5d34a6398f431ca913a49e8d7d706fac708257a7c56b8ee
3
+ size 229555285
src/__pycache__/execution.cpython-312.pyc CHANGED
Binary files a/src/__pycache__/execution.cpython-312.pyc and b/src/__pycache__/execution.cpython-312.pyc differ
 
src/execution.py CHANGED
@@ -73,15 +73,16 @@ def _extract_submission(block: str):
73
  - execution_time (float, seconds)
74
  - grade (float, percent 0..100)
75
  - testcases (list of dicts with index, input, correct_output, user_output)
 
76
  """
77
  lines = block.splitlines()
78
- # 1) Find where code ends to start scanning the sections after it
79
  _, after_code_idx = _extract_code(block)
80
  scan_start = after_code_idx if after_code_idx is not None else 0
81
 
82
  execution_time = None
83
  grade = None
84
  testcases = []
 
85
 
86
  i = scan_start
87
  while i < len(lines):
@@ -92,7 +93,6 @@ def _extract_submission(block: str):
92
  if low.startswith("-- execution time:"):
93
  val = _read_scalar_after_section(lines, i)
94
  if val is not None:
95
- # parse float; ignore parse errors silently
96
  try:
97
  execution_time = float(val)
98
  except:
@@ -102,30 +102,30 @@ def _extract_submission(block: str):
102
 
103
  # -- TEST CASE N:
104
  if low.startswith("-- test case"):
105
- # parse index between "test case " and ":"
106
  idx = None
107
  try:
108
- # e.g., "-- TEST CASE 3:"
109
  head = raw.split(":", 1)[0]
110
  idx = int(head.lower().split("test case", 1)[1].strip())
111
  except:
112
  pass
113
 
114
- # collect subfields until next '-- TEST CASE' or '-- GRADE:' or end
115
  j = i + 1
116
  current = {"index": idx, "input": "", "correct_output": "", "user_output": ""}
117
- active = None # "input" | "correct_output" | "user_output"
 
 
118
 
119
  while j < len(lines):
120
  sraw = lines[j].rstrip("\n")
121
  slow = sraw.strip().lower()
122
 
123
  if slow.startswith("-- test case") or slow.startswith("-- grade:"):
124
- break # end of this test case section
 
 
125
 
126
  if slow.startswith("---- input:"):
127
  active = "input"
128
- # reset to collect fresh content for this field
129
  current["input"] = ""
130
  elif slow.startswith("---- correct output:"):
131
  active = "correct_output"
@@ -135,11 +135,9 @@ def _extract_submission(block: str):
135
  current["user_output"] = ""
136
  else:
137
  if active:
138
- # preserve newlines as in the log
139
  current[active] += (sraw + "\n")
140
  j += 1
141
 
142
- # strip trailing newlines
143
  for k in ("input", "correct_output", "user_output"):
144
  current[k] = current[k].rstrip("\n")
145
 
@@ -156,12 +154,19 @@ def _extract_submission(block: str):
156
  grade = float(v)
157
  except:
158
  pass
 
 
 
159
  i += 1
160
  continue
161
 
162
  i += 1
163
 
164
- return execution_time, grade, testcases
 
 
 
 
165
 
166
  def parse_execution_data(full_path):
167
  """
@@ -206,7 +211,9 @@ def parse_execution_data(full_path):
206
  if tnorm == "test":
207
  output_type, output_content = _extract_test_output(block)
208
  elif tnorm in ("submission", "submition", "submit"):
209
- execution_time, grade, testcases = _extract_submission(block)
 
 
210
 
211
  rows.append({
212
  "user": user,
 
73
  - execution_time (float, seconds)
74
  - grade (float, percent 0..100)
75
  - testcases (list of dicts with index, input, correct_output, user_output)
76
+ - output_content (string dump of test cases + grades, stdout-like)
77
  """
78
  lines = block.splitlines()
 
79
  _, after_code_idx = _extract_code(block)
80
  scan_start = after_code_idx if after_code_idx is not None else 0
81
 
82
  execution_time = None
83
  grade = None
84
  testcases = []
85
+ output_lines = [] # new: collect for output_content
86
 
87
  i = scan_start
88
  while i < len(lines):
 
93
  if low.startswith("-- execution time:"):
94
  val = _read_scalar_after_section(lines, i)
95
  if val is not None:
 
96
  try:
97
  execution_time = float(val)
98
  except:
 
102
 
103
  # -- TEST CASE N:
104
  if low.startswith("-- test case"):
 
105
  idx = None
106
  try:
 
107
  head = raw.split(":", 1)[0]
108
  idx = int(head.lower().split("test case", 1)[1].strip())
109
  except:
110
  pass
111
 
 
112
  j = i + 1
113
  current = {"index": idx, "input": "", "correct_output": "", "user_output": ""}
114
+ active = None
115
+
116
+ output_lines.append(lines[i]) # keep the "-- TEST CASE ..." line
117
 
118
  while j < len(lines):
119
  sraw = lines[j].rstrip("\n")
120
  slow = sraw.strip().lower()
121
 
122
  if slow.startswith("-- test case") or slow.startswith("-- grade:"):
123
+ break
124
+
125
+ output_lines.append(sraw)
126
 
127
  if slow.startswith("---- input:"):
128
  active = "input"
 
129
  current["input"] = ""
130
  elif slow.startswith("---- correct output:"):
131
  active = "correct_output"
 
135
  current["user_output"] = ""
136
  else:
137
  if active:
 
138
  current[active] += (sraw + "\n")
139
  j += 1
140
 
 
141
  for k in ("input", "correct_output", "user_output"):
142
  current[k] = current[k].rstrip("\n")
143
 
 
154
  grade = float(v)
155
  except:
156
  pass
157
+ output_lines.append(lines[i])
158
+ if val:
159
+ output_lines.append(val)
160
  i += 1
161
  continue
162
 
163
  i += 1
164
 
165
+ # new: join collected lines
166
+ output_content = "\n".join(output_lines).strip() or None
167
+
168
+ return execution_time, grade, testcases, output_content
169
+
170
 
171
  def parse_execution_data(full_path):
172
  """
 
211
  if tnorm == "test":
212
  output_type, output_content = _extract_test_output(block)
213
  elif tnorm in ("submission", "submition", "submit"):
214
+ execution_time, grade, testcases, output_content = _extract_submission(block)
215
+ output_type = "stdout" if output_content else None
216
+
217
 
218
  rows.append({
219
  "user": user,