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

Filter #184 #307

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Filter #184 #307

wants to merge 1 commit into from

Conversation

tomasmensik
Copy link
Contributor

ISSUE #184
"It would be nice to categorize tasks into custom categories (lessons, tests, projects, etc.). The table for teachers on the homepage should then show the points awarded to individual students amongst the categories.

The categories should be set in the task edit page. They can be hardcoded for simplicity first."


I didn't really fully understand the "homepage thing" of the issue but what I did understand was the categorization. I made a simple filter in the admin tab "Tasks". So, now you can filter through the tasks by either buttons you wanted (lessons, tests, projects) or by simply typing a name of the task into the search bar.

I didn't do the homepage points. But the filter/categorization works just fine.

Before: https://ctrlv.link/LKrr
After - default: https://ctrlv.link/aqb6
After - button clicked: https://ctrlv.link/64rd
After - search: https://ctrlv.link/HrhV

@Kobzol
Copy link
Collaborator

Kobzol commented Apr 21, 2023

Hi! The UI looks great, but before we start filtering or displaying tasks by their category, we should first implement assigning of categories to individual tasks, to avoid heuristics based on the task name.

So I would suggest to first implement a different PR, that will:

  1. Add category column to Task (it probably makes more sense to be in Task and not AssignedTask). I would use a (nullable) string for it, to allow arbitrary values eventually and to make it simple.
  2. Add a select box to TaskEdit page where teachers can select the task category. The default category should be lesson, and if it's NULL in the DB, it should also be treated as a lesson. I would use hard-coded categories "Lesson", "Test" and "Project" in the select box for now.

Once we have this data in the DB, we can use it to filter tasks by categories in the Tasks page, and also to split different task categories in the Teacher homepage.

@tomasmensik
Copy link
Contributor Author

Hey, unfortunately, I don't have access to the source code anymore. But those who want to finish it can.

The UI is fine, as you say, and it can be left there, and all that's left is to better optimize my code to your requirements.

@Kobzol
Copy link
Collaborator

Kobzol commented Apr 26, 2023

If you want to continue working on this PR, you can just download the source code from GitHub :)

$ git clone https://github.com/tomasmensik/kelvin
$ git checkout filter

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