(data, run_code=True)
| 51 | |
| 52 | |
| 53 | def run(data, run_code=True): |
| 54 | pec = data.get("DC_PEC", "") |
| 55 | stu_code = data.get("DC_CODE", "") |
| 56 | sol_code = data.get("DC_SOLUTION", "") |
| 57 | sct = data.get("DC_SCT", "") |
| 58 | force_diagnose = data.get("DC_FORCE_DIAGNOSE", False) |
| 59 | |
| 60 | with in_temp_dir(): |
| 61 | if run_code: |
| 62 | sol_process, stu_process, raw_stu_output, error = run_exercise( |
| 63 | pec, sol_code, stu_code |
| 64 | ) |
| 65 | else: |
| 66 | raw_stu_output = "" |
| 67 | stu_process = StubProcess() # WorkerProcess() |
| 68 | sol_process = StubProcess() # WorkerProcess() |
| 69 | error = None |
| 70 | |
| 71 | res = test_exercise( |
| 72 | sct=sct, |
| 73 | student_code=stu_code, |
| 74 | solution_code=sol_code, |
| 75 | pre_exercise_code=pec, |
| 76 | student_process=stu_process, |
| 77 | solution_process=sol_process, |
| 78 | raw_student_output=raw_stu_output, |
| 79 | ex_type="NormalExercise", |
| 80 | force_diagnose=force_diagnose, |
| 81 | error=error, |
| 82 | ) |
| 83 | |
| 84 | return res |
| 85 | |
| 86 | |
| 87 | def get_sct_payload(output): |
nothing calls this directly
no test coverage detected