pre_handle.py 696 B

12345678910111213141516171819202122
  1. # Collect question info in order to create the "Ask for Help/Checkoff" buttons
  2. if queue_enable:
  3. queue_questions = {}
  4. try:
  5. for problem in cs_problem_spec:
  6. if type(problem) != tuple:
  7. continue
  8. qtype, context = problem
  9. log = csm_cslog.most_recent(
  10. cs_course,
  11. cs_user_info.get('username', 'None'),
  12. '.'.join(cs_path_info[1:] + ['problemstate']),
  13. {},
  14. )
  15. score = log.get('scores', {}).get(context['csq_name'], 0)
  16. if score != 1:
  17. queue_questions[context['csq_name']] = (qtype, context)
  18. except NameError:
  19. pass