Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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-ora2
Commits
1c5b01f1
Commit
1c5b01f1
authored
Oct 04, 2017
by
John Eskew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments to all imports moved into methods.
parent
4a086606
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
0 deletions
+19
-0
openassessment/xblock/course_items_listing_mixin.py
+1
-0
openassessment/xblock/grade_mixin.py
+5
-0
openassessment/xblock/leaderboard_mixin.py
+2
-0
openassessment/xblock/self_assessment_mixin.py
+1
-0
openassessment/xblock/staff_area_mixin.py
+6
-0
openassessment/xblock/submission_mixin.py
+3
-0
openassessment/xblock/validation.py
+1
-0
No files found.
openassessment/xblock/course_items_listing_mixin.py
View file @
1c5b01f1
...
...
@@ -24,6 +24,7 @@ class CourseItemsListingMixin(object):
Get information about all ora2 blocks in the course with response count for each step.
"""
# Import is placed here to avoid model import at project startup.
from
openassessment.data
import
OraAggregateData
responses
=
OraAggregateData
.
collect_ora2_responses
(
unicode
(
self
.
course_id
))
return
Response
(
json
.
dumps
(
responses
),
content_type
=
'application/json'
)
openassessment/xblock/grade_mixin.py
View file @
1c5b01f1
...
...
@@ -37,6 +37,7 @@ class GradeMixin(object):
Returns:
unicode: HTML content of the grade step.
"""
# Import is placed here to avoid model import at project startup.
from
submissions
import
api
as
sub_api
# Retrieve the status of the workflow. If no workflows have been
...
...
@@ -82,6 +83,7 @@ class GradeMixin(object):
Returns:
tuple of context (dict), template_path (string)
"""
# Import is placed here to avoid model import at project startup.
from
openassessment.assessment.api
import
peer
as
peer_api
from
openassessment.assessment.api
import
self
as
self_api
from
openassessment.assessment.api
import
staff
as
staff_api
...
...
@@ -189,6 +191,7 @@ class GradeMixin(object):
Dict with keys 'success' (bool) and 'msg' (unicode)
"""
# Import is placed here to avoid model import at project startup.
from
openassessment.assessment.api
import
peer
as
peer_api
feedback_text
=
data
.
get
(
'feedback_text'
,
u''
)
...
...
@@ -250,6 +253,7 @@ class GradeMixin(object):
...
}
"""
# Import is placed here to avoid model import at project startup.
from
openassessment.assessment.api
import
peer
as
peer_api
from
openassessment.assessment.api
import
self
as
self_api
from
openassessment.assessment.api
import
staff
as
staff_api
...
...
@@ -400,6 +404,7 @@ class GradeMixin(object):
The option for the median peer grade.
"""
# Import is placed here to avoid model import at project startup.
from
openassessment.assessment.api
import
peer
as
peer_api
median_scores
=
peer_api
.
get_assessment_median_scores
(
submission_uuid
)
...
...
openassessment/xblock/leaderboard_mixin.py
View file @
1c5b01f1
...
...
@@ -36,6 +36,7 @@ class LeaderboardMixin(object):
Returns:
unicode: HTML content of the leaderboard.
"""
# Import is placed here to avoid model import at project startup.
from
submissions
import
api
as
sub_api
# Retrieve the status of the workflow. If no workflows have been
# started this will be an empty dict, so status will be None.
...
...
@@ -63,6 +64,7 @@ class LeaderboardMixin(object):
Returns:
template_path (string), tuple of context (dict)
"""
# Import is placed here to avoid model import at project startup.
from
submissions
import
api
as
sub_api
# Retrieve top scores from the submissions API
...
...
openassessment/xblock/self_assessment_mixin.py
View file @
1c5b01f1
...
...
@@ -52,6 +52,7 @@ class SelfAssessmentMixin(object):
SubmissionError: Error occurred while retrieving the current submission.
SelfAssessmentRequestError: Error occurred while checking if we had a self-assessment.
"""
# Import is placed here to avoid model import at project startup.
from
submissions
import
api
as
submission_api
path
=
'openassessmentblock/self/oa_self_unavailable.html'
...
...
openassessment/xblock/staff_area_mixin.py
View file @
1c5b01f1
...
...
@@ -147,6 +147,7 @@ class StaffAreaMixin(object):
"""
Returns a context with staff assessment "ungraded" and "in-progress" counts.
"""
# Import is placed here to avoid model import at project startup.
from
openassessment.assessment.api
import
staff
as
staff_api
grading_stats
=
staff_api
.
get_staff_grading_statistics
(
course_id
,
item_id
)
...
...
@@ -183,6 +184,7 @@ class StaffAreaMixin(object):
Must be course staff to render this view.
"""
# Import is placed here to avoid model import at project startup.
from
openassessment.assessment.api
import
staff
as
staff_api
from
submissions
import
api
as
submission_api
try
:
...
...
@@ -284,6 +286,7 @@ class StaffAreaMixin(object):
Args:
student_username (unicode): The username of the student to report.
"""
# Import is placed here to avoid model import at project startup.
from
submissions
import
api
as
submission_api
anonymous_user_id
=
None
...
...
@@ -323,6 +326,7 @@ class StaffAreaMixin(object):
submission_uuid (unicode): The uuid of the submission, should NOT be None.
context: the context to update with additional information
"""
# Import is placed here to avoid model import at project startup.
from
openassessment.assessment.api
import
peer
as
peer_api
from
openassessment.assessment.api
import
self
as
self_api
from
openassessment.assessment.api
import
staff
as
staff_api
...
...
@@ -396,6 +400,7 @@ class StaffAreaMixin(object):
for a given problem. It will cancel the workflow using traditional methods to remove it from the grading pools,
and pass through to the submissions API to orphan the submission so that the user can create a new one.
"""
# Import is placed here to avoid model import at project startup.
from
submissions
import
api
as
submission_api
# Note that student_item cannot be constructed using get_student_item_dict, since we're in a staff context
student_item
=
{
...
...
@@ -452,6 +457,7 @@ class StaffAreaMixin(object):
If requesting_user is not provided, we will use the user to which this xblock is currently bound.
"""
# Import is placed here to avoid model import at project startup.
from
openassessment.workflow
import
api
as
workflow_api
try
:
assessment_requirements
=
self
.
workflow_requirements
()
...
...
openassessment/xblock/submission_mixin.py
View file @
1c5b01f1
...
...
@@ -68,6 +68,7 @@ class SubmissionMixin(object):
associated status tag (str), and status text (unicode).
"""
# Import is placed here to avoid model import at project startup.
from
submissions
import
api
if
'submission'
not
in
data
:
return
(
...
...
@@ -225,6 +226,7 @@ class SubmissionMixin(object):
return
{
'success'
:
False
,
'msg'
:
self
.
_
(
u"Files descriptions were not submitted."
)}
def
create_submission
(
self
,
student_item_dict
,
student_sub_data
,
files_descriptions
=
None
):
# Import is placed here to avoid model import at project startup.
from
submissions
import
api
# Store the student's response text in a JSON-encodable dict
...
...
@@ -434,6 +436,7 @@ class SubmissionMixin(object):
the front end.
"""
# Import is placed here to avoid model import at project startup.
from
submissions
import
api
try
:
return
api
.
get_submission
(
submission_uuid
)
...
...
openassessment/xblock/validation.py
View file @
1c5b01f1
...
...
@@ -314,6 +314,7 @@ def validator(oa_block, _, strict_post_release=True):
Returns:
callable, of a form that can be passed to `update_from_xml`.
"""
# Import is placed here to avoid model import at project startup.
from
submissions.api
import
MAX_TOP_SUBMISSIONS
def
_inner
(
rubric_dict
,
assessments
,
leaderboard_show
=
0
,
submission_start
=
None
,
submission_due
=
None
):
...
...
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