Skip to content

Commit

Permalink
Merge branch 'develop' into bugfix/modelling/modelling-overlapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Anishyou authored Jan 16, 2025
2 parents 7009803 + 247e7fb commit 6708f62
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,13 @@ export class TextSubmissionAssessmentComponent extends TextAssessmentBaseCompone
// ("squish" the existing text block)
existingBlockRef.block!.startIndex = end;
newTextBlockRefs.push(existingBlockRef);
} else if (exEnd == end) {
// existing: |-----|
// to add: |----------|
// -> |-add--|ex-|
// ("squish" the new text block)
refToAdd.block!.endIndex = exStart;
newTextBlockRefs.push(existingBlockRef);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,28 @@ describe('TextSubmissionAssessmentComponent', () => {
[10, 15],
],
},
// Two blocks, same end index
{
input: [
[377, 719],
[453, 719],
],
output: [
[377, 453],
[453, 719],
],
},
// Two blocks, same end index, wrong order
{
input: [
[453, 719],
[377, 719],
],
output: [
[377, 453],
[453, 719],
],
},
// Two blocks, shifted
{
input: [
Expand Down

0 comments on commit 6708f62

Please sign in to comment.