<commit_before><%
# TODO: I am assuming that any new submission or grading will touch the course (or the user) so that will make this cache work,
# if not we need to cache smarter. -RS
# BTW if you add a new thing here, it probably needs adding to the /users/self/todo API
cache(safe_cache_key([@current_user, contexts, 'a_need_grading'])) do<commit_msg>expire dashboard todo list after 3 minutes; refs #7753<commit_after><%
# This is rendered both on the dashboard and on the course homepage. On the
# dashboard, contexts is nil, and so the cache is only based on the user, which
# does not get touched when an assignment needs_grading count changes. So for
# the dashboard, we expire after 3 minutes. On the course page, contexts is the
# course, which does get touched, and so the cache expiration works.
#
# BTW if you add a new thing here, it probably needs adding to the /users/self/todo API
cache_opts = (contexts.present? ? {} : { :expires_in => 3.minutes })
cache(safe_cache_key([@current_user, contexts, 'a_need_grading']), cache_opts) do
{'fraction_non_alphanumeric': 0.08110687022900763, 'fraction_numerical': 0.006679389312977099, 'mean_word_length': 4.73224043715847, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2399522', 'n_tokens_mistral': 317, 'n_tokens_neox': 297, 'n_words': 152}