Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
8ccc27b4
Commit
8ccc27b4
authored
Jul 02, 2015
by
Alison Hodges
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix pep8 violations
parent
74102861
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
22 deletions
+31
-22
lms/djangoapps/instructor/views/api.py
+31
-22
No files found.
lms/djangoapps/instructor/views/api.py
View file @
8ccc27b4
...
@@ -1107,13 +1107,15 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=red
...
@@ -1107,13 +1107,15 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=red
else
:
else
:
try
:
try
:
instructor_task
.
api
.
submit_calculate_students_features_csv
(
request
,
course_key
,
query_features
)
instructor_task
.
api
.
submit_calculate_students_features_csv
(
request
,
course_key
,
query_features
)
success_status
=
_
(
"Your enrolled student profile report is being generated!"
\
success_status
=
_
(
" You can view the status of the generation task in the 'Pending Tasks' section."
)
"Your enrolled student profile report is being generated! "
"You can view the status of the generation task in the 'Pending Tasks' section."
)
return
JsonResponse
({
"status"
:
success_status
})
return
JsonResponse
({
"status"
:
success_status
})
except
AlreadyRunningError
:
except
AlreadyRunningError
:
already_running_status
=
_
(
"An enrolled student profile report generation task is already in progress."
\
already_running_status
=
_
(
" Check the 'Pending Tasks' table for the status of the task. When completed,"
\
"An enrolled student profile report generation task is already in progress. "
" the report will be available for download in the table below."
)
"Check the 'Pending Tasks' table for the status of the task. When completed, "
"the report will be available for download in the table below."
)
return
JsonResponse
({
"status"
:
already_running_status
})
return
JsonResponse
({
"status"
:
already_running_status
})
...
@@ -1232,13 +1234,15 @@ def get_enrollment_report(request, course_id):
...
@@ -1232,13 +1234,15 @@ def get_enrollment_report(request, course_id):
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_id
)
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_id
)
try
:
try
:
instructor_task
.
api
.
submit_detailed_enrollment_features_csv
(
request
,
course_key
)
instructor_task
.
api
.
submit_detailed_enrollment_features_csv
(
request
,
course_key
)
success_status
=
_
(
"Your detailed enrollment report is being generated! "
success_status
=
_
(
"You can view the status of the generation task in the 'Pending Tasks' section."
)
"Your detailed enrollment report is being generated! "
"You can view the status of the generation task in the 'Pending Tasks' section."
)
return
JsonResponse
({
"status"
:
success_status
})
return
JsonResponse
({
"status"
:
success_status
})
except
AlreadyRunningError
:
except
AlreadyRunningError
:
already_running_status
=
_
(
"A detailed enrollment report generation task is already in progress. "
already_running_status
=
_
(
"Check the 'Pending Tasks' table for the status of the task. "
"A detailed enrollment report generation task is already in progress. "
"When completed, the report will be available for download in the table below."
)
"Check the 'Pending Tasks' table for the status of the task. "
"When completed, the report will be available for download in the table below."
)
return
JsonResponse
({
return
JsonResponse
({
"status"
:
already_running_status
"status"
:
already_running_status
})
})
...
@@ -1255,8 +1259,9 @@ def get_exec_summary_report(request, course_id):
...
@@ -1255,8 +1259,9 @@ def get_exec_summary_report(request, course_id):
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_id
)
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_id
)
try
:
try
:
instructor_task
.
api
.
submit_executive_summary_report
(
request
,
course_key
)
instructor_task
.
api
.
submit_executive_summary_report
(
request
,
course_key
)
status_response
=
_
(
"Your executive summary report is being created. "
status_response
=
_
(
"To view the status of the report, see the 'Pending Tasks' section."
)
"Your executive summary report is being created. "
"To view the status of the report, see the 'Pending Tasks' section."
)
except
AlreadyRunningError
:
except
AlreadyRunningError
:
status_response
=
_
(
status_response
=
_
(
"An executive summary report is currently in progress. "
"An executive summary report is currently in progress. "
...
@@ -2136,13 +2141,15 @@ def calculate_grades_csv(request, course_id):
...
@@ -2136,13 +2141,15 @@ def calculate_grades_csv(request, course_id):
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_id
)
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_id
)
try
:
try
:
instructor_task
.
api
.
submit_calculate_grades_csv
(
request
,
course_key
)
instructor_task
.
api
.
submit_calculate_grades_csv
(
request
,
course_key
)
success_status
=
_
(
"Your grade report is being generated! "
success_status
=
_
(
"You can view the status of the generation task in the 'Pending Tasks' section."
)
"Your grade report is being generated! "
"You can view the status of the generation task in the 'Pending Tasks' section."
)
return
JsonResponse
({
"status"
:
success_status
})
return
JsonResponse
({
"status"
:
success_status
})
except
AlreadyRunningError
:
except
AlreadyRunningError
:
already_running_status
=
_
(
"A grade report generation task is already in progress. "
already_running_status
=
_
(
"Check the 'Pending Tasks' table for the status of the task. "
"A grade report generation task is already in progress. "
"When completed, the report will be available for download in the table below."
)
"Check the 'Pending Tasks' table for the status of the task. "
"When completed, the report will be available for download in the table below."
)
return
JsonResponse
({
return
JsonResponse
({
"status"
:
already_running_status
"status"
:
already_running_status
})
})
...
@@ -2162,13 +2169,15 @@ def problem_grade_report(request, course_id):
...
@@ -2162,13 +2169,15 @@ def problem_grade_report(request, course_id):
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_id
)
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_id
)
try
:
try
:
instructor_task
.
api
.
submit_problem_grade_report
(
request
,
course_key
)
instructor_task
.
api
.
submit_problem_grade_report
(
request
,
course_key
)
success_status
=
_
(
"Your problem grade report is being generated! "
success_status
=
_
(
"You can view the status of the generation task in the 'Pending Tasks' section."
)
"Your problem grade report is being generated! "
"You can view the status of the generation task in the 'Pending Tasks' section."
)
return
JsonResponse
({
"status"
:
success_status
})
return
JsonResponse
({
"status"
:
success_status
})
except
AlreadyRunningError
:
except
AlreadyRunningError
:
already_running_status
=
_
(
"A problem grade report is already being generated. "
already_running_status
=
_
(
"Check the 'Pending Tasks' table for the status of the task. "
"A problem grade report is already being generated. "
"When completed, the report will be available for download in the table below."
)
"Check the 'Pending Tasks' table for the status of the task. "
"When completed, the report will be available for download in the table below."
)
return
JsonResponse
({
return
JsonResponse
({
"status"
:
already_running_status
"status"
:
already_running_status
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment