-
Notifications
You must be signed in to change notification settings - Fork 0
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
change achievement categrory selection to dropdown #13
change achievement categrory selection to dropdown #13
Conversation
Although, this is not ideal. After selecting a category and submitting, then only the displayed category is available in the dropdown list. Not sure yet how to recover the list of all available categories. |
The only way I can think of was to just load all records at the start, then just loop/filter them with grep. The old transitional code I removed was already looping through all achievement records and there probably won't be too many achievements, so just loading them all is probably okay. I just wasn't sure how necessary that is if someone could just type out the category (even though a drop down would be nicer). |
I'll update this soon. |
d623d4d
to
6cc78ce
Compare
OK, now there is a DB utility to list all the achievement categories and it puts them in the select using that utility. |
Works well, only thing I see is since the drop down always contains a valid category, the javascript validation for the filter can be removed for this case. My thoughts were a bit more extensive, since I think we are doubling up on database calls here. Since we are getting all achievement records anyways when calling But your method lead me to another thought, what about let the database do the filtering (so we aren't really getting every possible record), instead have a Anyways, once the javascript validation for this filter category is removed I'll merge, unless you think it is wort while addressing my other comments. |
Opps, clicked the wrong button. |
To remove the javascript validation just delete lines 68 and 75-78 in |
I'd like to query like
but I don't find any existing use of a |
I also couldn't figure it out. The only place I see |
I think I see how to hack it in. Maybe the hack can be developed further once more eyes are on it. |
OK, it comes from SQL::Abstract::Classic... |
6cc78ce
to
f8eb14d
Compare
Alright I got it working so the database does the "distinct" part. And I don't think it's hackish. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleted the wrong line here (my bad, I guess I read the line number incorrectly). Delete the line above this, 66, const filter_category = ...
.
const filter_category = document.getElementById('filter_category'); | ||
if (filter === 'selected' && !is_achievement_selected()) { | ||
e.preventDefault(); | ||
e.stopPropagation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the lines, unsure why they didn't show up in my last review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I added them (er deleted them) after your comment and then force pushed.
f8eb14d
to
78ad7a3
Compare
And now sorted on the database end, not the perl end. |
78ad7a3
to
7f55b38
Compare
OK, updated the js lines. |
Looks good now. |
Help updates to InstructorIndex and InstructorProblemGrader.
This makes the category selection offer a dropdown with only the available categories.