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
a151e638
Commit
a151e638
authored
May 11, 2015
by
solashirai
Committed by
Piotr Mitros
Oct 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
various improvements, in progress
parent
0845dbdf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
crowdsourcehinter/static/css/crowdsourcehinter.css
+4
-4
crowdsourcehinter/static/html/crowdsourcehinter.html
+4
-4
crowdsourcehinter/static/js/src/crowdsourcehinter.js
+4
-3
No files found.
crowdsourcehinter/static/css/crowdsourcehinter.css
View file @
a151e638
...
@@ -19,13 +19,14 @@
...
@@ -19,13 +19,14 @@
.csh_hint_reveal
{
.csh_hint_reveal
{
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
row
;
justify-content
:
space-between
;
}
}
.csh_hint_rating_on_incorrect
{
.csh_hint_rating_on_incorrect
{
display
:
flex
;
display
:
flex
;
flex-direction
:
row
;
flex-direction
:
row
;
justify-content
:
flex-end
;
justify-content
:
space-between
;
}
}
.csh_hint_data
{
.csh_hint_data
{
...
@@ -40,9 +41,8 @@
...
@@ -40,9 +41,8 @@
}
}
.csh_rate_hint
,
.csh_report_hint
,
.csh_rate_hint_completed
,
.csh_rate_hint_text
{
.csh_rate_hint
,
.csh_report_hint
,
.csh_rate_hint_completed
,
.csh_rate_hint_text
{
margin-right
:
15px
;
margin-top
:
5px
;
align-self
:
flex-end
;
align-self
:
flex-end
;
margin-left
:
10px
;
}
}
div
[
data-rate
=
"report"
]
{
div
[
data-rate
=
"report"
]
{
...
...
crowdsourcehinter/static/html/crowdsourcehinter.html
View file @
a151e638
...
@@ -66,16 +66,16 @@
...
@@ -66,16 +66,16 @@
</div>
</div>
<div
class=
'csh_hint_rating_on_incorrect'
>
<div
class=
'csh_hint_rating_on_incorrect'
>
<div
class=
"csh_rate_hint_text"
>
<div
class=
"csh_rate_hint_text"
>
Rate this hint:
Rate this hint:
</div>
</div>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"upvote"
title=
"This hint was helpful!"
>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"upvote"
title=
"This hint was helpful!"
>
<b>
Helpful
</b>
<b>
Helpful
</b>
</div>
</div>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"downvote"
title=
"This hint was not very helpful."
>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"downvote"
title=
"This hint was not very helpful."
>
<b>
Unhelpful
</b>
<b>
Unhelpful
</b>
</div>
</div>
<div
role=
"button"
class=
"csh_report_hint"
title=
"Report this hint"
>
<div
role=
"button"
class=
"csh_report_hint"
title=
"Report this hint"
>
<b>
⚑
</b>
<b>
⚑
</b>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
crowdsourcehinter/static/js/src/crowdsourcehinter.js
View file @
a151e638
...
@@ -78,8 +78,7 @@ function CrowdsourceHinter(runtime, element, data){
...
@@ -78,8 +78,7 @@ function CrowdsourceHinter(runtime, element, data){
* @param data is generated by problem_graded event, contains status and data of the problem block
* @param data is generated by problem_graded event, contains status and data of the problem block
*/
*/
function
onStudentSubmission
(){
return
function
(
event_type
,
data
,
element
){
function
onStudentSubmission
(){
return
function
(
event_type
,
data
,
element
){
//search method of correctness of problem is brittle due to checking for a class within
//search method of correctness of problem is brittle
//the problem block.
if
(
checkIsAnswerCorrect
(
data
)){
if
(
checkIsAnswerCorrect
(
data
)){
startHintRating
();
startHintRating
();
}
else
{
//if the submitted answer is incorrect
}
else
{
//if the submitted answer is incorrect
...
@@ -112,6 +111,7 @@ function CrowdsourceHinter(runtime, element, data){
...
@@ -112,6 +111,7 @@ function CrowdsourceHinter(runtime, element, data){
$
(
'.csh_answer_text'
,
element
).
append
(
hintRatingUXTemplate
);
$
(
'.csh_answer_text'
,
element
).
append
(
hintRatingUXTemplate
);
var
hintCreationTemplate
=
$
(
Mustache
.
render
(
$
(
'#add_hint_creation'
).
html
(),
{}));
var
hintCreationTemplate
=
$
(
Mustache
.
render
(
$
(
'#add_hint_creation'
).
html
(),
{}));
$
(
'.csh_answer_text'
,
element
).
append
(
hintCreationTemplate
);
$
(
'.csh_answer_text'
,
element
).
append
(
hintCreationTemplate
);
Logger
.
log
(
"crowd_hinter.hint_rating_UX"
,
{
"hint"
:
hint
,
"student_answer"
:
student_answer
});
}
}
/**
/**
...
@@ -166,6 +166,7 @@ function CrowdsourceHinter(runtime, element, data){
...
@@ -166,6 +166,7 @@ function CrowdsourceHinter(runtime, element, data){
$
(
'.csh_student_answer'
,
element
).
append
(
noHintsTemplate
);
$
(
'.csh_student_answer'
,
element
).
append
(
noHintsTemplate
);
var
hintCreationTemplate
=
$
(
Mustache
.
render
(
$
(
'#add_hint_creation'
).
html
(),
{}));
var
hintCreationTemplate
=
$
(
Mustache
.
render
(
$
(
'#add_hint_creation'
).
html
(),
{}));
$
(
'.csh_student_answer'
,
element
).
append
(
hintCreationTemplate
);
$
(
'.csh_student_answer'
,
element
).
append
(
hintCreationTemplate
);
Logger
.
log
(
"crowd_hinter.hint_rating_UX"
,
{
"hint"
:
"null"
,
"student_answer"
:
student_answer
});
}
else
{
}
else
{
showStudentHintRatingUX
(
hint
,
student_answer
);
showStudentHintRatingUX
(
hint
,
student_answer
);
}
}
...
@@ -209,7 +210,7 @@ function CrowdsourceHinter(runtime, element, data){
...
@@ -209,7 +210,7 @@ function CrowdsourceHinter(runtime, element, data){
url
:
runtime
.
handlerUrl
(
element
,
'add_new_hint'
),
url
:
runtime
.
handlerUrl
(
element
,
'add_new_hint'
),
data
:
JSON
.
stringify
({
"submission"
:
newHint
,
"answer"
:
studentAnswer
}),
data
:
JSON
.
stringify
({
"submission"
:
newHint
,
"answer"
:
studentAnswer
}),
success
:
function
()
{
success
:
function
()
{
Logger
.
log
(
'crowd_hinter.submit_new
.click.eve
nt'
,
{
"student_answer"
:
studentAnswer
,
"new_hint_submission"
:
newHint
})
Logger
.
log
(
'crowd_hinter.submit_new
_hi
nt'
,
{
"student_answer"
:
studentAnswer
,
"new_hint_submission"
:
newHint
})
}
}
});
});
$
(
'.csh_student_text_input'
,
element
).
remove
();
$
(
'.csh_student_text_input'
,
element
).
remove
();
...
...
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