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
a9c4f75b
Commit
a9c4f75b
authored
Jul 18, 2015
by
solashirai
Committed by
Piotr Mitros
Oct 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed staff rating, slight UX fixes
parent
f7d379d6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
6 deletions
+27
-6
crowdsourcehinter/crowdsourcehinter.py
+4
-2
crowdsourcehinter/static/css/crowdsourcehinter.css
+18
-1
crowdsourcehinter/static/html/crowdsourcehinter.html
+3
-3
crowdsourcehinter/static/js/src/crowdsourcehinter.js
+2
-0
No files found.
crowdsourcehinter/crowdsourcehinter.py
View file @
a9c4f75b
...
...
@@ -232,8 +232,10 @@ class CrowdsourceHinter(XBlock):
# corresponding incorrect answer
used_hint_answer_text
=
{}
if
self
.
get_user_is_staff
():
for
index
in
range
(
0
,
len
(
self
.
reported_hints
)):
used_hint_answer_text
[
str
(
self
.
reported_hints
[
i
])]
=
str
(
"reported"
)
print
len
(
self
.
reported_hints
)
print
str
(
self
.
reported_hints
)
for
key
in
self
.
reported_hints
:
used_hint_answer_text
[
key
]
=
str
(
"Reported"
)
if
len
(
self
.
incorrect_answers
)
==
0
:
return
used_hint_answer_text
else
:
...
...
crowdsourcehinter/static/css/crowdsourcehinter.css
View file @
a9c4f75b
...
...
@@ -10,7 +10,7 @@
.csh_hint_value
{
display
:
flex
;
margin-left
:
10px
;
/* margin-left: 10px; */
flex-direction
:
column
;
}
...
...
@@ -51,6 +51,23 @@ div[data-rate="report"]{
font-weight
:
bold
;
}
.csh_hint_text
[
rating
=
"upvote"
]
{
color
:
green
;
}
.csh_hint_text
[
rating
=
"downvote"
]
{
color
:
red
;
}
.csh_hint
[
rating
=
"upvote"
]
{
color
:
green
;
}
.csh_hint
[
rating
=
"downvote"
]
{
color
:
red
;
}
.csh_student_hint_creation
{
height
:
40px
;
vertical-align
:
middle
;
...
...
crowdsourcehinter/static/html/crowdsourcehinter.html
View file @
a9c4f75b
<script
type=
'x-tmpl/mustache'
id=
'show_hint_rating_ux'
>
<
div
class
=
'csh_hint_value'
value
=
"{{hintText}}"
>
<
div
class
=
'csh_hint_data'
>
<
div
class
=
"csh_hint"
>
You
r
original
hint
was
:
<
b
>
{{
hintText
}}
<
/b></
div
>
<
div
class
=
"csh_hint"
>
You
received
the
following
hint
:
<
b
>
{{
hintText
}}
<
/b></
div
>
<
/div
>
<
div
class
=
'csh_rating_data'
>
<
div
role
=
"button"
class
=
"csh_rate_hint"
data
-
rate
=
"upvote"
>
...
...
@@ -47,8 +47,8 @@
<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
rating
hints
as
helpful
/
unhelpful
or
contributing
your
ow
n
!
<
/i> <br
>
<
i
>
Your
original
answer
was
:
{{
answer
}}
<
/i>
</
h
>
<
i
>
Please
give
us
feedback
or
submit
a
new
hint
to
improve
hints
for
this
questio
n
!
<
/i> <br
>
Your
original
answer
was
:
{{
answer
}}
<
/h
>
<
/div
>
</script>
...
...
crowdsourcehinter/static/js/src/crowdsourcehinter.js
View file @
a9c4f75b
...
...
@@ -239,6 +239,7 @@ function CrowdsourceHinter(runtime, element, data){
function
rateHint
(){
return
function
(
rateHintButtonHTML
){
rating
=
rateHintButtonHTML
.
currentTarget
.
attributes
[
'data-rate'
].
value
;
$
(
'.csh_hint_text'
,
element
).
attr
(
'rating'
,
rating
);
$
(
'.csh_hint'
,
element
).
attr
(
'rating'
,
rating
);
hint
=
$
(
'.csh_hint_text'
,
element
).
attr
(
'hint_received'
);
student_answer
=
$
(
'.csh_hint_text'
,
element
).
attr
(
'student_answer'
);
$
.
ajax
({
...
...
@@ -256,6 +257,7 @@ function CrowdsourceHinter(runtime, element, data){
function
reportHint
(){
return
function
(
reportHintButtonHTML
){
hint
=
$
(
'.csh_hint_text'
,
element
).
attr
(
'hint_received'
);
student_answer
=
$
(
'.csh_hint_text'
,
element
).
attr
(
'student_answer'
);
$
(
'.csh_hint_text'
,
element
).
text
(
'This hint has been reported for review.'
);
$
.
ajax
({
type
:
"POST"
,
url
:
runtime
.
handlerUrl
(
element
,
'rate_hint'
),
...
...
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