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
0be2bc41
Commit
0be2bc41
authored
Mar 30, 2015
by
solashirai
Committed by
Piotr Mitros
Oct 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed "flagged" to "reported"
parent
6930813b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
61 deletions
+62
-61
crowdsourcehinter/crowdsourcehinter.py
+37
-36
crowdsourcehinter/static/css/crowdsourcehinter.css
+4
-4
crowdsourcehinter/static/html/crowdsourcehinter.html
+5
-5
crowdsourcehinter/static/js/src/crowdsourcehinter.js
+16
-16
No files found.
crowdsourcehinter/crowdsourcehinter.py
View file @
0be2bc41
This diff is collapsed.
Click to expand it.
crowdsourcehinter/static/css/crowdsourcehinter.css
View file @
0be2bc41
...
...
@@ -45,7 +45,7 @@
align-self
:
flex-end
;
}
div
[
data-rate
=
"
flag
"
]
{
div
[
data-rate
=
"
report
"
]
{
font-weight
:
bold
;
}
...
...
@@ -69,15 +69,15 @@ div[data-rate="downvote"] {
font-weight
:
bold
;
}
.csh_
flagg
ed_hints
{
.csh_
report
ed_hints
{
background-color
:
red
;
}
.crowdsourcehinter_block
.csh_
flagg
ed_hints
{
.crowdsourcehinter_block
.csh_
report
ed_hints
{
visibility
:
hidden
;
display
:
none
;
}
.crowdsourcehinter_block_is_staff
.csh_
flagg
ed_hints
{
.crowdsourcehinter_block_is_staff
.csh_
report
ed_hints
{
visibility
:
visible
;
}
...
...
crowdsourcehinter/static/html/crowdsourcehinter.html
View file @
0be2bc41
...
...
@@ -10,17 +10,17 @@
<
div
role
=
"button"
class
=
"csh_rate_hint"
data
-
rate
=
"downvote"
>
<
b
>
Rate
as
Unhelpful
<
/b
>
<
/div
>
<
div
role
=
"button"
class
=
"csh_rate_hint"
data
-
rate
=
"
flag"
data
-
icon
=
"flag
"
title
=
"Report this hint."
>
<
div
role
=
"button"
class
=
"csh_rate_hint"
data
-
rate
=
"
report"
data
-
icon
=
"report
"
title
=
"Report this hint."
>
<
b
>
⚑
<
/b
>
<
/div
>
<
/div
>
<
/div
>
</script>
<script
type=
"x-tmpl/mustache"
id=
"show_
flagg
ed_feedback"
>
<script
type=
"x-tmpl/mustache"
id=
"show_
report
ed_feedback"
>
<
div
class
=
"csh_hint_value"
value
=
"{{hint}}"
>
<
div
class
=
"csh_hint"
>
{{
hint
}}
<
/div
>
<
div
role
=
"button"
class
=
"csh_staff_rate"
data
-
rate
=
"un
flag"
aria
-
label
=
"unflag
"
>
<
div
role
=
"button"
class
=
"csh_staff_rate"
data
-
rate
=
"un
report"
aria
-
label
=
"unreport
"
>
<
u
><
b
>
Return
hint
for
use
in
the
hinter
<
/b></
u
>
<
/div
>
<
div
role
=
"button"
class
=
"csh_staff_rate"
data
-
rate
=
"remove"
aria
-
label
=
"remove"
>
...
...
@@ -71,7 +71,7 @@
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"downvote"
title=
"This hint was not very helpful."
>
<b>
-
</b>
</div>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"
flag
"
title=
"Report this hint"
>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"
report
"
title=
"Report this hint"
>
<b>
⚑
</b>
</div>
</div>
...
...
@@ -85,7 +85,7 @@
<span
class=
'Thankyou'
></span>
</p>
<div
class=
"csh_feedback"
>
<div
class=
"csh_
flagg
ed_hints"
>
<div
class=
"csh_
report
ed_hints"
>
<span>
moderate reported hints
</span>
</div>
</div>
...
...
crowdsourcehinter/static/js/src/crowdsourcehinter.js
View file @
0be2bc41
...
...
@@ -80,7 +80,7 @@ function CrowdsourceHinter(runtime, element, data){
function
showHintFeedback
(
hint
,
student_answer
){
//Append answer-specific hints for each student answer during the feedback stage.
//This appended div includes upvote/downvote/
flagg
ing buttons, the hint, and the hint's rating
//This appended div includes upvote/downvote/
report
ing buttons, the hint, and the hint's rating
$
(
".csh_student_answer"
,
element
).
each
(
function
(){
if
(
$
(
this
).
find
(
'.csh_answer_text'
).
attr
(
'answer'
)
==
student_answer
){
var
html
=
""
;
...
...
@@ -100,17 +100,17 @@ function CrowdsourceHinter(runtime, element, data){
});
}
function
show
Flagg
edFeedback
(
result
){
//For staff use, shows hints that have been
flagged by students and allows for the hints' unflagg
ing/removal.
function
show
Report
edFeedback
(
result
){
//For staff use, shows hints that have been
reporteded by students and allows for the hints' unreport
ing/removal.
var
html
=
""
;
$
(
function
(){
var
template
=
$
(
'#show_
flagg
ed_feedback'
).
html
();
var
template
=
$
(
'#show_
report
ed_feedback'
).
html
();
var
data
=
{
hint
:
result
};
html
=
Mustache
.
render
(
template
,
data
);
});
$
(
".csh_
flagg
ed_hints"
,
element
).
append
(
html
);
$
(
".csh_
report
ed_hints"
,
element
).
append
(
html
);
}
function
setStudentAnswers
(
student_answers
){
...
...
@@ -131,15 +131,15 @@ function CrowdsourceHinter(runtime, element, data){
if
(
isStaff
){
$
(
'.crowdsourcehinter_block'
,
element
).
attr
(
'class'
,
'crowdsourcehinter_block_is_staff'
);
$
.
each
(
result
,
function
(
index
,
value
)
{
if
(
value
==
"
Flagg
ed"
)
{
//index represents the
flagg
ed hint's text
show
Flagg
edFeedback
(
index
);
if
(
value
==
"
Report
ed"
)
{
//index represents the
report
ed hint's text
show
Report
edFeedback
(
index
);
}
});
}
if
(
!
isShowingHintFeedback
){
$
.
each
(
result
,
function
(
index
,
value
)
{
if
(
value
!=
"
Flagg
ed"
){
if
(
value
!=
"
Report
ed"
){
setStudentAnswers
(
value
);
student_answer
=
value
;
hint
=
index
;
...
...
@@ -160,7 +160,7 @@ function CrowdsourceHinter(runtime, element, data){
}
});
}
//
flagged hints have their corresponding answer set to "Flagg
ed"
//
reported hints have their corresponding answer set to "Report
ed"
else
{
showHintFeedback
(
hint
,
student_answer
);
}
...
...
@@ -201,7 +201,7 @@ function CrowdsourceHinter(runtime, element, data){
$
(
'.csh_submitbutton'
,
element
).
show
();
$
.
ajax
({
type
:
"POST"
,
url
:
runtime
.
handlerUrl
(
element
,
'
give
_hint'
),
url
:
runtime
.
handlerUrl
(
element
,
'
add_new
_hint'
),
data
:
JSON
.
stringify
({
"submission"
:
newhint
,
"answer"
:
answerdata
}),
success
:
function
(
result
){
$
.
ajax
({
...
...
@@ -218,8 +218,8 @@ function CrowdsourceHinter(runtime, element, data){
})
$
(
element
).
on
(
'click'
,
'.csh_rate_hint'
,
function
(){
if
(
$
(
this
).
attr
(
'data-rate'
)
==
"
flag
"
){
alert
(
"This hint has been
flagg
ed for review."
);
if
(
$
(
this
).
attr
(
'data-rate'
)
==
"
report
"
){
alert
(
"This hint has been
report
ed for review."
);
}
hint
=
$
(
'.csh_HintsToUse'
,
element
).
attr
(
'hint_received'
);
student_answer
=
$
(
'.csh_HintsToUse'
,
element
).
attr
(
'student_answer'
);
...
...
@@ -233,10 +233,10 @@ function CrowdsourceHinter(runtime, element, data){
});
$
(
element
).
on
(
'click'
,
'.csh_staff_rate'
,
function
(){
//Staff ratings are the removal or un
flagging of flagg
ed hints from the database. The attribute 'data-rate' is used
//to determine whether to un
flag
or delete the hint.
//Staff ratings are the removal or un
reporting of report
ed hints from the database. The attribute 'data-rate' is used
//to determine whether to un
report
or delete the hint.
hint
=
$
(
this
).
parent
().
find
(
".csh_hint"
).
text
();
student_answer
=
"
Flagg
ed"
;
student_answer
=
"
Report
ed"
;
Logger
.
log
(
'crowd_hinter.staff_rate_hint.click.event'
,
{
"hint"
:
hint
,
"student_answer"
:
student_answer
,
"rating"
:
$
(
this
).
attr
(
'data-rate'
)});
$
.
ajax
({
type
:
"POST"
,
...
...
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