Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notify users if they have submitted a text answer but sent no description #1421

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

michalstanik1
Copy link
Contributor

…tion

@codecov
Copy link

codecov bot commented Feb 21, 2023

Codecov Report

Merging #1421 (87cbf60) into master (2e3ab36) will increase coverage by 0.10%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1421      +/-   ##
==========================================
+ Coverage   74.29%   74.39%   +0.10%     
==========================================
  Files         138      138              
  Lines        6482     6492      +10     
  Branches      822      824       +2     
==========================================
+ Hits         4816     4830      +14     
+ Misses       1520     1518       -2     
+ Partials      146      144       -2     
Impacted Files Coverage Δ
trojsten/contests/helpers.py 100.00% <100.00%> (ø)
trojsten/contests/templatetags/statements_parts.py 100.00% <100.00%> (ø)
trojsten/contests/views.py 83.54% <100.00%> (+0.42%) ⬆️
trojsten/contests/models.py 93.43% <0.00%> (+0.77%) ⬆️
trojsten/submit/templatetags/submit_parts.py 94.11% <0.00%> (+2.94%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@gardenerik gardenerik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zabezpečme, prosím, nech ak by sa ďalšia súťaž rozhodla mať textové submity, nech im to tam automaticky nesvieti.

@@ -1016,3 +1016,6 @@ msgstr "Len tento seminár"

msgid "Include all sites"
msgstr "Zahrnúť všetky semináre"

msgid "You have submitted a text answer but have not submitted a description. This may lead to point deduction."
msgstr "Máš odovzdanú textovú odpoveď, ale žiaden popis. Toto môže viesť k strate bodov."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msgstr "Máš odovzdanú textovú odpoveď, ale žiaden popis. Toto môže viesť k strate bodov."
msgstr "Máš odovzdanú textovú odpoveď, ale žiaden popis. Toto môže viesť k strate bodov."

and task.round.can_submit
and user_submits.filter(task=task, submit_type=SUBMIT_TYPE_TEXT, points__gt=0)
and not user_submits.filter(task=task, submit_type=SUBMIT_TYPE_DESCRIPTION)
):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Toto má potenciál spraviť pomerne veľké množstvo dotazov na databázu.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Máš nejaký návrh, ako to spraviť lepšie? Ak to bude iba 1 query a toto finálne filtrovanie sa urobí čisto v Pythone, pomôže to alebo sa to zhorší?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gardenerik Vieš sa, prosím, vyjadriť k tomuto? Ako zefektívniť ten dotaz na databázu?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asi by som si vybral všetky submity, ktoré ťa zaujímajú a potom cez nejaký dict zisťovať, či pre danú úlohu (ne)existujú oba

@michalstanik1
Copy link
Contributor Author

Takže navrhuješ tam pridať podmienku typu "a zároveň súťaž je suši"?

Rozmýšľal som nad tým a je rovnako možné, že ďalšia súťaž s textovými submitmi bude tiež chcieť nejaké dôkazy/popisy, ako že nebude chcieť.

@gardenerik
Copy link
Collaborator

V tomto stave ideálne asi ako konštanta v pravidlách súťaže? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants