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
24119b73
Commit
24119b73
authored
Dec 07, 2014
by
solashirai
Committed by
Piotr Mitros
Oct 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
milestone
parent
a7e3b2d4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
9 deletions
+23
-9
crowdsourcehinter/crowdsourcehinter.py
+2
-2
crowdsourcehinter/static/css/crowdsourcehinter.css
+5
-2
crowdsourcehinter/static/html/crowdsourcehinter.html
+3
-4
crowdsourcehinter/static/js/src/crowdsourcehinter.js
+13
-1
No files found.
crowdsourcehinter/crowdsourcehinter.py
View file @
24119b73
...
...
@@ -122,7 +122,7 @@ class CrowdsourceHinter(XBlock):
# the string returned by the event problem_graded is very messy and is different
# for each problem, but after all of the numbers/letters there is an equal sign, after which the
# student's input is shown. I use the function below to remove everything before the first equal
# sign and only take the student's actual input.
# sign and only take the student's actual input.
This is not very clean.
if
"="
in
answer
:
if
found_equal_sign
==
0
:
found_equal_sign
=
1
...
...
@@ -166,7 +166,7 @@ class CrowdsourceHinter(XBlock):
self
.
Used
.
append
(
str
(
"There are no hints for"
+
" "
+
answer
))
return
{
'HintsToUse'
:
"Sorry, there are no more hints for this answer."
}
self
.
Used
.
append
(
not_used
)
return
{
'HintsToUse'
:
not_used
}
return
{
'HintsToUse'
:
not_used
,
"StudentAnswer"
:
answer
}
def
find_hints
(
self
,
answer
):
"""
...
...
crowdsourcehinter/static/css/crowdsourcehinter.css
View file @
24119b73
...
...
@@ -14,7 +14,6 @@
.csh_hint_value
{
display
:
flex
;
margin-left
:
10px
;
/*column-count: 2;*/
}
.csh_rating_data
{
...
...
@@ -26,6 +25,11 @@
background-color
:
#FF8
;
}
.csh_hint_reveal
{
display
:
flex
;
flex-direction
:
row
;
}
.csh_hint_data
{
justify-content
:
center
;
width
:
97%
;
...
...
@@ -40,7 +44,6 @@
}
div
[
data-rate
=
"flag"
]
{
text-align
:
right
;
align-self
:
flex-end
;
}
...
...
crowdsourcehinter/static/html/crowdsourcehinter.html
View file @
24119b73
...
...
@@ -53,10 +53,9 @@
<div
class=
"crowdsourcehinter_block"
>
<p>
<div
class=
'csh_hint_reveal'
>
<div>
<span
class=
'csh_HintsToUse'
></span>
<span
class=
'csh_HintsToUse'
student_answer =
''
></span>
</div>
<div>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"upvote"
data-icon=
"arrow-u"
aria-label=
"upvote"
>
...
...
@@ -69,8 +68,8 @@
<b>
⚑
</b>
</div>
</div>
<div>
</sp>
<
/
div>
<div
class=
"crowdsourcehinter_block"
>
...
...
crowdsourcehinter/static/js/src/crowdsourcehinter.js
View file @
24119b73
...
...
@@ -68,6 +68,8 @@ function CrowdsourceHinter(runtime, element){
function
seehint
(
result
){
//Show a hint to the student after an incorrect answer is submitted.
console
.
log
(
result
.
StudentAnswer
);
$
(
'.csh_HintsToUse'
,
element
).
attr
(
'student_answer'
,
result
.
StudentAnswer
);
$
(
'.csh_HintsToUse'
,
element
).
text
(
result
.
HintsToUse
);
}
...
...
@@ -220,6 +222,16 @@ function CrowdsourceHinter(runtime, element){
})
$
(
element
).
on
(
'click'
,
'.csh_rate_hint'
,
function
(){
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'
)});
console
.
log
(
hint
);
console
.
log
(
student_answer
);
});
//This version of the rate hint is currently decomissioned. This is valid if hint rating/flagging is returned
//soley to showing after the student correctly answers the question.
/* $(element).on('click', '.csh_rate_hint', function(){
//Click event to change the rating/flag a hint. The attribute 'data-rate' within each .rate_hint button is used
//to determine whether the student is upvoting, downvoting, or flagging the hint.
hint = $(this).parent().parent().find(".csh_hint").text();
...
...
@@ -247,7 +259,7 @@ function CrowdsourceHinter(runtime, element){
}
}
});
})
})
*/
$
(
element
).
on
(
'click'
,
'.csh_staff_rate'
,
function
(){
//Staff ratings are the removal or unflagging of flagged hints from the database. The attribute 'data-rate' is used
...
...
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