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
a35f8a0a
Commit
a35f8a0a
authored
Jan 04, 2015
by
solashirai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
continuing css
parent
f7cad05c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
crowdsourcehinter/crowdsourcehinter.py
+6
-0
crowdsourcehinter/static/html/crowdsourcehinter.html
+4
-4
crowdsourcehinter/static/js/src/crowdsourcehinter.js
+3
-0
No files found.
crowdsourcehinter/crowdsourcehinter.py
View file @
a35f8a0a
...
@@ -225,9 +225,15 @@ class CrowdsourceHinter(XBlock):
...
@@ -225,9 +225,15 @@ class CrowdsourceHinter(XBlock):
if
str
(
self
.
Used
[
index
])
in
self
.
hint_database
[
self
.
WrongAnswers
[
index
]]:
if
str
(
self
.
Used
[
index
])
in
self
.
hint_database
[
self
.
WrongAnswers
[
index
]]:
# add new key (hint) to feedback_data with a value (incorrect answer)
# add new key (hint) to feedback_data with a value (incorrect answer)
feedback_data
[
str
(
self
.
Used
[
index
])]
=
str
(
self
.
WrongAnswers
[
index
])
feedback_data
[
str
(
self
.
Used
[
index
])]
=
str
(
self
.
WrongAnswers
[
index
])
self
.
WrongAnswers
=
[]
self
.
Used
=
[]
return
feedback_data
else
:
else
:
# if the student's answer had no hints (or all the hints were flagged and unavailable) return None
# if the student's answer had no hints (or all the hints were flagged and unavailable) return None
feedback_data
[
None
]
=
str
(
self
.
WrongAnswers
[
index
])
feedback_data
[
None
]
=
str
(
self
.
WrongAnswers
[
index
])
self
.
WrongAnswers
=
[]
self
.
Used
=
[]
return
feedback_data
self
.
WrongAnswers
=
[]
self
.
WrongAnswers
=
[]
self
.
Used
=
[]
self
.
Used
=
[]
return
feedback_data
return
feedback_data
...
...
crowdsourcehinter/static/html/crowdsourcehinter.html
View file @
a35f8a0a
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
</script>
</script>
<script
type=
"x-tmpl/mustache"
id=
"student_hint_creation"
>
<script
type=
"x-tmpl/mustache"
id=
"student_hint_creation"
>
<
p
><
input
type
=
"text"
name
=
"studentinput"
class
=
"csh_student_text_input"
size
=
"40"
>
<
p
><
textarea
type
=
"text"
name
=
"studentinput"
class
=
"csh_student_text_input"
><
/textarea
>
<
input
answer
=
"{{student_answer}}"
type
=
"button"
class
=
"csh_submit_new"
value
=
"Submit Hint"
>
<
input
answer
=
"{{student_answer}}"
type
=
"button"
class
=
"csh_submit_new"
value
=
"Submit Hint"
>
<
/p
>
<
/p
>
</script>
</script>
...
@@ -59,13 +59,13 @@
...
@@ -59,13 +59,13 @@
<div
class=
'csh_HintsToUse'
student_answer =
''
>
<div
class=
'csh_HintsToUse'
student_answer =
''
>
</div>
</div>
<div
class=
'csh_HintQuickFeedback'
>
<div
class=
'csh_HintQuickFeedback'
>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"upvote"
data-icon=
"arrow-u"
aria-label=
"upvote
"
>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"upvote"
title=
"This hint was helpful!
"
>
<b>
↑
</b>
<b>
↑
</b>
</div>
</div>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"downvote"
aria-label=
"downvote
"
>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"downvote"
title=
"This hint was not very helpful.
"
>
<b>
↓
</b>
<b>
↓
</b>
</div>
</div>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"flag"
data-icon=
"flag"
aria-label=
"flag
"
>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"flag"
title=
"Report this hint
"
>
<b>
⚑
</b>
<b>
⚑
</b>
</div>
</div>
</div>
</div>
...
...
crowdsourcehinter/static/js/src/crowdsourcehinter.js
View file @
a35f8a0a
...
@@ -205,6 +205,9 @@ function CrowdsourceHinter(runtime, element){
...
@@ -205,6 +205,9 @@ function CrowdsourceHinter(runtime, element){
})
})
$
(
element
).
on
(
'click'
,
'.csh_rate_hint'
,
function
(){
$
(
element
).
on
(
'click'
,
'.csh_rate_hint'
,
function
(){
if
(
$
(
this
).
attr
(
'data-rate'
)
==
"flag"
){
alert
(
"This hint has been flagged for review."
);
}
hint
=
$
(
'.csh_HintsToUse'
,
element
).
text
();
hint
=
$
(
'.csh_HintsToUse'
,
element
).
text
();
student_answer
=
$
(
'.csh_HintsToUse'
,
element
).
attr
(
'student_answer'
);
student_answer
=
$
(
'.csh_HintsToUse'
,
element
).
attr
(
'student_answer'
);
Logger
.
log
(
'crowd_hinter.rate_hint.click.event'
,
{
"hint"
:
hint
,
"student_answer"
:
student_answer
,
"rating"
:
$
(
this
).
attr
(
'data-rate'
)});
Logger
.
log
(
'crowd_hinter.rate_hint.click.event'
,
{
"hint"
:
hint
,
"student_answer"
:
student_answer
,
"rating"
:
$
(
this
).
attr
(
'data-rate'
)});
...
...
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