Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
RecommenderXBlock
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
RecommenderXBlock
Commits
c86f672b
Commit
c86f672b
authored
Aug 22, 2014
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix spelling
parent
8e169e64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
recommender/recommender.py
+7
-7
No files found.
recommender/recommender.py
View file @
c86f672b
...
@@ -41,7 +41,7 @@ class RecommenderXBlock(XBlock):
...
@@ -41,7 +41,7 @@ class RecommenderXBlock(XBlock):
"""
"""
default_recommendations
=
List
(
help
=
"List of default help resources"
,
default_recommendations
=
List
(
help
=
"List of default help resources"
,
default
=
[],
scope
=
Scope
.
content
)
default
=
[],
scope
=
Scope
.
content
)
# A list of default recommenations, it is a JSON object across all users,
# A list of default recommen
d
ations, it is a JSON object across all users,
# all runs of a course, for this xblock.
# all runs of a course, for this xblock.
# Usage: default_recommendations[index] = {
# Usage: default_recommendations[index] = {
# "id": (Integer) id of a resource,
# "id": (Integer) id of a resource,
...
@@ -56,7 +56,7 @@ class RecommenderXBlock(XBlock):
...
@@ -56,7 +56,7 @@ class RecommenderXBlock(XBlock):
recommendations
=
List
(
help
=
"List of help resources"
,
default
=
[],
recommendations
=
List
(
help
=
"List of help resources"
,
default
=
[],
scope
=
Scope
.
user_state_summary
)
scope
=
Scope
.
user_state_summary
)
# A list of recommenations provided by students, it is a JSON object
# A list of recommen
d
ations provided by students, it is a JSON object
# aggregated across many users of a single block.
# aggregated across many users of a single block.
# Usage: the same as default_recommendations
# Usage: the same as default_recommendations
...
@@ -198,7 +198,7 @@ class RecommenderXBlock(XBlock):
...
@@ -198,7 +198,7 @@ class RecommenderXBlock(XBlock):
result['toggle']: the boolean indicator for whether the resource was switched from downvoted to upvoted
result['toggle']: the boolean indicator for whether the resource was switched from downvoted to upvoted
"""
"""
resource_id
=
data
[
'id'
]
resource_id
=
data
[
'id'
]
idx
=
self
.
recommenations
.
index
(
resource_id
)
idx
=
self
.
recommen
d
ations
.
index
(
resource_id
)
result
=
{}
result
=
{}
result
[
'id'
]
=
resource_id
result
[
'id'
]
=
resource_id
if
idx
>
len
(
self
.
recommendations
):
if
idx
>
len
(
self
.
recommendations
):
...
@@ -247,7 +247,7 @@ class RecommenderXBlock(XBlock):
...
@@ -247,7 +247,7 @@ class RecommenderXBlock(XBlock):
result['toggle']: the boolean indicator for whether the resource was switched from upvoted to downvoted
result['toggle']: the boolean indicator for whether the resource was switched from upvoted to downvoted
"""
"""
resource_id
=
data
[
'id'
]
resource_id
=
data
[
'id'
]
idx
=
self
.
recommenations
.
index
(
resource_id
)
idx
=
self
.
recommen
d
ations
.
index
(
resource_id
)
result
=
{}
result
=
{}
result
[
'id'
]
=
resource_id
result
[
'id'
]
=
resource_id
if
idx
>
len
(
self
.
recommendations
):
if
idx
>
len
(
self
.
recommendations
):
...
@@ -449,7 +449,7 @@ class RecommenderXBlock(XBlock):
...
@@ -449,7 +449,7 @@ class RecommenderXBlock(XBlock):
resource_id
=
data
[
'id'
]
resource_id
=
data
[
'id'
]
result
=
{}
result
=
{}
result
[
'id'
]
=
resource_id
result
[
'id'
]
=
resource_id
idx
=
self
.
recommenations
.
index
(
resource_id
)
idx
=
self
.
recommen
d
ations
.
index
(
resource_id
)
if
idx
>
len
(
self
.
recommendations
):
if
idx
>
len
(
self
.
recommendations
):
result
[
'error'
]
=
'bad id'
result
[
'error'
]
=
'bad id'
result
[
'Success'
]
=
False
result
[
'Success'
]
=
False
...
@@ -601,7 +601,7 @@ class RecommenderXBlock(XBlock):
...
@@ -601,7 +601,7 @@ class RecommenderXBlock(XBlock):
resource_id
=
data
[
'id'
]
resource_id
=
data
[
'id'
]
result
=
{}
result
=
{}
result
[
'id'
]
=
resource_id
result
[
'id'
]
=
resource_id
idx
=
self
.
recommenations
.
index
(
resource_id
)
idx
=
self
.
recommen
d
ations
.
index
(
resource_id
)
if
idx
>
len
(
self
.
recommendations
):
if
idx
>
len
(
self
.
recommendations
):
result
[
'error'
]
=
'bad id'
result
[
'error'
]
=
'bad id'
result
[
'Success'
]
=
False
result
[
'Success'
]
=
False
...
@@ -644,7 +644,7 @@ class RecommenderXBlock(XBlock):
...
@@ -644,7 +644,7 @@ class RecommenderXBlock(XBlock):
resource_id
=
data
[
'id'
]
resource_id
=
data
[
'id'
]
result
=
{}
result
=
{}
result
[
'id'
]
=
resource_id
result
[
'id'
]
=
resource_id
idx
=
self
.
recommenations
.
index
(
resource_id
)
idx
=
self
.
recommen
d
ations
.
index
(
resource_id
)
if
idx
>
len
(
self
.
recommendations
):
if
idx
>
len
(
self
.
recommendations
):
result
[
'error'
]
=
'bad id'
result
[
'error'
]
=
'bad id'
result
[
'Success'
]
=
False
result
[
'Success'
]
=
False
...
...
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