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
b8176e5e
Commit
b8176e5e
authored
Aug 23, 2012
by
Tom Giannattasio
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature/tomg/fall-design
parents
0ebcf25a
bd0b9aca
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
24 deletions
+21
-24
common/djangoapps/student/models.py
+1
-1
common/lib/capa/capa/correctmap.py
+6
-4
lms/djangoapps/courseware/module_render.py
+6
-3
lms/djangoapps/django_comment_client/base/views.py
+1
-1
lms/djangoapps/django_comment_client/forum/views.py
+3
-3
lms/envs/common.py
+2
-0
lms/lib/comment_client/user.py
+0
-10
lms/templates/discussion/user_profile.html
+1
-1
repo-requirements.txt
+1
-1
No files found.
common/djangoapps/student/models.py
View file @
b8176e5e
...
...
@@ -273,7 +273,7 @@ def add_user_to_default_group(user, group):
utg
.
users
.
add
(
User
.
objects
.
get
(
username
=
user
))
utg
.
save
()
#
@receiver(post_save, sender=User)
@receiver
(
post_save
,
sender
=
User
)
def
update_user_information
(
sender
,
instance
,
created
,
**
kwargs
):
try
:
cc_user
=
cc
.
User
.
from_django_user
(
instance
)
...
...
common/lib/capa/capa/correctmap.py
View file @
b8176e5e
...
...
@@ -73,10 +73,12 @@ class CorrectMap(object):
return
answer_id
in
self
.
cmap
and
self
.
cmap
[
answer_id
][
'queuekey'
]
==
test_key
def
get_npoints
(
self
,
answer_id
):
if
self
.
is_correct
(
answer_id
):
npoints
=
self
.
cmap
[
answer_id
]
.
get
(
'npoints'
,
1
)
# default to 1 point if correct
return
npoints
or
1
return
0
# if not correct, return 0
npoints
=
self
.
get_property
(
answer_id
,
'npoints'
)
if
npoints
is
not
None
:
return
npoints
elif
self
.
is_correct
(
answer_id
):
return
1
return
0
# if not correct and no points have been assigned, return 0
def
set_property
(
self
,
answer_id
,
property
,
value
):
if
answer_id
in
self
.
cmap
:
self
.
cmap
[
answer_id
][
property
]
=
value
...
...
lms/djangoapps/courseware/module_render.py
View file @
b8176e5e
...
...
@@ -199,7 +199,10 @@ def _get_module(user, request, location, student_module_cache, course_id, positi
)
# Fully qualified callback URL for external queueing system
xqueue_callback_url
=
request
.
build_absolute_uri
(
'/'
)[:
-
1
]
# Trailing slash provided by reverse
xqueue_callback_url
=
'{proto}://{host}'
.
format
(
host
=
request
.
get_host
(),
proto
=
request
.
META
.
get
(
'HTTP_X_FORWARDED_PROTO'
,
'https'
if
request
.
is_secure
()
else
'http'
)
)
xqueue_callback_url
+=
reverse
(
'xqueue_callback'
,
kwargs
=
dict
(
course_id
=
course_id
,
userid
=
str
(
user
.
id
),
...
...
@@ -346,10 +349,10 @@ def xqueue_callback(request, course_id, userid, id, dispatch):
get
=
request
.
POST
.
copy
()
for
key
in
[
'xqueue_header'
,
'xqueue_body'
]:
if
not
get
.
has_key
(
key
):
r
eturn
Http404
r
aise
Http404
header
=
json
.
loads
(
get
[
'xqueue_header'
])
if
not
isinstance
(
header
,
dict
)
or
not
header
.
has_key
(
'lms_key'
):
r
eturn
Http404
r
aise
Http404
# Retrieve target StudentModule
user
=
User
.
objects
.
get
(
id
=
userid
)
...
...
lms/djangoapps/django_comment_client/base/views.py
View file @
b8176e5e
...
...
@@ -51,7 +51,7 @@ def ajax_content_response(request, course_id, content, template_name):
'content'
:
content
,
}
html
=
render_to_string
(
template_name
,
context
)
user_info
=
cc
.
User
.
from_django_user
(
request
.
user
)
.
safe_attributes
()
user_info
=
cc
.
User
.
from_django_user
(
request
.
user
)
.
to_dict
()
annotated_content_info
=
utils
.
get_annotated_content_info
(
course_id
,
content
,
request
.
user
,
user_info
)
return
JsonResponse
({
'html'
:
html
,
...
...
lms/djangoapps/django_comment_client/forum/views.py
View file @
b8176e5e
...
...
@@ -64,7 +64,7 @@ def render_discussion(request, course_id, threads, *args, **kwargs):
'user'
:
(
lambda
:
reverse
(
'django_comment_client.forum.views.user_profile'
,
args
=
[
course_id
,
user_id
])),
}[
discussion_type
]()
user_info
=
cc
.
User
.
from_django_user
(
request
.
user
)
.
safe_attributes
()
user_info
=
cc
.
User
.
from_django_user
(
request
.
user
)
.
to_dict
()
def
infogetter
(
thread
):
return
utils
.
get_annotated_content_infos
(
course_id
,
thread
,
request
.
user
,
user_info
)
...
...
@@ -176,7 +176,7 @@ def render_single_thread(request, discussion_id, course_id, thread_id):
thread
=
cc
.
Thread
.
find
(
thread_id
)
.
retrieve
(
recursive
=
True
)
.
to_dict
()
user_info
=
cc
.
User
.
from_django_user
(
request
.
user
)
.
safe_attributes
()
user_info
=
cc
.
User
.
from_django_user
(
request
.
user
)
.
to_dict
()
annotated_content_info
=
utils
.
get_annotated_content_infos
(
course_id
,
thread
=
thread
,
user
=
request
.
user
,
user_info
=
user_info
)
...
...
@@ -194,7 +194,7 @@ def single_thread(request, course_id, discussion_id, thread_id):
if
request
.
is_ajax
():
user_info
=
cc
.
User
.
from_django_user
(
request
.
user
)
.
safe_attributes
()
user_info
=
cc
.
User
.
from_django_user
(
request
.
user
)
.
to_dict
()
thread
=
cc
.
Thread
.
find
(
thread_id
)
.
retrieve
(
recursive
=
True
)
annotated_content_info
=
utils
.
get_annotated_content_infos
(
course_id
,
thread
,
request
.
user
,
user_info
=
user_info
)
context
=
{
'thread'
:
thread
.
to_dict
(),
'course_id'
:
course_id
}
...
...
lms/envs/common.py
View file @
b8176e5e
...
...
@@ -332,6 +332,8 @@ WIKI_CAN_CHANGE_PERMISSIONS = lambda article, user: user.is_staff or user.is_sup
WIKI_CAN_ASSIGN
=
lambda
article
,
user
:
user
.
is_staff
or
user
.
is_superuser
WIKI_USE_BOOTSTRAP_SELECT_WIDGET
=
False
WIKI_LINK_LIVE_LOOKUPS
=
False
WIKI_LINK_DEFAULT_LEVEL
=
2
################################# Jasmine ###################################
JASMINE_TEST_DIRECTORY
=
PROJECT_ROOT
+
'/static/coffee'
...
...
lms/lib/comment_client/user.py
View file @
b8176e5e
...
...
@@ -33,16 +33,6 @@ class User(models.Model):
params
=
{
'source_type'
:
source
.
type
,
'source_id'
:
source
.
id
}
response
=
perform_request
(
'delete'
,
_url_for_subscription
(
self
.
id
),
params
)
# TODO this is a hack to compensate for the fact that synchronization isn't
# happening properly.
def
safe_attributes
(
self
):
try
:
return
self
.
to_dict
()
except
:
self
.
save
()
self
.
_retrieve
()
return
self
.
to_dict
()
def
vote
(
self
,
voteable
,
value
):
if
voteable
.
type
==
'thread'
:
url
=
_url_for_vote_thread
(
voteable
.
id
)
...
...
lms/templates/discussion/user_profile.html
View file @
b8176e5e
...
...
@@ -30,7 +30,7 @@
</section>
<section
class=
"course-content"
>
${content}
${content
.decode('utf-8')
}
</section>
</div>
</section>
...
...
repo-requirements.txt
View file @
b8176e5e
-e git://github.com/MITx/django-staticfiles.git@6d2504e5c8#egg=django-staticfiles
-e git://github.com/MITx/django-pipeline.git#egg=django-pipeline
-e git://github.com/benjaoming/django-wiki.git@
533c7fc
#egg=django-wiki
-e git://github.com/benjaoming/django-wiki.git@
7e42bce
#egg=django-wiki
-e git://github.com/dementrock/pystache_custom.git@776973740bdaad83a3b029f96e415a7d1e8bec2f#egg=pystache_custom-dev
-e common/lib/capa
-e common/lib/xmodule
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