Skip to content

Commit a2f79ae

Browse files
Simplified sortByTextField function.
Used javascript's built-in String.localeCompare function. #2943
1 parent 5be698d commit a2f79ae

2 files changed

Lines changed: 34 additions & 30 deletions

File tree

src/main/webapp/site/src/app/services/labelService.spec.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -455,15 +455,7 @@ function getCanvasTextObjects(canvas: any): any[] {
455455
}
456456

457457
function sortByTextField(a: any, b: any): number {
458-
const aText: string = a.text;
459-
const bText: string = b.text;
460-
if (aText > bText) {
461-
return 1;
462-
} else if (aText < bText) {
463-
return -1;
464-
} else {
465-
return 0;
466-
}
458+
return a.text.localeCompare(b.text);
467459
}
468460

469461
function createLabelServiceFunction() {

src/main/webapp/site/src/messages.xlf

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8196,6 +8196,39 @@
81968196
<context context-type="linenumber">213</context>
81978197
</context-group>
81988198
</trans-unit>
8199+
<trans-unit datatype="html" id="f80d8048e1a73a4f0c35681cc5f8a250754eaf4b">
8200+
<source> You have used <x equiv-text="{{componentState.studentData.submitCounter}}" id="INTERPOLATION"/> of <x equiv-text="{{componentContent.maxSubmitCount}}" id="INTERPOLATION_1"/> attempt(s) </source>
8201+
<context-group purpose="location">
8202+
<context context-type="sourcefile">../../wise5/components/match/match-grading/match-grading.component.html</context>
8203+
<context context-type="linenumber">103</context>
8204+
</context-group>
8205+
<context-group purpose="location">
8206+
<context context-type="sourcefile">../../wise5/components/multipleChoice/multiple-choice-grading/multiple-choice-grading.component.html</context>
8207+
<context context-type="linenumber">38</context>
8208+
</context-group>
8209+
</trans-unit>
8210+
<trans-unit datatype="html" id="00a48b9fab48a5ccc0ebf0a2793495ee1cc9f968">
8211+
<source> Correct </source>
8212+
<context-group purpose="location">
8213+
<context context-type="sourcefile">../../wise5/components/match/match-grading/match-grading.component.html</context>
8214+
<context context-type="linenumber">108</context>
8215+
</context-group>
8216+
<context-group purpose="location">
8217+
<context context-type="sourcefile">../../wise5/components/multipleChoice/multiple-choice-grading/multiple-choice-grading.component.html</context>
8218+
<context context-type="linenumber">43</context>
8219+
</context-group>
8220+
</trans-unit>
8221+
<trans-unit datatype="html" id="49a3371af0eb58f02e541105eb395340048527ec">
8222+
<source> Incorrect </source>
8223+
<context-group purpose="location">
8224+
<context context-type="sourcefile">../../wise5/components/match/match-grading/match-grading.component.html</context>
8225+
<context context-type="linenumber">113</context>
8226+
</context-group>
8227+
<context-group purpose="location">
8228+
<context context-type="sourcefile">../../wise5/components/multipleChoice/multiple-choice-grading/multiple-choice-grading.component.html</context>
8229+
<context context-type="linenumber">48</context>
8230+
</context-group>
8231+
</trans-unit>
81998232
<trans-unit datatype="html" id="e9f75e02d7db72cd425f81c273a721c62a617dc4">
82008233
<source>~ Report Available ~</source>
82018234
<context-group purpose="location">
@@ -8259,27 +8292,6 @@
82598292
<context context-type="linenumber">90</context>
82608293
</context-group>
82618294
</trans-unit>
8262-
<trans-unit datatype="html" id="f80d8048e1a73a4f0c35681cc5f8a250754eaf4b">
8263-
<source> You have used <x equiv-text="{{componentState.studentData.submitCounter}}" id="INTERPOLATION"/> of <x equiv-text="{{componentContent.maxSubmitCount}}" id="INTERPOLATION_1"/> attempt(s) </source>
8264-
<context-group purpose="location">
8265-
<context context-type="sourcefile">../../wise5/components/multipleChoice/multiple-choice-grading/multiple-choice-grading.component.html</context>
8266-
<context context-type="linenumber">38</context>
8267-
</context-group>
8268-
</trans-unit>
8269-
<trans-unit datatype="html" id="00a48b9fab48a5ccc0ebf0a2793495ee1cc9f968">
8270-
<source> Correct </source>
8271-
<context-group purpose="location">
8272-
<context context-type="sourcefile">../../wise5/components/multipleChoice/multiple-choice-grading/multiple-choice-grading.component.html</context>
8273-
<context context-type="linenumber">43</context>
8274-
</context-group>
8275-
</trans-unit>
8276-
<trans-unit datatype="html" id="49a3371af0eb58f02e541105eb395340048527ec">
8277-
<source> Incorrect </source>
8278-
<context-group purpose="location">
8279-
<context context-type="sourcefile">../../wise5/components/multipleChoice/multiple-choice-grading/multiple-choice-grading.component.html</context>
8280-
<context context-type="linenumber">48</context>
8281-
</context-group>
8282-
</trans-unit>
82838295
<trans-unit datatype="html" id="6817513ddcee06a7cb2a7b2708e5616b861db81c">
82848296
<source><x equiv-text="{{nodeCompletion}}" id="INTERPOLATION"/>% completed (All periods)</source>
82858297
<context-group purpose="location">

0 commit comments

Comments
 (0)