Commit f929b493 by Vik Paruchuri

Add in jasmine test for rubric, fix combinedopenended jasmine failures

parent adbfdcce
<section id="combined-open-ended" class="combined-open-ended" data-location="i4x://test/2323/combinedopenended/b893eedec151441f8644187266ccce00" data-ajax-url="/courses/test/2323/Test2/modx/i4x://test/2323/combinedopenended/b893eedec151441f8644187266ccce00" data-allow_reset="False" data-state="initial" data-task-count="1" data-task-number="1" data-accept-file-upload="False">
<div class="name">
<h2>Open Response Assessment</h2>
<div class="progress-container">
</div>
</div>
<div class="problemwrapper">
<div class="status-bar">
<table class="statustable">
<tbody><tr>
<td class="problemtype-container">
<div class="problemtype">
Open Response
</div>
</td>
<td class="assessments-container">
<div class="assessment-text">
Assessments:
</div>
<div class="status-container">
<div class="status-elements">
<section id="combined-open-ended-status" class="combined-open-ended-status">
<div class="statusitem statusitem-current" data-status-number="0">
Peer
</div>
</section>
</div>
</div>
</td>
</tr>
</tbody></table>
</div>
<div class="item-container">
<div class="visibility-control visibility-control-prompt">
<div class="inner">
</div>
<a href="" class="question-header">Show Prompt</a>
</div>
<div class="problem-container">
<div class="item">
<section id="openended_open_ended" class="open-ended-child" data-state="post_assessment" data-child-type="openended">
<div class="error"></div>
<div class="prompt open" style="display: none;">
<h3>Censorship in the Libraries</h3><p>'All of us can think of a book that we hope none of our children or any other children have taken off the shelf. But if I have the right to remove that book from the shelf -- that work I abhor -- then you also have exactly the same right and so does everyone else. And then we have no books left on the shelf for any of us.' --Katherine Paterson, Author
</p><p>
Write a persuasive essay to a newspaper reflecting your vies on censorship in libraries. Do you believe that certain materials, such as books, music, movies, magazines, etc., should be removed from the shelves if they are found offensive? Support your position with convincing arguments from your own experience, observations, and/or reading.
</p>
</div>
<div class="visibility-control visibility-control-response">
<div class="inner">
</div>
<span class="section-header section-header-response">Response</span>
</div>
<div class="answer short-form-response" id="input_open_ended"></div>
<div class="message-wrapper"></div>
<div class="grader-status">
</div>
<div class="file-upload"></div>
<input type="button" value="Submit post-assessment" class="submit-button" name="show" style="display: none;">
<input name="skip" class="skip-button" type="button" value="Skip Post-Assessment" style="display: none;">
<div class="open-ended-action"></div>
<span id="answer_open_ended"></span>
</section>
</div>
</div>
<input type="button" value="Reset" class="reset-button" name="reset" style="display: inline-block;">
<input type="button" value="Next Step" class="next-step-button" name="reset" style="display: none;">
</div>
<div class="combined-rubric-container" data-status="shown" data-number="0" style="">
<div class="visibility-control visibility-control-rubric">
<div class="inner">
</div>
<span class="section-header section-header-rubric">Submitted Rubric</span>
</div>
<div class="rubric-header">
Scored rubric from grader 1
<button class="rubric-collapse" href="#">Show Full Rubric</button>
</div>
<div class="rubric">
<span class="rubric-category">
Ideas
</span> <br>
<ul class="rubric-list">
<li class="rubric-list-item">
<div class="rubric-label">
<label class="choicegroup_incorrect wrapper-score-selection"></label>
<span class="wrappable"> 0 points :
Difficult for the reader to discern the main idea. Too brief or too repetitive to establish or maintain a focus.
</span>
</div>
</li>
<li class="rubric-list-item rubric-info-item" style="display: none;">
<div class="rubric-label">
<label class="rubric-elements-info">
<span class="wrapper-score-selection"> </span>
<span class="wrappable"> 1 points :
Attempts a main idea. Sometimes loses focus or ineffectively displays focus.
</span>
</label>
</div>
</li>
<li class="rubric-list-item rubric-info-item" style="display: none;">
<div class="rubric-label">
<label class="rubric-elements-info">
<span class="wrapper-score-selection"> </span>
<span class="wrappable"> 2 points :
Presents a unifying theme or main idea, but may include minor tangents. Stays somewhat focused on topic and task.
</span>
</label>
</div>
</li>
<li class="rubric-list-item rubric-info-item" style="display: none;">
<div class="rubric-label">
<label class="rubric-elements-info">
<span class="wrapper-score-selection"> </span>
<span class="wrappable"> 3 points :
Presents a unifying theme or main idea without going off on tangents. Stays completely focused on topic and task.
</span>
</label>
</div>
</li>
</ul>
<span class="rubric-category">
Content
</span> <br>
<ul class="rubric-list">
<li class="rubric-list-item">
<div class="rubric-label">
<label class="choicegroup_incorrect wrapper-score-selection"></label>
<span class="wrappable"> 0 points :
Includes little information with few or no details or unrelated details. Unsuccessful in attempts to explore any facets of the topic.
</span>
</div>
</li>
<li class="rubric-list-item rubric-info-item" style="display: none;">
<div class="rubric-label">
<label class="rubric-elements-info">
<span class="wrapper-score-selection"> </span>
<span class="wrappable"> 1 points :
Includes little information and few or no details. Explores only one or two facets of the topic.
</span>
</label>
</div>
</li>
<li class="rubric-list-item rubric-info-item" style="display: none;">
<div class="rubric-label">
<label class="rubric-elements-info">
<span class="wrapper-score-selection"> </span>
<span class="wrappable"> 2 points :
Includes sufficient information and supporting details. (Details may not be fully developed; ideas may be listed.) Explores some facets of the topic.
</span>
</label>
</div>
</li>
<li class="rubric-list-item rubric-info-item" style="display: none;">
<div class="rubric-label">
<label class="rubric-elements-info">
<span class="wrapper-score-selection"> </span>
<span class="wrappable"> 3 points :
Includes in-depth information and exceptional supporting details that are fully developed. Explores all facets of the topic.
</span>
</label>
</div>
</li>
</ul>
<span class="rubric-category">
Organization
</span> <br>
<ul class="rubric-list">
<li class="rubric-list-item">
<div class="rubric-label">
<label class="choicegroup_incorrect wrapper-score-selection"></label>
<span class="wrappable"> 0 points :
Ideas organized illogically, transitions weak, and response difficult to follow.
</span>
</div>
</li>
<li class="rubric-list-item rubric-info-item" style="display: none;">
<div class="rubric-label">
<label class="rubric-elements-info">
<span class="wrapper-score-selection"> </span>
<span class="wrappable"> 1 points :
Attempts to logically organize ideas. Attempts to progress in an order that enhances meaning, and demonstrates use of transitions.
</span>
</label>
</div>
</li>
<li class="rubric-list-item rubric-info-item" style="display: none;">
<div class="rubric-label">
<label class="rubric-elements-info">
<span class="wrapper-score-selection"> </span>
<span class="wrappable"> 2 points :
Ideas organized logically. Progresses in an order that enhances meaning. Includes smooth transitions.
</span>
</label>
</div>
</li>
</ul>
<span class="rubric-category">
Style
</span> <br>
<ul class="rubric-list">
<li class="rubric-list-item">
<div class="rubric-label">
<label class="choicegroup_incorrect wrapper-score-selection"></label>
<span class="wrappable"> 0 points :
Contains limited vocabulary, with many words used incorrectly. Demonstrates problems with sentence patterns.
</span>
</div>
</li>
<li class="rubric-list-item rubric-info-item" style="display: none;">
<div class="rubric-label">
<label class="rubric-elements-info">
<span class="wrapper-score-selection"> </span>
<span class="wrappable"> 1 points :
Contains basic vocabulary, with words that are predictable and common. Contains mostly simple sentences (although there may be an attempt at more varied sentence patterns).
</span>
</label>
</div>
</li>
<li class="rubric-list-item rubric-info-item" style="display: none;">
<div class="rubric-label">
<label class="rubric-elements-info">
<span class="wrapper-score-selection"> </span>
<span class="wrappable"> 2 points :
Includes vocabulary to make explanations detailed and precise. Includes varied sentence patterns, including complex sentences.
</span>
</label>
</div>
</li>
</ul>
<span class="rubric-category">
Voice
</span> <br>
<ul class="rubric-list">
<li class="rubric-list-item">
<div class="rubric-label">
<label class="choicegroup_incorrect wrapper-score-selection"></label>
<span class="wrappable"> 0 points :
Demonstrates language and tone that may be inappropriate to task and reader.
</span>
</div>
</li>
<li class="rubric-list-item rubric-info-item" style="display: none;">
<div class="rubric-label">
<label class="rubric-elements-info">
<span class="wrapper-score-selection"> </span>
<span class="wrappable"> 1 points :
Demonstrates an attempt to adjust language and tone to task and reader.
</span>
</label>
</div>
</li>
<li class="rubric-list-item rubric-info-item" style="display: none;">
<div class="rubric-label">
<label class="rubric-elements-info">
<span class="wrapper-score-selection"> </span>
<span class="wrappable"> 2 points :
Demonstrates effective adjustment of language and tone to task and reader.
</span>
</label>
</div>
</li>
</ul>
</div>
<div class="written-feedback">
</div>
</div>
<section class="legend-container">
</section>
<div class="result-container">
</div>
</div>
</section>
\ No newline at end of file
describe 'Rubric', ->
beforeEach ->
spyOn Logger, 'log'
# load up some fixtures
loadFixtures 'rubric.html'
jasmine.Clock.useMock()
@element = $('.combined-open-ended')
@location = @element.data('location')
describe 'constructor', ->
beforeEach ->
@rub = new Rubric @element
it 'rubric should properly grab the element', ->
expect(@rub.el).toEqual @element
describe 'initialize', ->
beforeEach ->
@rub = new Rubric @element
@rub.initialize @location
it 'rubric correctly sets location', ->
expect($(@rub.rubric_sel).data('location')).toEqual @location
it 'rubric correctly read', ->
expect(@rub.categories.length).toEqual 5
describe 'CombinedOpenEnded', -> describe 'CombinedOpenEnded', ->
beforeEach -> beforeEach ->
spyOn Logger, 'log' spyOn Logger, 'log'
...@@ -13,7 +40,7 @@ describe 'CombinedOpenEnded', -> ...@@ -13,7 +40,7 @@ describe 'CombinedOpenEnded', ->
@combined = new CombinedOpenEnded @element @combined = new CombinedOpenEnded @element
it 'set the element', -> it 'set the element', ->
expect(@combined.element).toEqual @element expect(@combined.el).toEqual @element
it 'get the correct values from data fields', -> 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.ajax_url).toEqual '/courses/MITx/6.002x/2012_Fall/modx/i4x://MITx/6.002x/combinedopenended/CombinedOE'
...@@ -77,7 +104,7 @@ describe 'CombinedOpenEnded', -> ...@@ -77,7 +104,7 @@ describe 'CombinedOpenEnded', ->
@combined.child_state = 'done' @combined.child_state = 'done'
@combined.rebind() @combined.rebind()
expect(@combined.answer_area.attr("disabled")).toBe("disabled") expect(@combined.answer_area.attr("disabled")).toBe("disabled")
expect(@combined.next_problem).toHaveBeenCalled() expect(@combined.next_problem_button).toBe(":visible")
describe 'next_problem', -> describe 'next_problem', ->
beforeEach -> beforeEach ->
...@@ -109,3 +136,5 @@ describe 'CombinedOpenEnded', -> ...@@ -109,3 +136,5 @@ describe 'CombinedOpenEnded', ->
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment