Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx
edx-platform
Commits
242d0c28
Commit
242d0c28
authored
Jun 25, 2013
by
Felix Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly fomatted the tab-based UX for hint-voting.
Chiseled a little at writing template tests.
parent
c79ca38f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
1 deletions
+69
-1
common/lib/xmodule/xmodule/tests/test_crowdsource_hinter.py
+20
-0
common/templates/hinter_display.html
+49
-1
No files found.
common/lib/xmodule/xmodule/tests/test_crowdsource_hinter.py
View file @
242d0c28
...
...
@@ -281,6 +281,26 @@ class CrowdsourceHinterTest(unittest.TestCase):
self
.
assertTrue
(
'Another random hint'
in
out
)
def
test_template_feedback
(
self
):
"""
Test the templates for get_feedback.
"""
m
=
CHModuleFactory
.
create
()
def
fake_get_feedback
(
get
):
index_to_answer
=
{
'0'
:
'42.0'
,
'1'
:
'9000.01'
}
index_to_hints
=
{
'0'
:
[(
'A hint for 42'
,
12
),
(
'Another hint for 42'
,
14
)],
'1'
:
[(
'A hint for 9000.01'
,
32
)]}
return
{
'index_to_hints'
:
index_to_hints
,
'index_to_answer'
:
index_to_answer
}
m
.
get_feedback
=
fake_get_feedback
json_in
=
{
'problem_name'
:
'42.5'
}
out
=
json
.
loads
(
m
.
handle_ajax
(
'get_feedback'
,
json_in
))[
'contents'
]
...
...
common/templates/hinter_display.html
View file @
242d0c28
...
...
@@ -18,6 +18,53 @@
</
%
def>
<
%
def
name=
"get_feedback()"
>
<style>
#answer-tabs
{
background
:
transparent
;
border
:
none
;
}
#answer-tabs
.ui-widget-header
{
border-bottom
:
1px
solid
#DCDCDC
;
}
#answer-tabs
.ui-tabs-nav
.ui-state-default
{
border
:
1px
solid
#DCDCDC
;
background
:
#EEEEEE
;
margin-bottom
:
0px
;
}
#answer-tabs
.ui-tabs-nav
.ui-state-default
:hover
{
background
:
transparent
;
}
#answer-tabs
.ui-tabs-nav
.ui-state-active
{
border
:
1px
solid
#DCDCDC
;
background
:
transparent
;
margin-bottom
:
0px
;
}
#answer-tabs
.ui-tabs-nav
.ui-state-active
a
{
color
:
#222222
;
}
#answer-tabs
.ui-tabs-nav
.ui-state-default
a
:hover
{
color
:
#222222
;
}
.hint-inner-container
{
padding-left
:
15px
;
padding-right
:
15px
;
font-size
:
16px
;
}
.vote
{
padding-top
:
0px
!important
;
padding-bottom
:
0px
!important
;
}
</style>
<i>
Participation in the hinting system is strictly optional, and will not influence
your grade.
</i>
<br
/>
...
...
@@ -33,6 +80,7 @@
% for index, answer in index_to_answer.items():
<div
class =
"previous-answer"
id=
"previous-answer-${index}"
>
<div
class =
"hint-inner-container"
>
% if index in index_to_hints and len(index_to_hints[index]) > 0:
Which hint was most helpful when you got the wrong answer of ${answer}?
<br
/>
...
...
@@ -53,7 +101,7 @@ What would you say to help someone who got this wrong answer?
</textarea>
<input
class=
"submit-hint"
data-answer=
"${index}"
type=
"button"
value=
"submit"
>
</div>
</div>
</div>
% endfor
</div>
...
...
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