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
9bca4ebf
Commit
9bca4ebf
authored
Feb 11, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start to refactor grading settings
parent
58a2186e
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
27 additions
and
50 deletions
+27
-50
common/lib/xmodule/xmodule/peer_grading_module.py
+0
-8
common/lib/xmodule/xmodule/peer_grading_service.py
+2
-1
common/lib/xmodule/xmodule/x_module.py
+7
-1
lms/djangoapps/open_ended_grading/controller_query_service.py
+1
-0
lms/djangoapps/open_ended_grading/open_ended_notifications.py
+3
-4
lms/djangoapps/open_ended_grading/open_ended_util.py
+0
-13
lms/djangoapps/open_ended_grading/staff_grading_service.py
+1
-1
lms/djangoapps/open_ended_grading/views.py
+1
-2
lms/envs/aws.py
+3
-4
lms/envs/common.py
+9
-16
No files found.
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
9bca4ebf
"""
This module provides an interface on the grading-service backend
for peer grading
Use peer_grading_service() to get the version specified
in settings.PEER_GRADING_INTERFACE
"""
import
json
import
logging
import
requests
...
...
common/lib/xmodule/xmodule/peer_grading_service.py
View file @
9bca4ebf
...
...
@@ -28,6 +28,7 @@ class PeerGradingService(GradingService):
def
__init__
(
self
,
config
,
system
):
config
[
'system'
]
=
system
super
(
PeerGradingService
,
self
)
.
__init__
(
config
)
self
.
url
=
config
[
'url'
]
+
config
[
'peer_grading'
]
self
.
get_next_submission_url
=
self
.
url
+
'/get_next_submission/'
self
.
save_grade_url
=
self
.
url
+
'/save_grade/'
self
.
is_student_calibrated_url
=
self
.
url
+
'/is_student_calibrated/'
...
...
@@ -161,6 +162,6 @@ def peer_grading_service(system):
if
settings
.
MOCK_PEER_GRADING
:
_service
=
MockPeerGradingService
()
else
:
_service
=
PeerGradingService
(
settings
.
PEER
_GRADING_INTERFACE
,
system
)
_service
=
PeerGradingService
(
settings
.
OPEN_ENDED
_GRADING_INTERFACE
,
system
)
return
_service
common/lib/xmodule/xmodule/x_module.py
View file @
9bca4ebf
...
...
@@ -869,7 +869,10 @@ class ModuleSystem(object):
xqueue
=
None
,
node_path
=
""
,
anonymous_student_id
=
''
,
course_id
=
None
):
course_id
=
None
,
peer_grading_interface
=
None
,
staff_grading_interface
=
None
,
s3_interface
=
None
):
'''
Create a closure around the system environment.
...
...
@@ -920,6 +923,9 @@ class ModuleSystem(object):
self
.
anonymous_student_id
=
anonymous_student_id
self
.
course_id
=
course_id
self
.
user_is_staff
=
user
is
not
None
and
user
.
is_staff
self
.
peer_grading_interface
=
peer_grading_interface
self
.
staff_grading_interface
=
staff_grading_interface
self
.
s3_interface
=
s3_interface
def
get
(
self
,
attr
):
''' provide uniform access to attributes (like etree).'''
...
...
lms/djangoapps/open_ended_grading/controller_query_service.py
View file @
9bca4ebf
...
...
@@ -20,6 +20,7 @@ class ControllerQueryService(GradingService):
def
__init__
(
self
,
config
):
config
[
'system'
]
=
ModuleSystem
(
None
,
None
,
None
,
render_to_string
,
None
)
super
(
ControllerQueryService
,
self
)
.
__init__
(
config
)
self
.
url
=
config
[
'url'
]
+
config
[
'grading_controller'
]
self
.
check_eta_url
=
self
.
url
+
'/get_submission_eta/'
self
.
is_unique_url
=
self
.
url
+
'/is_name_unique/'
self
.
combined_notifications_url
=
self
.
url
+
'/combined_notifications/'
...
...
lms/djangoapps/open_ended_grading/open_ended_notifications.py
View file @
9bca4ebf
...
...
@@ -28,7 +28,7 @@ NOTIFICATION_TYPES = (
def
staff_grading_notifications
(
course
,
user
):
staff_gs
=
StaffGradingService
(
settings
.
STAFF
_GRADING_INTERFACE
)
staff_gs
=
StaffGradingService
(
settings
.
OPEN_ENDED
_GRADING_INTERFACE
)
pending_grading
=
False
img_path
=
""
course_id
=
course
.
id
...
...
@@ -61,7 +61,7 @@ def staff_grading_notifications(course, user):
def
peer_grading_notifications
(
course
,
user
):
system
=
ModuleSystem
(
None
,
None
,
None
,
render_to_string
,
None
)
peer_gs
=
peer_grading_service
.
PeerGradingService
(
settings
.
PEER
_GRADING_INTERFACE
,
system
)
peer_gs
=
peer_grading_service
.
PeerGradingService
(
settings
.
OPEN_ENDED
_GRADING_INTERFACE
,
system
)
pending_grading
=
False
img_path
=
""
course_id
=
course
.
id
...
...
@@ -93,8 +93,7 @@ def peer_grading_notifications(course, user):
def
combined_notifications
(
course
,
user
):
controller_url
=
open_ended_util
.
get_controller_url
()
controller_qs
=
ControllerQueryService
(
controller_url
)
controller_qs
=
ControllerQueryService
(
settings
.
OPEN_ENDED_GRADING_INTERFACE
)
student_id
=
unique_id_for_user
(
user
)
user_is_staff
=
has_access
(
user
,
course
,
'staff'
)
course_id
=
course
.
id
...
...
lms/djangoapps/open_ended_grading/open_ended_util.py
deleted
100644 → 0
View file @
58a2186e
from
django.conf
import
settings
import
logging
log
=
logging
.
getLogger
(
__name__
)
def
get_controller_url
():
peer_grading_url
=
settings
.
PEER_GRADING_INTERFACE
[
'url'
]
split_url
=
peer_grading_url
.
split
(
"/"
)
controller_url
=
"http://"
+
split_url
[
2
]
+
"/grading_controller"
controller_settings
=
settings
.
PEER_GRADING_INTERFACE
.
copy
()
controller_settings
[
'url'
]
=
controller_url
return
controller_settings
lms/djangoapps/open_ended_grading/staff_grading_service.py
View file @
9bca4ebf
...
...
@@ -163,7 +163,7 @@ def staff_grading_service():
if
settings
.
MOCK_STAFF_GRADING
:
_service
=
MockStaffGradingService
()
else
:
_service
=
StaffGradingService
(
settings
.
STAFF
_GRADING_INTERFACE
)
_service
=
StaffGradingService
(
settings
.
OPEN_ENDED
_GRADING_INTERFACE
)
return
_service
...
...
lms/djangoapps/open_ended_grading/views.py
View file @
9bca4ebf
...
...
@@ -30,8 +30,7 @@ log = logging.getLogger(__name__)
template_imports
=
{
'urllib'
:
urllib
}
controller_url
=
open_ended_util
.
get_controller_url
()
controller_qs
=
ControllerQueryService
(
controller_url
)
controller_qs
=
ControllerQueryService
(
settings
.
OPEN_ENDED_GRADING_INTERFACE
)
"""
Reverses the URL from the name and the course id, and then adds a trailing slash if
...
...
lms/envs/aws.py
View file @
9bca4ebf
...
...
@@ -101,10 +101,7 @@ XQUEUE_INTERFACE = AUTH_TOKENS['XQUEUE_INTERFACE']
MODULESTORE
=
AUTH_TOKENS
.
get
(
'MODULESTORE'
,
MODULESTORE
)
CONTENTSTORE
=
AUTH_TOKENS
.
get
(
'CONTENTSTORE'
,
CONTENTSTORE
)
STAFF_GRADING_INTERFACE
=
AUTH_TOKENS
.
get
(
'STAFF_GRADING_INTERFACE'
,
STAFF_GRADING_INTERFACE
)
PEER_GRADING_INTERFACE
=
AUTH_TOKENS
.
get
(
'PEER_GRADING_INTERFACE'
,
PEER_GRADING_INTERFACE
)
OPEN_ENDED_GRADING_INTERFACE
=
AUTH_TOKENS
.
get
(
'OPEN_ENDED_GRADING_INTERFACE'
,
OPEN_ENDED_GRADING_INTERFACE
)
PEARSON_TEST_USER
=
"pearsontest"
PEARSON_TEST_PASSWORD
=
AUTH_TOKENS
.
get
(
"PEARSON_TEST_PASSWORD"
)
...
...
@@ -114,3 +111,4 @@ PEARSON = AUTH_TOKENS.get("PEARSON")
# Datadog for events!
DATADOG_API
=
AUTH_TOKENS
.
get
(
"DATADOG_API"
)
OPEN_ENDED
\ No newline at end of file
lms/envs/common.py
View file @
9bca4ebf
...
...
@@ -311,37 +311,30 @@ WIKI_USE_BOOTSTRAP_SELECT_WIDGET = False
WIKI_LINK_LIVE_LOOKUPS
=
False
WIKI_LINK_DEFAULT_LEVEL
=
2
################################# Staff grading config #####################
#By setting up the default settings with an incorrect user name and password,
# will get an error when attempting to connect
STAFF_GRADING_INTERFACE
=
{
'url'
:
'http://sandbox-grader-001.m.edx.org/staff_grading'
,
'username'
:
'incorrect_user'
,
'password'
:
'incorrect_pass'
,
}
# Used for testing, debugging
MOCK_STAFF_GRADING
=
False
################################# Pearson TestCenter config ################
PEARSONVUE_SIGNINPAGE_URL
=
"https://www1.pearsonvue.com/testtaker/signin/SignInPage/EDX"
# TESTCENTER_ACCOMMODATION_REQUEST_EMAIL = "exam-help@edx.org"
#################################
Peer
grading config #####################
#################################
open ended
grading config #####################
#By setting up the default settings with an incorrect user name and password,
# will get an error when attempting to connect
PEER
_GRADING_INTERFACE
=
{
OPEN_ENDED
_GRADING_INTERFACE
=
{
'url'
:
'http://sandbox-grader-001.m.edx.org/peer_grading'
,
'username'
:
'incorrect_user'
,
'password'
:
'incorrect_pass'
,
'staff_grading'
:
'staff_grading'
,
'peer_grading'
:
'peer_grading'
,
'grading_controller'
:
'grading_controller'
}
# Used for testing, debugging
# Used for testing, debugging
peer grading
MOCK_PEER_GRADING
=
False
# Used for testing, debugging staff grading
MOCK_STAFF_GRADING
=
False
################################# Jasmine ###################################
JASMINE_TEST_DIRECTORY
=
PROJECT_ROOT
+
'/static/coffee'
...
...
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