Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
crowdsourcehinter
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
OpenEdx
crowdsourcehinter
Commits
b212766f
Commit
b212766f
authored
Jul 09, 2014
by
Sola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
not much changed from last commit
parent
1df32037
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
crowdxblock/crowdxblock.py
+8
-2
No files found.
crowdxblock/crowdxblock.py
View file @
b212766f
...
...
@@ -66,11 +66,17 @@ class CrowdXBlock(XBlock):
return
{
'HintsToUse'
:
NotUsed
}
#note to self dont let python get into endless notused loop
@XBlock.json_handler
def
get_feedback
(
self
,
data
,
suffix
=
''
):
#feedback, either rating or making a hint, starts here
def
get_feedback
(
self
,
data
,
suffix
=
''
):
#start feedback, sent hint/answer data
feedbackdict
=
{}
if
len
(
self
.
WrongAnswers
)
==
0
:
return
#Do nothing if no mistakes were made
else
:
#lenth of Used will be used to dictate flow of feedback
return
{
'lenused'
:
int
(
len
(
self
.
Used
))}
for
i
in
range
(
0
,
len
(
self
.
Used
)):
ans
=
str
(
'wngans'
+
str
(
i
))
hnt
=
str
(
'hntusd'
+
str
(
i
))
feedbackdict
[
ans
]
=
str
(
self
.
WrongAnswers
[
i
])
feedbackdict
[
hnt
]
=
str
(
self
.
Used
[
i
])
return
feedbackdict
@XBlock.json_handler
#add 1 or -1 to rating of a hint
def
rate_hint
(
self
,
data
,
suffix
=
''
):
...
...
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