Skip to content

Commit

Permalink
Small fixes to personalized points goal
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelGusse committed Aug 21, 2024
1 parent 4172f22 commit 00cb5b4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions exercise/static/exercise/personalized_points_goal.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ $(document).ready(function() {

// Update progress-bar style
$progressDiv.find('.progress-bar').removeClass('progress-bar-primary');

$('#deletePointsGoalForm').hide();

$('#remove-success-alert').show();
setTimeout(function() {
Expand Down
1 change: 0 additions & 1 deletion exercise/templates/exercise/_user_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ <h3 class="panel-title">
{% csrf_token %}
{% if user.id %}
{% get_max_module_points module.id user.id as max_points %}
{% get_points_goal module.id user.id as points_goal %}
{% if max_points > 0 and user.id %}
<a class="page-modal aplus-button--secondary aplus-button--xs" style="float: right; margin-left: 5px;" role="button" href="{% url 'save_points_goal_form_view' course_slug=course.url instance_slug=instance.url module_slug=module.url %}" data-module-id="{{ module.id }}" title="{% translate 'POINTS_GOAL_TOOLTIP' %}" data-toggle="tooltip">
<span class="glyphicon glyphicon-screenshot" aria-hidden="true"></span> {% translate 'POINTS_GOAL' %}
Expand Down
2 changes: 1 addition & 1 deletion exercise/templatetags/exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def get_max_module_points(module: int, student: int) -> int:


@register.simple_tag
def get_points_goal(module: int, student: int) -> int:
def get_points_goal(module: int, student: int) -> Union[int, bool]:
student = UserProfile.objects.get(id=student)
module = CourseModule.objects.get(id=module)
try:
Expand Down

0 comments on commit 00cb5b4

Please sign in to comment.