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

Make problem search more sane #2051

Merged
merged 1 commit into from
Jan 2, 2023
Merged

Make problem search more sane #2051

merged 1 commit into from
Jan 2, 2023

Conversation

int-y1
Copy link
Contributor

@int-y1 int-y1 commented Dec 10, 2022

fixes these 2 issues:

  1. go to /problems/. search for a20. get 1 result. clear a20 and search again. see point_start=5.0&point_end=5.0 in querystring.
  2. go to /problems/. select all 4 checkboxes. click "PROBLEMS" in site header. see "Has editorial" get unselected.

@codecov-commenter
Copy link

Codecov Report

Base: 46.44% // Head: 46.44% // No change to project coverage 👍

Coverage data is based on head (099f359) compared to base (8e914a0).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2051   +/-   ##
=======================================
  Coverage   46.44%   46.44%           
=======================================
  Files         236      236           
  Lines       13072    13072           
=======================================
  Hits         6071     6071           
  Misses       7001     7001           
Impacted Files Coverage Δ
judge/views/problem.py 24.39% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -443,8 +443,9 @@ def get_noui_slider_points(self):
if not points:
return 0, 0, {}
if len(points) == 1:
return points[0], points[0], {
return points[0] - 1, points[0] + 1, {
Copy link
Member

Choose a reason for hiding this comment

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

Why does this fix things?

Copy link
Contributor Author

@int-y1 int-y1 Dec 10, 2022

Choose a reason for hiding this comment

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

If the problem list only has 5p problems, this code will make the server give point_start=4 and point_values.min=4. Also,

$start.prop('disabled', start === point_values.min).val(start);

Disabled inputs aren't put in the querystring.

Same goes for point_end=6 and point_values.max=6.

Copy link
Member

@Xyene Xyene left a comment

Choose a reason for hiding this comment

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

👍

@Xyene Xyene merged commit 03165bf into DMOJ:master Jan 2, 2023
@int-y1 int-y1 deleted the prob-search branch January 2, 2023 19:17
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.

3 participants