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
4d6e4c0f
Commit
4d6e4c0f
authored
Nov 23, 2014
by
solashirai
Committed by
Piotr Mitros
Oct 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
templates implemented
parent
fda7431d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
5 deletions
+30
-5
crowdsourcehinter/static/html/crowdsourcehinter.html
+14
-2
crowdsourcehinter/static/js/src/crowdsourcehinter.js
+16
-3
No files found.
crowdsourcehinter/static/html/crowdsourcehinter.html
View file @
4d6e4c0f
...
...
@@ -4,7 +4,7 @@
<
b
>
↑
<
/b
>
<
/div
>
<
div
class
=
"csh_rating"
>
{{
rating
}}
<
/div
>
<
div
class
=
"csh_hint"
>
{{
hint
}}
<
/div
>
<
div
class
=
"csh_hint"
>
{{
hint
}}
<
/div
>
<
div
role
=
"button"
class
=
"csh_rate_hint"
data
-
rate
=
"downvote"
aria
-
label
=
"downvote"
>
<
b
>
↓
<
/b
>
<
/div
>
...
...
@@ -19,12 +19,24 @@
<
div
role
=
"button"
class
=
"csh_staff_rate"
data
-
rate
=
"unflag"
aria
-
label
=
"unflag"
>
<
b
>
O
<
/b
>
<
/div
>
<
div
class
=
"csh_hint"
>
{{
hint
}}
<
/div
>
<
div
class
=
"csh_hint"
>
{{
hint
}}
<
/div
>
<
div
role
=
"button"
class
=
"csh_staff_rate"
data
-
rate
=
"remove"
aria
-
label
=
"remove"
>
<
b
>
X
<
/b
>
<
/div>
<
/div
>
</script>
<script
type=
"x-tmpl/mustache"
id=
"student_hint_creation"
>
<
p
><
input
type
=
"text"
name
=
"studentinput"
class
=
"csh_student_text_input"
size
=
"40"
>
<
input
answer
=
"{{student_answer}}"
type
=
"button"
class
=
"csh_submit_new"
value
=
"Submit Hint"
>
<
/p
>
</script>
<script
type=
"x-tmpl/mustache"
id=
"show_no_hints"
>
<
div
class
=
"csh_hint_value"
value
=
"There are no answer-specific hints for this answer."
>
<
/div
>
</script>
<script
type=
"x-tmpl/mustache"
id=
"show_answer_feedback"
>
<
div
class
=
"csh_student_answer"
>
<
span
><
b
>
{{
answer
}}
<
/b></
span
>
...
...
crowdsourcehinter/static/js/src/crowdsourcehinter.js
View file @
4d6e4c0f
...
...
@@ -98,7 +98,6 @@ function CrowdsourceHinter(runtime, element){
hint
:
result
.
hint
};
html
=
Mustache
.
render
(
template
,
data
);
console
.
log
(
html
);
});
$
(
".csh_flagged_hints"
,
element
).
append
(
html
);
}
...
...
@@ -141,7 +140,14 @@ function CrowdsourceHinter(runtime, element){
if
(
hint
===
"null"
){
$
(
".csh_student_answer"
,
element
).
each
(
function
(){
if
(
$
(
this
).
find
(
"span"
).
text
()
==
student_answer
){
$
(
this
).
append
(
"<div class=
\"
csh_hint_value
\"
value=
\"
There are no answer-specific hints for this answer.
\"
></div>"
);
var
html
=
""
;
$
(
function
(){
var
template
=
$
(
'#show_no_hints'
).
html
();
var
data
=
{};
html
=
Mustache
.
render
(
template
,
data
);
});
$
(
this
).
append
(
html
);
// $(this).append("<div class=\"csh_hint_value\" value=\"There are no answer-specific hints for this answer.\"></div>");
}
});
}
...
...
@@ -178,7 +184,14 @@ function CrowdsourceHinter(runtime, element){
student_answer
=
$
(
this
).
parent
().
parent
().
find
(
"span"
).
text
();
$
(
".csh_student_answer"
,
element
).
each
(
function
(){
if
(
$
(
this
).
find
(
"span"
).
text
()
==
student_answer
){
$
(
this
).
append
(
"<p><input type=
\"
text
\"
name=
\"
studentinput
\"
class=
\"
csh_student_text_input
\"
size=
\"
40
\"
><input answer=
\"
"
+
student_answer
+
"
\"
type=
\"
button
\"
class=
\"
csh_submit_new
\"
value=
\"
Submit Hint
\"
> </p>"
);
var
html
=
""
;
$
(
function
(){
var
template
=
$
(
'#student_hint_creation'
).
html
();
var
data
=
{
student_answer
:
student_answer
};
html
=
Mustache
.
render
(
template
,
data
);
});
$
(
this
).
append
(
html
);
//$(this).append("<p><input type=\"text\" name=\"studentinput\" class=\"csh_student_text_input\" size=\"40\"><input answer=\""+student_answer+"\" type=\"button\" class=\"csh_submit_new\" value=\"Submit Hint\"> </p>");
}
});
})
...
...
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