forked from apluslms/a-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Personalized points goal improvements
- Loading branch information
1 parent
5ffda9a
commit 9b61e00
Showing
12 changed files
with
170 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
course/migrations/0064_alter_studentmodulegoal_personalized_points_goal.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.2.11 on 2024-08-01 13:04 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("course", "0063_alter_studentmodulegoal_personalized_points_goal"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="studentmodulegoal", | ||
name="personalized_points_goal", | ||
field=models.FloatField(default=100.0), | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
..._rename_personalized_points_goal_studentmodulegoal_personalized_points_goal_percentage.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.2.11 on 2024-08-01 13:18 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("course", "0064_alter_studentmodulegoal_personalized_points_goal"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name="studentmodulegoal", | ||
old_name="personalized_points_goal", | ||
new_name="personalized_points_goal_percentage", | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.progress .goal-points { | ||
position: absolute; | ||
height: 20px; | ||
border-left: 1px solid blue; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
{% load i18n %} | ||
{% load static %} | ||
{% if not feedback_revealed %} | ||
<p class="small"> | ||
<i class="glyphicon glyphicon-info-sign"></i> | ||
{% translate "RESULTS_OF_SOME_ASSIGNMENTS_ARE_CURRENTLY_HIDDEN" %} | ||
</p> | ||
{% endif %} | ||
Personalized {{personalized_points_goal}} | ||
|
||
<div class="progress" data-toggle="tooltip" data-html="true" data-placement="bottom" | ||
title="{% translate 'POINTS' %}: <span class='text-nowrap'>{{ formatted_points }} / {{ max }}</span>{% if required %} {% translate 'POINTS_TO_PASS' %}: <span class='text-nowrap'>{{ required }}</span>{% endif %}"> | ||
<div class="progress-bar progress-bar-striped progress-bar-{% if percentage >= personalized_points_goal %}info{% elif full_score %}success{% elif passed %}warning{% else %}danger{% endif %}" | ||
title="{% translate 'POINTS' %}: <span class='text-nowrap'>{{ formatted_points }} / {{ max }}</span>{% if required %} {% translate 'POINTS_TO_PASS' %}: <span class='text-nowrap'>{{ required }}</span> {% endif %}{% if personalized_points_module_goal %} {% translate 'PERSONALIZED_POINTS_GOAL' %}: <span class='text-nowrap'>{{ formatted_points }} / {{ personalized_points_module_goal_points|floatformat:"0" }}</span>{% endif %}"> | ||
<div class="progress-bar progress-bar-striped progress-bar-{% if full_score %}success{% elif percentage >= personalized_points_module_goal %}primary{% elif passed %}warning{% else %}danger{% endif %}" | ||
rel="progressbar" aria-valuenow="{{ points }}" aria-valuemin="0" aria-valuemax="{{ max }}" | ||
style="width:{{ percentage }}%;"></div> | ||
{% if required_percentage %} | ||
<div class="required-points" style="left:{{ required_percentage }}%"></div> | ||
{% endif %} | ||
{% if personalized_points_module_goal %} | ||
<link rel="stylesheet" href="{% static 'exercise/css/goal_points.css' %}" /> | ||
<div class="goal-points" style="left:{{ personalized_points_module_goal|floatformat:0 }}%"></div> | ||
{% endif %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- points_goal_modal.html --> | ||
<div id="pointsGoalModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="pointsGoalModalLabel"> | ||
<div class="modal-dialog" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | ||
<h4 class="modal-title" id="pointsGoalModalLabel">Set points goal for module {{module.name}}</h4> | ||
</div> | ||
<div class="modal-body"> | ||
<form method="post" action="{% url 'save_points_goal' %}"> | ||
{% csrf_token %} | ||
<div class="form-group"> | ||
<label for="points-goal" class="control-label">Points Goal:</label> | ||
<input type="text" class="form-control" id="points-goal" name="points_goal" placeholder="Enter points or percentage (e.g., 50 or 50%)"> | ||
</div> | ||
<!-- Hidden fields to automatically send more information --> | ||
<input type="hidden" name="student" value="{{ user.id }}"> | ||
<input type="hidden" id="module" name="module-id" value=""> | ||
|
||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> | ||
<button type="submit" class="btn btn-primary">Save changes</button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters