Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. def foo(foo):
  2. return_dict: dict = {
  3. "status": "invalid",
  4. "error": "loquesea",
  5. "csv": {
  6. "headers": ["student", "corrects", "incorrects"],
  7. "contents": [
  8. ["pepito", "10", "34"],
  9.  
  10. ]
  11. }
  12. }
  13. data = json.loads(request.data)
  14. if data.get("test"):
  15. test: Test = context.query_first(Test, Test.id == data.get("test"))
  16. if test:
  17.  
  18. for test_instance in test.test_instances:
  19.  
  20. for result in test_instance.results:
  21. f"{test_instance.student}
  22. [
  23. [1, 1],
  24. [2, 0],
  25. [3, 1],
  26. [4, 1]
  27. ]
  28.  
  29. return return_dict
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement