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
b7a6eadc
Commit
b7a6eadc
authored
Mar 01, 2013
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new cohorts tested
parent
8a953241
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
12 deletions
+19
-12
common/static/coffee/src/discussion/discussion_module_view.coffee
+1
-1
lms/djangoapps/django_comment_client/base/views.py
+10
-8
lms/djangoapps/django_comment_client/forum/views.py
+7
-2
lms/templates/discussion/_new_post.html
+1
-1
No files found.
common/static/coffee/src/discussion/discussion_module_view.coffee
View file @
b7a6eadc
...
...
@@ -79,7 +79,7 @@ if Backbone?
#determined in the coffeescript based on whether or not there's a
#group id
if
response
.
is_cohorted
if
response
.
is_cohorted
and
response
.
is_moderator
source
=
"script#_inline_discussion_cohorted"
else
source
=
"script#_inline_discussion"
...
...
lms/djangoapps/django_comment_client/base/views.py
View file @
b7a6eadc
...
...
@@ -98,22 +98,24 @@ def create_thread(request, course_id, commentable_id):
#by the group id in the request this all goes away
# Cohort the thread if the commentable is cohorted.
#if is_commentable_cohorted(course_id, commentable_id):
# user_group_id = get_cohort_id(user, course_id)
if
is_commentable_cohorted
(
course_id
,
commentable_id
):
user_group_id
=
get_cohort_id
(
user
,
course_id
)
# TODO (vshnayder): once we have more than just cohorts, we'll want to
# change this to a single get_group_for_user_and_commentable function
# that can do different things depending on the commentable_id
#
if cached_has_permission(request.user, "see_all_cohorts", course_id):
if
cached_has_permission
(
request
.
user
,
"see_all_cohorts"
,
course_id
):
# admins can optionally choose what group to post as
#
group_id = post.get('group_id', user_group_id)
#
else:
group_id
=
post
.
get
(
'group_id'
,
user_group_id
)
else
:
# regular users always post with their own id.
# group_id = user_group_id
group_id
=
post
.
get
(
'group_id'
)
group_id
=
user_group_id
# group_id = post.get('group_id')
if
group_id
:
thread
.
update_attributes
(
group_id
=
group_id
)
log
.
debug
(
"Saving thread
%
r"
,
thread
.
attributes
)
#
log.debug("Saving thread %r", thread.attributes)
thread
.
save
()
if
post
.
get
(
'auto_subscribe'
,
'false'
)
.
lower
()
==
'true'
:
...
...
lms/djangoapps/django_comment_client/forum/views.py
View file @
b7a6eadc
...
...
@@ -133,14 +133,18 @@ def inline_discussion(request, course_id, discussion_id):
#if the commentable is cohorted, otherwise everything is not cohorted
#and no one has the option of choosing a cohort
is_cohorted
=
is_course_cohorted
(
course_id
)
and
is_commentable_cohorted
(
course_id
,
discussion_id
)
is_moderator
=
cached_has_permission
(
request
.
user
,
"see_all_cohorts"
,
course_id
)
cohorts_list
=
list
()
if
is_cohorted
:
cohorts_list
.
append
({
'name'
:
'All Groups'
,
'id'
:
None
})
#if you're a mod, send all cohorts and let you pick
if
cached_has_permission
(
request
.
user
,
"see_all_cohorts"
,
course_id
):
if
is_moderator
:
cohorts
=
get_course_cohorts
(
course_id
)
for
c
in
cohorts
:
cohorts_list
.
append
({
'name'
:
c
.
name
,
'id'
:
c
.
id
})
...
...
@@ -171,6 +175,7 @@ def inline_discussion(request, course_id, discussion_id):
'allow_anonymous_to_peers'
:
allow_anonymous_to_peers
,
'allow_anonymous'
:
allow_anonymous
,
'cohorts'
:
cohorts_list
,
'is_moderator'
:
is_moderator
,
'is_cohorted'
:
is_cohorted
})
...
...
lms/templates/discussion/_new_post.html
View file @
b7a6eadc
...
...
@@ -53,7 +53,7 @@
<option
value=
""
>
All Groups
</option>
%for c in cohorts:
<option
value=
"${c.id}"
%
if
user_cohort
and
user_cohort =
=
c
.
id
%
if
user_cohort
and
str
(
user_cohort
)
==
str
(
c
.
id
)
:
selected
%
endif
>
${c.name}
</option>
...
...
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