Skip to content

[frontend] Tags for tasks are now categories and managed by the Task Dispenser#855

Merged
anthonygego merged 8 commits into
INGInious:masterfrom
maleclercq:copie_master_Categorie
Jul 29, 2022
Merged

[frontend] Tags for tasks are now categories and managed by the Task Dispenser#855
anthonygego merged 8 commits into
INGInious:masterfrom
maleclercq:copie_master_Categorie

Conversation

@maleclercq

Copy link
Copy Markdown
Contributor

No description provided.

@anthonygego anthonygego left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In order to keep categories usable in the submission queries, all the task dispenser should provide categorization. So it should be part of the task_dispenser interface.

Comment thread inginious/frontend/static/js/task_dispensers.js Outdated
Comment thread inginious/frontend/templates/task_dispensers/task_list.html

@anthonygego anthonygego left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This was probably ambitious to divide concepts and refactor one of them in one PR. There are still some mixups to fix to cleanups to be done.

Comment thread inginious/frontend/tasks.py Outdated
def get_categories(self):
""" Returns the tags id associated to the task """
return [category for category in self._categories if category in self._course.get_tags()]
#def get_categories(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can remove this code I guess

{{ t.get_name(user_manager.session_language()) }}
</li>
{% endif %}
{% for tag in course.get_task_dispenser().get_all_categories() %}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In this PR categories are taken away from the tag concept. It's worth renaming the "tag" filter to "category" filter in the UI to avoid any confusion.

Comment thread inginious/frontend/templates/task.html Outdated
{% set ns.tags_ok_counter = ns.tags_ok_counter + 1 %}
{% set ns.list_tags_ok = ns.list_tags_ok + tag.get_name(user_manager.session_language()) %}
{% endif %}
{% for tag in course.get_task_dispenser().get_categories(task.get_id()) %}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here we talk about tags and not categories. You can probably keep the old code and iterate on course_tags.

Comment thread inginious/frontend/templates/course_admin/submissions.html
Comment thread inginious/frontend/templates/task.html
{% if tag.get_type() in [0, 2] and tag.is_visible_for_student() %}
<option value="{{ tag.get_id() }}">{{ tag.get_name(user_manager.session_language()) }}</option>
{% endif %}
{% for tag in tag_filter_list %}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rename tag => category here.

{% if tag.is_visible_for_student() or user_manager.has_staff_rights_on_course(course) %}
<div id="tag" data-tag-name="{{tag.get_id()}}"></div>
{% endif %}
{% for tag in course.get_task_dispenser().get_categories(task.get_id()) %}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rename tag => category here.

Comment thread inginious/frontend/pages/tasks.py
eval_submission=eval_submission, user_task=user_task,
previous_taskid=previous_taskid, next_taskid=next_taskid,
webterm_link=self.webterm_link, input_random_list=random_input_list,
visible_tags=visible_tags, pdict=pdict, is_input_list=is_input_list)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should actually be kept, it is moreover still used in the template.

Comment thread inginious/frontend/pages/course.py Outdated
tasks_data=tasks_data,
grade=course_grade,
tag_filter_list=tag_list)
tag_filter_list=categories)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rename tag filter to category filter.

@anthonygego

Copy link
Copy Markdown
Member

LGTM

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