Skip to content

Commit 400f49c

Browse files
committed
round scores in student mastery gradebook
fixes CNVS-13601 test plan - create some outcome results with fractional scores (live assessments are great for this) - view them in the student mastery gradebook - ensure that the scores are rounded to two decimal places - click to view the alignment details - ensure that scores on the alignment details dialog are rounded Change-Id: Ie46dd732597619c44479cb9c7000c0debe0aa2c0 Reviewed-on: https://gerrit.instructure.com/36380 Reviewed-by: Braden Anderson <braden@instructure.com> Tested-by: Jenkins <jenkins@instructure.com> QA-Review: Trevor deHaan <tdehaan@instructure.com> Product-Review: Joel Hough <joel@instructure.com>
1 parent 0f1c92f commit 400f49c

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

app/coffeescripts/models/grade_summary/Outcome.coffee

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ define [
2121
else
2222
'undefined'
2323

24+
roundedScore: ->
25+
score = @get('score')
26+
if _.isNumber(score)
27+
Math.round(score * 100.0) / 100.0
28+
else
29+
null
30+
2431
scoreDefined: ->
2532
_.isNumber(@get('score'))
2633

@@ -36,6 +43,7 @@ define [
3643
toJSON: ->
3744
_.extend super,
3845
status: @status()
46+
roundedScore: @roundedScore()
3947
scoreDefined: @scoreDefined()
4048
percentProgress: @percentProgress()
4149
masteryPercent: @masteryPercent()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="title">{{name}}</div>
22
<div class="outcome-bar-wrapper">
3-
<div class="score"><strong>{{score}}</strong>/{{mastery_points}}</div>
3+
<div class="score"><strong>{{roundedScore}}</strong>/{{mastery_points}}</div>
44
{{view progress}}
55
</div>

app/views/jst/grade_summary/outcome.handlebars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
</div>
2222
<div class="outcome-score outcome-bar-wrapper">
2323
{{view progress}}
24-
<span class="score" aria-label="Score: {{score}} out of {{points_possible}} points with mastery at {{mastery_points}}">
25-
<strong>{{#if scoreDefined}}{{score}}{{else}}-{{/if}}</strong>/{{mastery_points}}
24+
<span class="score" aria-label="Score: {{roundedScore}} out of {{points_possible}} points with mastery at {{mastery_points}}">
25+
<strong>{{#if scoreDefined}}{{roundedScore}}{{else}}-{{/if}}</strong>/{{mastery_points}}
2626
</span>
2727
<a href="#tab-outcomes/{{id}}">{{#t 'alignment_count'}}<strong>{{count}}</strong> Alignments{{/t}}</a>
2828
</div>

app/views/jst/grade_summary/outcome_detail.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{friendly_name}}
44
</div>
55
<div class="outcome-bar-wrapper">
6-
<div class="score"><strong>{{#if scoreDefined}}{{score}}{{else}}-{{/if}}</strong>/{{mastery_points}}</div>
6+
<div class="score"><strong>{{#if scoreDefined}}{{roundedScore}}{{else}}-{{/if}}</strong>/{{mastery_points}}</div>
77
{{view progress}}
88
</div>
99
<div class="description">{{{description}}}</div>

0 commit comments

Comments
 (0)