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
49af84a4
Commit
49af84a4
authored
Jul 16, 2014
by
Sola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slight changes to hint showing during get_feedback
parent
8fe56882
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletions
+16
-1
crowdxblock/crowdxblock.py
+8
-1
crowdxblock/crowdxblock.pyc
+0
-0
crowdxblock/crowdxblock.py~
+8
-0
No files found.
crowdxblock/crowdxblock.py
View file @
49af84a4
...
...
@@ -92,7 +92,14 @@ class CrowdXBlock(XBlock):
for
key
in
self
.
hints
:
if
str
(
key
)
==
str
(
self
.
WrongAnswers
[
i
]):
if
len
(
self
.
hints
[
str
(
key
)])
!=
0
:
for
nextkey
in
self
.
hints
[
str
(
key
)]:
howmanyhints
=
0
print
(
'hints are'
+
str
(
self
.
hints
[
str
(
key
)]))
keysh
=
self
.
hints
[
str
(
key
)]
.
keys
()
random
.
shuffle
(
keysh
)
print
(
'keysh is '
+
str
(
keysh
))
for
nextkey
in
keysh
:
if
howmanyhints
<
3
:
howmanyhints
+=
1
#limit number of hints shown
feedbackdict
[
str
(
nextkey
)]
=
str
(
self
.
WrongAnswers
[
i
])
self
.
WrongAnswers
.
append
(
str
(
self
.
WrongAnswers
[
i
]))
self
.
Used
.
append
(
str
(
nextkey
))
...
...
crowdxblock/crowdxblock.pyc
View file @
49af84a4
No preview for this file type
crowdxblock/crowdxblock.py~
View file @
49af84a4
...
...
@@ -92,13 +92,21 @@ class CrowdXBlock(XBlock):
for key in self.hints:
if str(key) == str(self.WrongAnswers[i]):
if len(self.hints[str(key)]) != 0:
howmanyhints = 0
print('hints are' + str(self.hints[str(key)]))
keysh = self.hints[str(key)].keys()
random.shuffle(keysh)
print('keysh is ' + str(keysh))
for nextkey in self.hints[str(key)]:
if howmanyhints < 3:
howmanyhints += 1 #limit number of hints shown
feedbackdict[str(nextkey)] = str(self.WrongAnswers[i])
self.WrongAnswers.append(str(self.WrongAnswers[i]))
self.Used.append(str(nextkey))
else:
feedbackdict[str("There are no hints for" + " " + str(self.WrongAnswers[i]))] = str(self.WrongAnswers[i])
self.WrongAnswers.append(str(self.WrongAnswers[i]))
self.Used.append(str("There are no hints for" + " " + str(self.WrongAnswers[i])))
print("used is " + str(self.Used))
print(str(feedbackdict))
return feedbackdict
...
...
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