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
26d6b8fb
Commit
26d6b8fb
authored
Jul 10, 2014
by
Sola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed to upvote when duplicate hint is provided
parent
5f53a0f5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
17 deletions
+47
-17
crowdxblock/crowdxblock.py
+17
-2
crowdxblock/crowdxblock.pyc
+0
-0
crowdxblock/crowdxblock.py~
+18
-3
crowdxblock/static/css/crowdxblock.css
+2
-1
crowdxblock/static/css/crowdxblock.css~
+2
-2
crowdxblock/static/html/crowdxblock.html
+2
-3
crowdxblock/static/html/crowdxblock.html~
+6
-6
No files found.
crowdxblock/crowdxblock.py
View file @
26d6b8fb
...
...
@@ -112,8 +112,23 @@ class CrowdXBlock(XBlock):
print
(
"hints are "
+
str
(
self
.
hints
[
str
(
key
)]))
print
(
"otherstuff "
+
str
(
self
.
hints
))
else
:
self
.
hints
[
str
(
key
)[
str
(
data
[
'submission'
])]]
+=
1
self
.
Voted
=
1
ansnum
=
self
.
Used
.
index
(
data
[
'submission'
])
for
key
in
self
.
DefaultHints
:
if
key
==
self
.
Used
[
int
(
ansnum
)]:
#rating for hints in DefaultHints
self
.
DefaultHints
[
str
(
key
)]
+=
int
(
1
)
self
.
Voted
=
1
print
str
(
self
.
DefaultHints
)
return
for
key
in
self
.
hints
:
tempdict
=
str
(
self
.
hints
[
str
(
key
)])
#rate hint that is in hints
tempdict
=
(
ast
.
literal_eval
(
tempdict
))
if
str
(
key
)
==
str
(
self
.
WrongAnswers
[
int
(
ansnum
)]):
#ansnum will the the answer/hint pair that is selected
tempdict
[
self
.
Used
[
int
(
ansnum
)]]
+=
int
(
1
)
self
.
hints
[
str
(
key
)]
=
tempdict
print
(
"TESTING AGAIN HI"
)
print
(
"hints are "
+
str
(
self
.
hints
[
str
(
key
)]))
print
(
"otherstuff "
+
str
(
self
.
hints
))
self
.
Voted
=
1
@XBlock.json_handler
def
clear_states
(
self
,
data
,
suffix
=
''
):
...
...
crowdxblock/crowdxblock.pyc
View file @
26d6b8fb
No preview for this file type
crowdxblock/crowdxblock.py~
View file @
26d6b8fb
...
...
@@ -112,11 +112,26 @@ class CrowdXBlock(XBlock):
print("hints are " + str(self.hints[str(key)]))
print("otherstuff " + str(self.hints))
else:
self.hints[str(key)[str(data['submission'])]] += 1
self.Voted = 1
ansnum = self.Used.index[data['submission']]
for key in self.DefaultHints:
if key == self.Used[int(ansnum)]: #rating for hints in DefaultHints
self.DefaultHints[str(key)] += int(1)
self.Voted = 1
print str(self.DefaultHints)
return
for key in self.hints:
tempdict = str(self.hints[str(key)]) #rate hint that is in hints
tempdict = (ast.literal_eval(tempdict))
if str(key) == str(self.WrongAnswers[int(ansnum)]): #ansnum will the the answer/hint pair that is selected
tempdict[self.Used[int(ansnum)]] += int(1)
self.hints[str(key)] = tempdict
print("TESTING AGAIN HI")
print("hints are " + str(self.hints[str(key)]))
print("otherstuff " + str(self.hints))
self.Voted = 1
@XBlock.json_handler
def
debugclear
states(self, data, suffix=''):
def
clear_
states(self, data, suffix=''):
self.Used = []
self.HintsToUse = {}
self.Voted = 0
...
...
crowdxblock/static/css/crowdxblock.css
View file @
26d6b8fb
...
...
@@ -6,6 +6,7 @@
.crowdxblock_block
button
{
cursor
:
pointer
;
background
:
rgb
(
0
,
0
,
200
);
}
.crowdxblock_block
.crowdsource-wrapper
{
...
...
@@ -14,7 +15,7 @@
display
:
none
;
margin-top
:
20px
;
padding
:
(
15px
);
background
:
rgb
(
253
,
248
,
235
);
background
:
rgb
(
50
,
50
,
235
);
}
.crowdxblock_block
.hint-inner-container
{
...
...
crowdxblock/static/css/crowdxblock.css~
View file @
26d6b8fb
...
...
@@ -4,7 +4,7 @@
font-weight: bold;
}
.crowdxblock_block
p
{
.crowdxblock_block
button
{
cursor: pointer;
}
...
...
@@ -14,7 +14,7 @@
display: none;
margin-top: 20px;
padding: (15px);
background: rgb(
253, 248
, 235);
background: rgb(
50, 50
, 235);
}
.crowdxblock_block .hint-inner-container {
...
...
crowdxblock/static/html/crowdxblock.html
View file @
26d6b8fb
<div
class=
"crowdxblock_block"
>
<!--most stuff just for testing purposes-->
<p>
CrowdXBlock: HINT
!
<span
class=
'HintsToUse'
>
{self.HintsToUse}
</span>
<div
class=
"crowdxblock_block"
>
<!--most stuff just for testing purposes-->
<p>
It's Hintin' Time! Here's your hint
!
<span
class=
'HintsToUse'
>
{self.HintsToUse}
</span>
</p>
<span><br><span>
Dummy Answer Input Here
</span></span>
<section
id=
"studentinput"
class=
"textinput"
>
...
...
@@ -38,7 +38,6 @@
<span
class=
'HintUsed3'
></span>
</p>
</div>
<p>
<input
id=
"cu"
type=
"button"
value=
"clearUsed"
><input
id=
"cw"
type=
"button"
value=
"clearWrong"
><input
id=
"cv"
type=
"button"
value=
"clearVoted"
><input
id=
"ch"
type=
"button"
value=
"clearHintsToUse"
>
<input
id=
"caus"
type=
"button"
value=
"clearAllUserState"
>
</p>
...
...
crowdxblock/static/html/crowdxblock.html~
View file @
26d6b8fb
<div class="crowdxblock_block"
>
<!--most stuff just for testing purposes-->
<p>
CrowdXBlock: HINT
! <span class='HintsToUse'>{self.HintsToUse}</span>
<div class="crowdxblock_block"
style="background-color:#00FFFF;">
<!--most stuff just for testing purposes-->
<p>
It's Hintin' Time! Here's your hint
! <span class='HintsToUse'>{self.HintsToUse}</span>
</p>
<span><br><span> Dummy Answer Input Here</span></span>
<section id="studentinput" class="textinput">
...
...
@@ -37,6 +37,9 @@
<p>
<span class='HintUsed3'></span>
</p> </div>
<p>
<input id="caus" type="button" value="clearAllUserState">
</p>
<section class="solution-span"><span id="solution_i4x-Me-19_002-problem-Numerical_Input_solution_1"></span></section></div>
...
...
@@ -50,10 +53,7 @@
<input type="text" name="studentinput" id="answer" class="math" size="40">
<input id="submit" type="button" value="Submit Hint">
</div></section></span><p>
<input id="cu" type="button" value="clearUsed"><input id="cw" type="button" value="clearWrong"><input id="cv" type="button" value="clearVoted"><input id="ch" type="button" value="clearHintsToUse">
<input id="caus" type="button" value="clearAllUserState">
</p>
</div></section></span>
</section>
</section>
...
...
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