1- < component-header [component] ="component "> </ component-header >
1+ < component-header [component] ="component " / >
22< div class ="match " fxLayout ="row wrap " cdkDropListGroup >
33 < div
44 fxFlex ="100 "
1212 >
1313 < div class ="bucket-title " fxLayout ="row wrap " fxLayoutAlign ="start center " fxLayoutGap ="8px ">
1414 < h3 class ="mat-subtitle-2 " [innerHTML] ="buckets[0].value "> </ h3 >
15- < div *ngIf =" componentContent.canCreateChoices " >
15+ @if ( componentContent.canCreateChoices) {
1616 < add-choice-button [isDisabled] ="isDisabled " (onClick) ="addChoice() " />
17- </ div >
17+ }
1818 </ div >
1919 < ul
2020 class ="items "
@@ -24,65 +24,13 @@ <h3 class="mat-subtitle-2" [innerHTML]="buckets[0].value"></h3>
2424 [cdkDropListData] ="{ isSourceBucket: true, items: buckets[0].items } "
2525 (cdkDropListDropped) ="drop($event) "
2626 >
27- < li
28- class ="item "
29- [ngClass] ="{ disabled: isDisabled } "
30- cdkDrag
31- [cdkDragDisabled] ="isDisabled "
32- (cdkDragEntered) ="dragEnter($event) "
33- (cdkDragExited) ="dragExit($event) "
34- *ngFor ="let item of buckets[0].items; let position = index "
35- [cdkDragData] ="{ position: position, item: item } "
36- >
37- < match-choice-item
38- [buckets] ="buckets "
39- [item] ="item "
40- [hasCorrectAnswer] ="hasCorrectAnswer "
41- [isDisabled] ="isDisabled "
42- (onStudentDataChanged) ="studentDataChanged() "
43- />
44- </ li >
45- </ ul >
46- </ div >
47- </ div >
48- < div
49- fxLayout ="column "
50- fxLayout.gt-xs ="{{ componentContent.horizontal ? 'column' : 'row wrap' }} "
51- fxLayoutAlign ="start stretch "
52- fxFlex ="100 "
53- fxFlex.gt-xs ="{{ componentContent.horizontal ? 50 : 100 }} "
54- fxFlexOrder ="{{ componentContent.choicesAfter ? 1 : 2 }} "
55- >
56- < div
57- *ngFor ="let bucket of buckets.slice(1) "
58- fxLayout ="column "
59- fxFlex ="100 "
60- fxFlex.gt-xs ="{{ componentContent.horizontal ? 100 : 50 }} "
61- fxFlex.gt-md ="{{ componentContent.horizontal ? 100 : 33.33 }} "
62- >
63- < div class ="bucket target notice-bg-bg " fxLayout ="column " fxLayoutAlign ="stretch ">
64- < div
65- class ="bucket-title "
66- fxLayout ="row wrap "
67- fxLayoutAlign ="start center "
68- fxLayoutGap ="8px "
69- >
70- < h3 class ="mat-subtitle-2 " [innerHTML] ="bucket.value "> </ h3 >
71- </ div >
72- < ul
73- class ="items "
74- cdkDropList
75- [cdkDropListData] ="{ isSourceBucket: false, items: bucket.items } "
76- (cdkDropListDropped) ="drop($event) "
77- >
27+ @for (item of buckets[0].items; track item.id; let position = $index) {
7828 < li
79- class ="item "
80- [ngClass] ="{ disabled: isDisabled } "
29+ [ngClass] ="{ item: true, disabled: isDisabled } "
8130 cdkDrag
8231 [cdkDragDisabled] ="isDisabled "
8332 (cdkDragEntered) ="dragEnter($event) "
8433 (cdkDragExited) ="dragExit($event) "
85- *ngFor ="let item of bucket.items; let position = index "
8634 [cdkDragData] ="{ position: position, item: item } "
8735 >
8836 < match-choice-item
@@ -93,10 +41,63 @@ <h3 class="mat-subtitle-2" [innerHTML]="bucket.value"></h3>
9341 (onStudentDataChanged) ="studentDataChanged() "
9442 />
9543 </ li >
96- </ ul >
97- </ div >
44+ }
45+ </ ul >
9846 </ div >
9947 </ div >
48+ < div
49+ fxLayout ="column "
50+ fxLayout.gt-xs ="{{ componentContent.horizontal ? 'column' : 'row wrap' }} "
51+ fxLayoutAlign ="start stretch "
52+ fxFlex ="100 "
53+ fxFlex.gt-xs ="{{ componentContent.horizontal ? 50 : 100 }} "
54+ fxFlexOrder ="{{ componentContent.choicesAfter ? 1 : 2 }} "
55+ >
56+ @for (bucket of buckets.slice(1); track bucket.id) {
57+ < div
58+ fxLayout ="column "
59+ fxFlex ="100 "
60+ fxFlex.gt-xs ="{{ componentContent.horizontal ? 100 : 50 }} "
61+ fxFlex.gt-md ="{{ componentContent.horizontal ? 100 : 33.33 }} "
62+ >
63+ < div class ="bucket target notice-bg-bg " fxLayout ="column " fxLayoutAlign ="stretch ">
64+ < div
65+ class ="bucket-title "
66+ fxLayout ="row wrap "
67+ fxLayoutAlign ="start center "
68+ fxLayoutGap ="8px "
69+ >
70+ < h3 class ="mat-subtitle-2 " [innerHTML] ="bucket.value "> </ h3 >
71+ </ div >
72+ < ul
73+ class ="items "
74+ cdkDropList
75+ [cdkDropListData] ="{ isSourceBucket: false, items: bucket.items } "
76+ (cdkDropListDropped) ="drop($event) "
77+ >
78+ @for (item of bucket.items; track item.id; let position = $index) {
79+ < li
80+ [ngClass] ="{ item: true, disabled: isDisabled } "
81+ cdkDrag
82+ [cdkDragDisabled] ="isDisabled "
83+ (cdkDragEntered) ="dragEnter($event) "
84+ (cdkDragExited) ="dragExit($event) "
85+ [cdkDragData] ="{ position: position, item: item } "
86+ >
87+ < match-choice-item
88+ [buckets] ="buckets "
89+ [item] ="item "
90+ [hasCorrectAnswer] ="hasCorrectAnswer "
91+ [isDisabled] ="isDisabled "
92+ (onStudentDataChanged) ="studentDataChanged() "
93+ />
94+ </ li >
95+ }
96+ </ ul >
97+ </ div >
98+ </ div >
99+ }
100+ </ div >
100101</ div >
101102< match-feedback-section
102103 [componentContent] ="componentContent "
@@ -105,24 +106,24 @@ <h3 class="mat-subtitle-2" [innerHTML]="bucket.value"></h3>
105106 [isLatestComponentStateSubmit] ="isLatestComponentStateSubmit "
106107 [submitCounter] ="submitCounter "
107108/>
108- < component-save-submit-buttons
109- *ngIf =" isSaveOrSubmitButtonVisible "
110- [componentState] ="latestComponentState "
111- [isDirty] ="isDirty "
112- [isDisabled] ="isDisabled "
113- [isSaveButtonVisible] ="isSaveButtonVisible "
114- [isSubmitButtonDisabled] ="isSubmitButtonDisabled "
115- [isSubmitButtonVisible] ="isSubmitButtonVisible "
116- [isSubmitDirty] ="isSubmitDirty "
117- (saveButtonClicked) ="saveButtonClicked($event) "
118- (submitButtonClicked) ="submitButtonClicked($event) "
119- >
120- </ component-save-submit-buttons >
121- < component-annotations
122- *ngIf =" mode === 'student' "
123- [annotations] ="latestAnnotations "
124- [maxScore] ="componentContent.maxScore "
125- [nodeId] ="nodeId "
126- [componentId] ="componentId "
127- >
128- </ component-annotations >
109+ @if (isSaveOrSubmitButtonVisible) {
110+ < component-save-submit-buttons
111+ [componentState] ="latestComponentState "
112+ [isDirty] ="isDirty "
113+ [isDisabled] ="isDisabled "
114+ [isSaveButtonVisible] ="isSaveButtonVisible "
115+ [isSubmitButtonDisabled] ="isSubmitButtonDisabled "
116+ [isSubmitButtonVisible] ="isSubmitButtonVisible "
117+ [isSubmitDirty] ="isSubmitDirty "
118+ (saveButtonClicked) ="saveButtonClicked($event) "
119+ (submitButtonClicked) ="submitButtonClicked($event) "
120+ / >
121+ }
122+ @if (mode === 'student') {
123+ < component-annotations
124+ [annotations] ="latestAnnotations "
125+ [maxScore] ="componentContent.maxScore "
126+ [nodeId] ="nodeId "
127+ [componentId] ="componentId "
128+ / >
129+ }
0 commit comments