Merge branch 'master' into dkaplan1/APER-2851_replicate-share-certificate-in-facebook-improvements-for-edx.org

This commit is contained in:
Deborah Kaplan
2024-01-16 18:09:03 -05:00
committed by GitHub
10 changed files with 24 additions and 10 deletions

View File

@@ -600,7 +600,7 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient):
if scope != Scope.user_state:
raise ValueError("Only Scope.user_state is supported")
results = StudentModule.objects.order_by('id').filter(module_state_key=block_key)
results = StudentModule.objects.order_by('id').filter(module_state_key=block_key).select_related('student')
p = Paginator(results, settings.USER_STATE_BATCH_SIZE)
for page_number in p.page_range:

View File

@@ -349,7 +349,7 @@ def list_problem_responses(course_key, problem_location, limit_responses=None):
smdat = StudentModule.objects.filter(
course_id=course_key,
module_state_key=problem_key
)
).select_related('student')
smdat = smdat.order_by('student')
if limit_responses is not None:
smdat = smdat[:limit_responses]

View File

@@ -21,6 +21,6 @@
{% endblock %}
{% block header %}{{ block.super }}
{% block messages %}{{ block.super }}
{% include "survey_report/admin_banner.html" %}
{% endblock %}
{% endblock %}

View File

@@ -21,7 +21,7 @@ class SurveyReportAdmin(admin.ModelAdmin):
)
list_display = (
'id', 'summary', 'created_at', 'state'
'id', 'summary', 'created_at', 'report_state'
)
actions = ['send_report']
@@ -80,4 +80,16 @@ class SurveyReportAdmin(admin.ModelAdmin):
del actions['delete_selected']
return actions
def report_state(self, obj):
"""
Method to define the custom State column with the new "send" state,
to avoid modifying the current models.
"""
try:
if obj.surveyreportupload_set.last().is_uploaded():
return "Sent"
except AttributeError:
return obj.state.capitalize()
report_state.short_description = 'State'
admin.site.register(SurveyReport, SurveyReportAdmin)

View File

@@ -1,5 +1,6 @@
{% block survey_report_banner %}
{% if show_survey_report_banner %}
{% load static %}
<div id="originalContent" style="border: 3px solid #06405d; margin-bottom: 50px; rgb(0 0 0 / 18%) 0px 3px 5px;">
<div style="background-color: #06405d;padding: 17px 37px;">
<h1 style="margin: 0; color: #FFFF; font-weight: 600;">Join the Open edX Data Sharing Initiative and shape the future of learning</h1>
@@ -31,6 +32,7 @@
{% endif %}
<!-- The original content of the block -->
<script type="text/javascript" src="{% static 'common/js/vendor/jquery.js' %}"></script>
<script>
$(document).ready(function(){
$('#dismissButton').click(function() {

View File

@@ -5,7 +5,7 @@
<li>
<form method="POST" action="{% url 'openedx.generate_survey_report' %}" class="inline">
{% csrf_token %}
<input type="submit" value="Generate Report" class="default" name="_generatereport">
<input type="submit" value="Generate and Send Report" class="default" name="_sendreport">
</form>
</li>
</ul>

View File

@@ -787,7 +787,7 @@ openedx-mongodbproxy==0.2.0
# via -r requirements/edx/kernel.in
optimizely-sdk==4.1.1
# via -r requirements/edx/bundled.in
ora2==6.0.25
ora2==6.0.26
# via -r requirements/edx/bundled.in
packaging==23.2
# via

View File

@@ -1324,7 +1324,7 @@ optimizely-sdk==4.1.1
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
ora2==6.0.25
ora2==6.0.26
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt

View File

@@ -929,7 +929,7 @@ openedx-mongodbproxy==0.2.0
# via -r requirements/edx/base.txt
optimizely-sdk==4.1.1
# via -r requirements/edx/base.txt
ora2==6.0.25
ora2==6.0.26
# via -r requirements/edx/base.txt
packaging==23.2
# via

View File

@@ -989,7 +989,7 @@ openedx-mongodbproxy==0.2.0
# via -r requirements/edx/base.txt
optimizely-sdk==4.1.1
# via -r requirements/edx/base.txt
ora2==6.0.25
ora2==6.0.26
# via -r requirements/edx/base.txt
packaging==23.2
# via