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
28c85d5f
Commit
28c85d5f
authored
Apr 18, 2015
by
solashirai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
naming changes (partial), fixes to Mustache template usage
parent
7ee2a4c5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
21 deletions
+18
-21
crowdsourcehinter/crowdsourcehinter.py
+5
-5
crowdsourcehinter/static/css/crowdsourcehinter.css
+1
-1
crowdsourcehinter/static/html/crowdsourcehinter.html
+12
-15
crowdsourcehinter/static/js/src/crowdsourcehinter.js
+0
-0
No files found.
crowdsourcehinter/crowdsourcehinter.py
View file @
28c85d5f
...
...
@@ -115,7 +115,7 @@ class CrowdsourceHinter(XBlock):
data['submittedanswer']: The string of text that the student submits for a problem.
returns:
'
Hints
': the highest rated hint for an incorrect answer
'
bestHint
': the highest rated hint for an incorrect answer
or another random hint for an incorrect answer
or 'Sorry, there are no more hints for this answer.' if no more hints exist
"""
...
...
@@ -146,12 +146,12 @@ class CrowdsourceHinter(XBlock):
# currently set by default to True
if
best_hint
not
in
self
.
Reported
.
keys
():
self
.
Used
.
append
(
best_hint
)
return
{
'
Hints
'
:
best_hint
,
"StudentAnswer"
:
answer
}
return
{
'
BestHint
'
:
best_hint
,
"StudentAnswer"
:
answer
}
if
best_hint
not
in
self
.
Used
:
# choose highest rated hint for the incorrect answer
if
best_hint
not
in
self
.
Reported
.
keys
():
self
.
Used
.
append
(
best_hint
)
return
{
'
Hints
'
:
best_hint
,
"StudentAnswer"
:
answer
}
return
{
'
BestHint
'
:
best_hint
,
"StudentAnswer"
:
answer
}
# choose another random hint for the answer.
temporary_hints_list
=
[]
for
hint_keys
in
self
.
hint_database
[
str
(
answer
)]:
...
...
@@ -160,12 +160,12 @@ class CrowdsourceHinter(XBlock):
temporary_hints_list
.
append
(
str
(
hint_keys
))
not_used
=
random
.
choice
(
temporary_hints_list
)
self
.
Used
.
append
(
not_used
)
return
{
'
Hints
'
:
not_used
,
"StudentAnswer"
:
answer
}
return
{
'
BestHint
'
:
not_used
,
"StudentAnswer"
:
answer
}
# find generic hints for the student if no specific hints exist
if
len
(
self
.
generic_hints
)
!=
0
:
not_used
=
random
.
choice
(
self
.
generic_hints
)
self
.
Used
.
append
(
not_used
)
return
{
'
Hints
'
:
not_used
,
"StudentAnswer"
:
answer
}
return
{
'
BestHint
'
:
not_used
,
"StudentAnswer"
:
answer
}
else
:
# if there are no more hints left in either the database or defaults
self
.
Used
.
append
(
str
(
"There are no hints for"
+
" "
+
answer
))
...
...
crowdsourcehinter/static/css/crowdsourcehinter.css
View file @
28c85d5f
...
...
@@ -22,7 +22,7 @@
flex-direction
:
column
;
}
.csh_
HintQuickFeedback
{
.csh_
hint_rating_on_incorrect
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
flex-end
;
...
...
crowdsourcehinter/static/html/crowdsourcehinter.html
View file @
28c85d5f
<script
type=
'x-tmpl/mustache'
id=
'show_hint_
feedback
'
>
<
div
class
=
'csh_hint_value'
value
=
"{{hint
value
}}"
>
<script
type=
'x-tmpl/mustache'
id=
'show_hint_
contribution
'
>
<
div
class
=
'csh_hint_value'
value
=
"{{hint
Text
}}"
>
<
div
class
=
'csh_hint_data'
>
<
div
class
=
"csh_hint"
><
b
>
{{
hint
}}
<
/b></
div
>
<
div
class
=
"csh_hint"
><
b
>
{{
hint
Text
}}
<
/b></
div
>
<
/div
>
<
div
class
=
'csh_rating_data'
>
<
div
role
=
"button"
class
=
"csh_rate_hint"
data
-
rate
=
"upvote"
>
...
...
@@ -17,9 +17,9 @@
<
/div
>
</script>
<script
type=
"x-tmpl/mustache"
id=
"show_reported_
feedback
"
>
<
div
class
=
"csh_hint_value"
value
=
"{{
hin
t}}"
>
<
div
class
=
"csh_hint"
>
{{
hin
t
}}
<
/div
>
<script
type=
"x-tmpl/mustache"
id=
"show_reported_
moderation
"
>
<
div
class
=
"csh_hint_value"
value
=
"{{
reportedHintTex
t}}"
>
<
div
class
=
"csh_hint"
>
{{
reportedHintTex
t
}}
<
/div
>
<
div
role
=
"button"
class
=
"csh_staff_rate"
data
-
rate
=
"unreport"
aria
-
label
=
"unreport"
>
<
u
><
b
>
Return
hint
for
use
in
the
hinter
<
/b></
u
>
<
/div
>
...
...
@@ -30,7 +30,7 @@
<
/div
>
</script>
<script
type=
"x-tmpl/mustache"
id=
"
student_hint_creation
"
>
<script
type=
"x-tmpl/mustache"
id=
"
hint_text_input
"
>
<
p
>
<
input
type
=
"text"
name
=
"studentinput"
class
=
"csh_student_text_input"
>
<
/p
>
...
...
@@ -44,10 +44,10 @@
<
/div
>
</script>
<script
type=
"x-tmpl/mustache"
id=
"show_
answer_feedback
"
>
<script
type=
"x-tmpl/mustache"
id=
"show_
student_submission
"
>
<
div
class
=
"csh_student_answer"
>
<
h
class
=
"csh_answer_text"
answer
=
{{
answer
}}
>
<
i
>
Improve
hints
for
this
question
by
leaving
feedback
on
this
hint
or
contributing
your
own
!
<
/i> <br
>
<
i
>
Improve
hints
for
this
question
by
rating
hints
as
helpful
/
unhelpful
or
contributing
your
own
!
<
/i> <br
>
<
i
>
Your
original
answer
was
:
{{
answer
}}
<
/i></
h
>
<
/div
>
</script>
...
...
@@ -62,9 +62,9 @@
<div
class=
"crowdsourcehinter_block"
>
<div
class=
'csh_hint_reveal'
>
<div
class=
'csh_
Hints
'
student_answer =
''
hint_received=
''
>
<div
class=
'csh_
hint_text
'
student_answer =
''
hint_received=
''
>
</div>
<div
class=
'csh_
HintQuickFeedback
'
>
<div
class=
'csh_
hint_rating_on_incorrect
'
>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"upvote"
title=
"This hint was helpful!"
>
<b>
+
</b>
</div>
...
...
@@ -81,10 +81,7 @@
<div
class=
"crowdsourcehinter_block"
>
<section
class=
"csh_correct"
></section>
<p>
<span
class=
'Thankyou'
></span>
</p>
<div
class=
"csh_feedback"
>
<div
class=
"csh_student_submission"
>
<div
class=
"csh_reported_hints"
>
<span>
moderate reported hints
</span>
</div>
...
...
crowdsourcehinter/static/js/src/crowdsourcehinter.js
View file @
28c85d5f
This diff is collapsed.
Click to expand it.
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