Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def foo(foo):
- return_dict: dict = {
- "status": "invalid",
- "error": "loquesea",
- "csv": {
- "headers": ["student", "corrects", "incorrects"],
- "contents": [
- ["pepito", "10", "34"],
- ]
- }
- }
- data = json.loads(request.data)
- if data.get("test"):
- test: Test = context.query_first(Test, Test.id == data.get("test"))
- if test:
- for test_instance in test.test_instances:
- for result in test_instance.results:
- f"{test_instance.student}
- [
- [1, 1],
- [2, 0],
- [3, 1],
- [4, 1]
- ]
- return return_dict
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement