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
b38595f1
Commit
b38595f1
authored
Jan 30, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the fixtures, add new tests, remove useless code
from the original JS
parent
4df62d96
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
4 deletions
+84
-4
common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html
+69
-2
common/lib/xmodule/xmodule/js/spec/combinedopenended/display_spec.coffee
+15
-1
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
+0
-1
No files found.
common/lib/xmodule/xmodule/js/fixtures/combined-open-ended.html
View file @
b38595f1
<section
id=
"combined-open-ended"
class=
"combined-open-ended"
data-ajax-url=
"/courses/MITx/6.002x/2012_Fall/modx/i4x://MITx/6.002x/combinedopenended/CombinedOE"
data-allow_reset=
"False"
data-state=
"assessing"
data-task-count=
"2"
data-task-number=
"2"
>
<section
class=
"course-content"
>
<section
class=
"xmodule_display xmodule_CombinedOpenEndedModule"
data-type=
"CombinedOpenEnded"
>
<section
id=
"combined-open-ended"
class=
"combined-open-ended"
data-ajax-url=
"/courses/MITx/6.002x/2012_Fall/modx/i4x://MITx/6.002x/combinedopenended/CombinedOE"
data-allow_reset=
"False"
data-state=
"assessing"
data-task-count=
"2"
data-task-number=
"2"
>
<h2>
Problem 1
</h2>
<div
class=
"status-container"
>
...
...
@@ -53,4 +55,69 @@
<a
name=
"results"
>
<div
class=
"result-container"
>
</div>
</a></section>
</a></section><a
name=
"results"
>
</a></section><a
name=
"results"
>
</a><div><a
name=
"results"
>
</a><a
href=
"https://github.com/MITx/content-mit-6002x/tree/master/combinedopenended/CombinedOE.xml"
>
Edit
</a>
/
<a
href=
"#i4x_MITx_6_002x_combinedopenended_CombinedOE_xqa-modal"
onclick=
"javascript:getlog('i4x_MITx_6_002x_combinedopenended_CombinedOE', {
'location': 'i4x://MITx/6.002x/combinedopenended/CombinedOE',
'xqa_key': 'KUBrWtK3RAaBALLbccHrXeD3RHOpmZ2A',
'category': 'CombinedOpenEndedModule',
'user': 'blah'
})"
id=
"i4x_MITx_6_002x_combinedopenended_CombinedOE_xqa_log"
>
QA
</a>
</div>
<div><a
href=
"#i4x_MITx_6_002x_combinedopenended_CombinedOE_debug"
id=
"i4x_MITx_6_002x_combinedopenended_CombinedOE_trig"
>
Staff Debug Info
</a></div>
<section
id=
"i4x_MITx_6_002x_combinedopenended_CombinedOE_xqa-modal"
class=
"modal xqa-modal"
style=
"width:80%; left:20%; height:80%; overflow:auto"
>
<div
class=
"inner-wrapper"
>
<header>
<h2>
edX Content Quality Assessment
</h2>
</header>
<form
id=
"i4x_MITx_6_002x_combinedopenended_CombinedOE_xqa_form"
class=
"xqa_form"
>
<label>
Comment
</label>
<input
id=
"i4x_MITx_6_002x_combinedopenended_CombinedOE_xqa_entry"
type=
"text"
placeholder=
"comment"
>
<label>
Tag
</label>
<span
style=
"color:black;vertical-align: -10pt"
>
Optional tag (eg "done" or "broken"):
</span>
<input
id=
"i4x_MITx_6_002x_combinedopenended_CombinedOE_xqa_tag"
type=
"text"
placeholder=
"tag"
style=
"width:80px;display:inline"
>
<div
class=
"submit"
>
<button
name=
"submit"
type=
"submit"
>
Add comment
</button>
</div>
<hr>
<div
id=
"i4x_MITx_6_002x_combinedopenended_CombinedOE_xqa_log_data"
></div>
</form>
</div>
</section>
<section
class=
"modal staff-modal"
id=
"i4x_MITx_6_002x_combinedopenended_CombinedOE_debug"
style=
"width:80%; left:20%; height:80%; overflow:auto;"
>
<div
class=
"inner-wrapper"
style=
"color:black"
>
<header>
<h2>
Staff Debug
</h2>
</header>
<div
class=
"staff_info"
style=
"display:block"
>
is_released =
<font
color=
"red"
>
Yes!
</font>
location = i4x://MITx/6.002x/combinedopenended/CombinedOE
github =
<a
href=
"https://github.com/MITx/content-mit-6002x/tree/master/combinedopenended/CombinedOE.xml"
>
https://github.com/MITx/content-mit-6002x/tree/master/combinedopenended/CombinedOE.xml
</a>
definition =
<pre>
None
</pre>
metadata = {
"showanswer": "attempted",
"display_name": "Problem 1",
"graceperiod": "1 day 12 hours 59 minutes 59 seconds",
"xqa_key": "KUBrWtK3RAaBALLbccHrXeD3RHOpmZ2A",
"rerandomize": "never",
"start": "2012-09-05T12:00",
"attempts": "10000",
"data_dir": "content-mit-6002x",
"max_score": "1"
}
category = CombinedOpenEndedModule
</div>
</div>
</section>
<div
id=
"i4x_MITx_6_002x_combinedopenended_CombinedOE_setup"
></div>
</section>
common/lib/xmodule/xmodule/js/spec/combinedopenended/display_spec.coffee
View file @
b38595f1
...
...
@@ -3,13 +3,27 @@ describe 'CombinedOpenEnded', ->
spyOn
Logger
,
'log'
# load up some fixtures
loadFixtures
'combined-open-ended.html'
@
element
=
$
(
'.co
mbined-open-ended
'
)
@
element
=
$
(
'.co
urse-content
'
)
describe
'constructor'
,
->
beforeEach
->
spyOn
(
Collapsible
,
'setCollapsibles'
)
@
combined
=
new
CombinedOpenEnded
@
element
it
'set the element'
,
->
expect
(
@
combined
.
element
).
toEqual
@
element
it
'get the correct values from data fields'
,
->
expect
(
@
combined
.
ajax_url
).
toEqual
'/courses/MITx/6.002x/2012_Fall/modx/i4x://MITx/6.002x/combinedopenended/CombinedOE'
expect
(
@
combined
.
state
).
toEqual
'assessing'
expect
(
@
combined
.
task_count
).
toEqual
2
expect
(
@
combined
.
task_number
).
toEqual
2
it
'subelements are made collapsible'
,
->
expect
(
Collapsible
.
setCollapsibles
).
toHaveBeenCalled
()
it
'elements are rebound for assessing state'
,
->
expect
(
@
combined
.
answer_area
.
attr
(
"disabled"
)).
toBe
(
"disabled"
)
expect
(
@
combined
.
submit_button
.
val
()).
toBe
(
"Submit assessment"
)
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
View file @
b38595f1
...
...
@@ -7,7 +7,6 @@ class @CombinedOpenEnded
@
wrapper
=
$
(
element
).
find
(
'section.xmodule_CombinedOpenEndedModule'
)
@
el
=
$
(
element
).
find
(
'section.combined-open-ended'
)
@
combined_open_ended
=
$
(
element
).
find
(
'section.combined-open-ended'
)
@
id
=
@
el
.
data
(
'id'
)
@
ajax_url
=
@
el
.
data
(
'ajax-url'
)
@
state
=
@
el
.
data
(
'state'
)
@
task_count
=
@
el
.
data
(
'task-count'
)
...
...
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