Skip to content

Commit

Permalink
Merge pull request #33 from muhammad-ammar/ammar/pass-course-key-to-t…
Browse files Browse the repository at this point in the history
…axonomy-skill-api

feat: pass course key as query param to taxonomy skills api
  • Loading branch information
irfanuddinahmad authored Mar 21, 2024
2 parents c7d3723 + 2fc3f4b commit 21ff174
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ Unreleased
**********


[0.1.9] - 2024-03-20
************************************************

Changed
=======

* Pass course key as query param to taxonomy skills api


[0.1.8] - 2024-03-14
************************************************

Expand Down
2 changes: 1 addition & 1 deletion skill_tagging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Django app plugin for fetching and verifying tags for xblock skills.
"""

__version__ = '0.1.8'
__version__ = '0.1.9'

# pylint: disable=invalid-name
default_app_config = 'skill_tagging.apps.SkillTaggingConfig'
5 changes: 5 additions & 0 deletions skill_tagging/skill_tagging_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,19 @@ def fetch_skill_tags(self):
user = user_service.get_user_by_anonymous_id()
api_client = get_api_client(user=user)

course_key_str = str(self.scope_ids.usage_id.context_key)
usage_id_str = str(self.scope_ids.usage_id)
LOGGER.info(
f"[XBLOCK_SKILL_TAGGING] Fetching Skills. XBlock: [{usage_id_str}], Course: [{course_key_str}]."
)
XBLOCK_SKILL_TAGS_API = urljoin(
settings.TAXONOMY_API_BASE_URL,
'/taxonomy/api/v1/xblocks/'
)
response = api_client.get(
XBLOCK_SKILL_TAGS_API,
params={
"course_key": course_key_str,
"usage_key": usage_id_str,
"page_size": PAGE_SIZE,
"verified": False,
Expand Down
1 change: 0 additions & 1 deletion skill_tagging/static/tags_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<h1>{% translate "What did you learn?" %}</h1>
<p>
{% if block_type == 'vertical' %}
{% translate "Congratulations, you've reached the end of this unit!" %}<br>
{% translate "Help future students by selecting the skills or subjects you learned from this unit." %}
{% elif block_type == 'video' %}
{% translate "Help future students by selecting the skills or subjects you learned from this video." %}
Expand Down

0 comments on commit 21ff174

Please sign in to comment.