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
f9dfc035
Commit
f9dfc035
authored
Jan 04, 2015
by
solashirai
Committed by
Piotr Mitros
Oct 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
continuing css
parent
6361a5ae
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 @
f9dfc035
...
...
@@ -225,9 +225,15 @@ class CrowdsourceHinter(XBlock):
if
str
(
self
.
Used
[
index
])
in
self
.
hint_database
[
self
.
WrongAnswers
[
index
]]:
# add new key (hint) to feedback_data with a value (incorrect answer)
feedback_data
[
str
(
self
.
Used
[
index
])]
=
str
(
self
.
WrongAnswers
[
index
])
self
.
WrongAnswers
=
[]
self
.
Used
=
[]
return
feedback_data
else
:
# 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
])
self
.
WrongAnswers
=
[]
self
.
Used
=
[]
return
feedback_data
self
.
WrongAnswers
=
[]
self
.
Used
=
[]
return
feedback_data
...
...
crowdsourcehinter/static/html/crowdsourcehinter.html
View file @
f9dfc035
...
...
@@ -30,7 +30,7 @@
</script>
<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"
>
<
/p
>
</script>
...
...
@@ -59,13 +59,13 @@
<div
class=
'csh_HintsToUse'
student_answer =
''
>
</div>
<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>
</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>
</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>
</div>
</div>
...
...
crowdsourcehinter/static/js/src/crowdsourcehinter.js
View file @
f9dfc035
...
...
@@ -205,6 +205,9 @@ function CrowdsourceHinter(runtime, element){
})
$
(
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
();
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'
)});
...
...
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