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
1029ba95
Commit
1029ba95
authored
Jan 19, 2015
by
solashirai
Committed by
Piotr Mitros
Oct 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
continuing various works
parent
0c6d3d68
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
11 deletions
+20
-11
crowdsourcehinter/crowdsourcehinter.py
+16
-4
crowdsourcehinter/static/css/crowdsourcehinter.css
+0
-4
crowdsourcehinter/static/html/crowdsourcehinter.html
+1
-1
crowdsourcehinter/static/js/src/crowdsourcehinter.js
+3
-2
No files found.
crowdsourcehinter/crowdsourcehinter.py
View file @
1029ba95
...
...
@@ -129,12 +129,9 @@ class CrowdsourceHinter(XBlock):
print
(
str
(
self
.
hint_database
))
print
(
str
(
self
.
initial_hints
))
print
(
str
(
self
.
generic_hints
))
print
(
str
(
self
.
Flagged
))
# populate hint_database with hints from initial_hints if there are no hints in hint_database.
# this probably will occur only on the very first run of a unit containing this block.
if
not
bool
(
self
.
hint_database
):
#temporarydict = self.initial_hints
#temporarydict = ast.literal_eval(temporarydict)
#TODO: Figure out why temporarydict = self.initial_hints doesn't work.
self
.
hint_database
=
copy
.
copy
(
self
.
initial_hints
)
...
...
@@ -394,6 +391,8 @@ class CrowdsourceHinter(XBlock):
"""
<verticaldemo>
<crowdsourcehinter>
"Hello world!"
Hello World!
{"initial_hint_answer": "michigann", "initial_hint_text": "you have an extra n", "generic_hint": "make sure to chekc your spelling"}
</crowdsourcehinter>
</verticaldemo>
...
...
@@ -407,7 +406,20 @@ class CrowdsourceHinter(XBlock):
A minimal working test for parse_xml
"""
block
=
runtime
.
construct_xblock_from_class
(
cls
,
keys
)
print
(
node
)
#import pdb; pdb.set_trace()
#['__class__', '__contains__', '__copy__', '__deepcopy__', '__delattr__', '__delitem__', '__doc__', '__format__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__len__', '__module__', '__new__', '__nonzero__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__setattr__', '__setitem__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '_filter', '_init', 'addnext', 'addprevious', 'append', 'attrib', 'base', 'blacklist', 'clear', 'extend', 'find', 'findall', 'findtext', 'get', 'getchildren', 'getiterator', 'getnext', 'getparent', 'getprevious', 'getroottree', 'index', 'insert', 'items', 'iter', 'iterancestors', 'iterchildren', 'iterdescendants', 'iterfind', 'itersiblings', 'itertext', 'keys', 'makeelement', 'nsmap', 'prefix', 'remove', 'replace', 'set', 'sourceline', 'tag', 'tail', 'text', 'values', 'xpath']
print
(
node
.
tag
)
print
(
node
.
tail
)
print
(
node
.
values
)
print
(
node
.
xpath
)
print
(
node
.
items
)
print
(
node
.
iterchildren
)
print
(
node
.
itertext
)
print
(
node
.
keys
)
print
(
node
.
makeelement
)
print
(
node
.
sourceline
)
print
(
node
.
tag
)
print
(
node
.
text
)
print
type
(
node
)
block
.
generic_hints
=
[
"Make sure to check your answer for basic mistakes like spelling!"
]
...
...
crowdsourcehinter/static/css/crowdsourcehinter.css
View file @
1029ba95
/* CSS for CrowdsourceHinter */
.crowdsourcehinter_block
.csh_feedback
{
border-style
:
solid
;
border-width
:
thin
;
border-color
:
rgb
(
200
,
200
,
200
);
}
.crowdsourcehinter_block
.csh_vote
{
...
...
@@ -18,7 +15,6 @@
}
.crowdsourcehinter_block
{
background-color
:
#BBE2ED
;
}
.csh_hint_reveal
{
...
...
crowdsourcehinter/static/html/crowdsourcehinter.html
View file @
1029ba95
...
...
@@ -56,7 +56,7 @@
<div
class=
"crowdsourcehinter_block"
>
<div
class=
'csh_hint_reveal'
>
<div
class=
'csh_HintsToUse'
student_answer =
''
>
<div
class=
'csh_HintsToUse'
student_answer =
''
hint_received=
''
>
</div>
<div
class=
'csh_HintQuickFeedback'
>
<div
role=
"button"
class=
"csh_rate_hint"
data-rate=
"upvote"
title=
"This hint was helpful!"
>
...
...
crowdsourcehinter/static/js/src/crowdsourcehinter.js
View file @
1029ba95
...
...
@@ -70,7 +70,8 @@ function CrowdsourceHinter(runtime, element){
function
seehint
(
result
){
//Show a hint to the student after an incorrect answer is submitted.
$
(
'.csh_HintsToUse'
,
element
).
attr
(
'student_answer'
,
result
.
StudentAnswer
);
$
(
'.csh_HintsToUse'
,
element
).
text
(
result
.
HintsToUse
);
$
(
'.csh_HintsToUse'
,
element
).
attr
(
'hint_received'
,
result
.
HintsToUse
);
$
(
'.csh_HintsToUse'
,
element
).
text
(
"Hint: "
+
result
.
HintsToUse
);
}
function
showHintFeedback
(
hint
,
student_answer
){
...
...
@@ -216,7 +217,7 @@ function CrowdsourceHinter(runtime, element){
if
(
$
(
this
).
attr
(
'data-rate'
)
==
"flag"
){
alert
(
"This hint has been flagged for review."
);
}
hint
=
$
(
'.csh_HintsToUse'
,
element
).
text
(
);
hint
=
$
(
'.csh_HintsToUse'
,
element
).
attr
(
'hint_received'
);
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'
)});
$
.
ajax
({
...
...
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