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
f141cafd
Commit
f141cafd
authored
Jan 04, 2015
by
solashirai
Committed by
Piotr Mitros
Oct 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed incorporation of initial hints
parent
2a5978fa
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
crowdsourcehinter/crowdsourcehinter.py
+2
-1
crowdsourcehinter/static/css/crowdsourcehinter.css
+1
-2
crowdsourcehinter/static/html/crowdsourcehinter.html
+1
-1
crowdsourcehinter/static/js/src/crowdsourcehinter.js
+5
-5
No files found.
crowdsourcehinter/crowdsourcehinter.py
View file @
f141cafd
...
...
@@ -120,7 +120,8 @@ class CrowdsourceHinter(XBlock):
# this probably will occur only on the very first run of a unit containing this block.
if
not
bool
(
self
.
hint_database
):
temporarydict
=
{}
temporarydict
=
self
.
initial_hints
temporarydict
=
str
(
self
.
initial_hints
)
temporarydict
=
ast
.
literal_eval
(
temporarydict
)
self
.
hint_database
=
temporarydict
answer
=
str
(
data
[
"submittedanswer"
])
answer
=
answer
.
lower
()
# for analyzing the student input string I make it lower case.
...
...
crowdsourcehinter/static/css/crowdsourcehinter.css
View file @
f141cafd
...
...
@@ -45,7 +45,6 @@
.csh_rate_hint
{
margin-right
:
15px
;
margin-top
:
5px
;
font-size
:
70%
;
align-self
:
flex-end
;
}
...
...
@@ -86,7 +85,7 @@ div[data-rate="downvote"] {
}
.csh_rating
{
margin-right
:
10
px
;
margin-right
:
5
px
;
}
.csh_rate_hint
{
cursor
:
pointer
}
...
...
crowdsourcehinter/static/html/crowdsourcehinter.html
View file @
f141cafd
...
...
@@ -42,7 +42,7 @@
<script
type=
"x-tmpl/mustache"
id=
"show_answer_feedback"
>
<
div
class
=
"csh_student_answer"
>
<
h
class
=
"csh_answer_text"
><
i
>
Your
incorrect
answer
:
{{
answer
}}
<
/i></
h
>
<
h
class
=
"csh_answer_text"
answer
=
{{
answer
}}
><
i
>
Your
answer
:
{{
answer
}}
<
/i></
h
>
<
/div
>
</script>
...
...
crowdsourcehinter/static/js/src/crowdsourcehinter.js
View file @
f141cafd
...
...
@@ -77,7 +77,7 @@ function CrowdsourceHinter(runtime, element){
//Append answer-specific hints for each student answer during the feedback stage.
//This appended div includes upvote/downvote/flagging buttons, the hint, and the hint's rating
$
(
".csh_student_answer"
,
element
).
each
(
function
(){
if
(
$
(
this
).
find
(
'.csh_answer_text'
).
text
(
)
==
student_answer
){
if
(
$
(
this
).
find
(
'.csh_answer_text'
).
attr
(
'answer'
)
==
student_answer
){
var
html
=
""
;
$
(
function
(){
var
data
=
{
...
...
@@ -134,7 +134,7 @@ function CrowdsourceHinter(runtime, element){
//hints return null if no answer-specific hints exist
if
(
hint
===
"null"
){
$
(
".csh_student_answer"
,
element
).
each
(
function
(){
if
(
$
(
this
).
find
(
'.csh_answer_text'
).
text
(
)
==
student_answer
){
if
(
$
(
this
).
find
(
'.csh_answer_text'
).
attr
(
'answer'
)
==
student_answer
){
var
html
=
""
;
var
template
=
$
(
'#show_no_hints'
).
html
();
var
data
=
{};
...
...
@@ -165,9 +165,9 @@ function CrowdsourceHinter(runtime, element){
$
(
'.csh_student_text_input'
).
remove
();
$
(
'.csh_submit_new'
).
remove
();
$
(
this
).
hide
();
student_answer
=
$
(
this
).
parent
().
parent
().
find
(
'.csh_answer_text'
).
text
(
);
student_answer
=
$
(
this
).
parent
().
parent
().
find
(
'.csh_answer_text'
).
attr
(
'answer'
);
$
(
".csh_student_answer"
,
element
).
each
(
function
(){
if
(
$
(
this
).
find
(
'.csh_answer_text'
).
text
(
)
==
student_answer
){
if
(
$
(
this
).
find
(
'.csh_answer_text'
).
attr
(
'answer'
)
==
student_answer
){
var
html
=
""
;
$
(
function
(){
var
template
=
$
(
'#student_hint_creation'
).
html
();
...
...
@@ -220,7 +220,7 @@ function CrowdsourceHinter(runtime, element){
//Staff ratings are the removal or unflagging of flagged hints from the database. The attribute 'data-rate' is used
//to determine whether to unflag or delete the hint.
hint
=
$
(
this
).
parent
().
find
(
".csh_hint"
).
text
();
student_answer
=
$
(
this
).
parent
().
parent
().
find
(
'.csh_answer_text'
).
text
(
);
student_answer
=
$
(
this
).
parent
().
parent
().
find
(
'.csh_answer_text'
).
attr
(
'answer'
);
$
.
ajax
({
type
:
"POST"
,
url
:
runtime
.
handlerUrl
(
element
,
'rate_hint'
),
...
...
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