-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathedit-table-advanced.component.html
More file actions
279 lines (279 loc) · 9.48 KB
/
Copy pathedit-table-advanced.component.html
File metadata and controls
279 lines (279 loc) · 9.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<div class="data-explorer-authoring" fxLayout="column" fxLayoutGap="10px">
<div>
<mat-checkbox
color="primary"
[(ngModel)]="componentContent.isDataExplorerEnabled"
(ngModelChange)="toggleDataExplorer()"
i18n
>
Enable Data Explorer
</mat-checkbox>
</div>
<div *ngIf="componentContent.isDataExplorerEnabled" fxLayout="column" fxLayoutGap="10px">
<div fxLayout="row wrap" fxLayoutGap="40px">
<span i18n>Allowed Graph Types:</span>
<mat-checkbox
color="primary"
[(ngModel)]="isDataExplorerScatterPlotEnabled"
(ngModelChange)="dataExplorerToggleScatterPlot()"
i18n
>
Scatter Plot
</mat-checkbox>
<mat-checkbox
color="primary"
[(ngModel)]="isDataExplorerLineGraphEnabled"
(ngModelChange)="dataExplorerToggleLineGraph()"
i18n
>
Line Graph
</mat-checkbox>
<mat-checkbox
color="primary"
[(ngModel)]="isDataExplorerBarGraphEnabled"
(ngModelChange)="dataExplorerToggleBarGraph()"
i18n
>
Bar Graph
</mat-checkbox>
</div>
<div *ngIf="isDataExplorerScatterPlotEnabled">
<mat-checkbox
color="primary"
[(ngModel)]="componentContent.isDataExplorerScatterPlotRegressionLineEnabled"
(ngModelChange)="componentChanged()"
i18n
>
Show Scatter Plot Regression Line
</mat-checkbox>
</div>
<div>
<mat-form-field class="number-input">
<mat-label i18n>Number of Series</mat-label>
<input
matInput
type="number"
min="1"
[(ngModel)]="componentContent.numDataExplorerSeries"
(ngModelChange)="numDataExplorerSeriesChanged()"
/>
</mat-form-field>
</div>
<div>
<mat-form-field class="number-input">
<mat-label i18n>Number of Y Axes</mat-label>
<input
matInput
type="number"
min="1"
[(ngModel)]="componentContent.numDataExplorerYAxis"
(ngModelChange)="numDataExplorerYAxisChanged()"
/>
</mat-form-field>
</div>
<div *ngIf="componentContent.numDataExplorerYAxis > 1" fxLayout="column" fxLayoutGap="10px">
<span i18n>Choose the Y Axis for each Series</span>
<div
*ngFor="
let s of [].constructor(componentContent.numDataExplorerSeries);
index as seriesIndex
"
>
<mat-form-field>
<mat-label><span i18n>Series</span> {{ seriesIndex + 1 }}</mat-label>
<mat-select
[(ngModel)]="componentContent.dataExplorerSeriesParams[seriesIndex].yAxis"
(ngModelChange)="componentChanged()"
>
<mat-option
*ngFor="
let y of [].constructor(componentContent.numDataExplorerYAxis);
index as yAxisIndex
"
[value]="yAxisIndex"
>
<span i18n>Y Axis</span><span> {{ yAxisIndex + 1 }}</span>
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
<div>
<mat-checkbox
color="primary"
[(ngModel)]="componentContent.isDataExplorerAxisLabelsEditable"
(ngModelChange)="componentChanged()"
i18n
>
Can Student Edit Axis Labels
</mat-checkbox>
</div>
<div fxLayoutGap="20px">
<div
class="fix-data-to-table-column-label"
fxLayout="row"
fxLayoutAlign="start center"
fxLayoutGap="10px"
>
<span i18n>Fix Data to Table Column</span>
<mat-icon
matTooltip="You can author x or y data to always use a specific table column. The student will not be able to change the table column for that x or y data. If you want the student to be able to choose the table column, you can leave the select option blank for that x or y data."
matTooltipPosition="right"
i18n-matTooltip
>
help
</mat-icon>
</div>
<mat-form-field>
<mat-label i18n>X Data</mat-label>
<mat-select
[(ngModel)]="componentContent.dataExplorerDataToColumn['x']"
(ngModelChange)="componentChanged()"
>
<mat-option [value]="" i18n>(Allow student to select)</mat-option>
<mat-option
*ngFor="let columnName of columnNames; index as columnIndex"
[value]="columnIndex"
>
<ng-container *ngIf="columnName === ''">
(<span i18n>Table Column</span> {{ columnIndex + 1 }})
</ng-container>
<ng-container *ngIf="columnName !== ''">{{ columnName }}</ng-container>
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field
*ngFor="
let y of [].constructor(componentContent.numDataExplorerSeries);
index as dataExplorerSeriesIndex
"
>
<mat-label i18n
>Y Data
{{
componentContent.numDataExplorerSeries > 1 ? dataExplorerSeriesIndex + 1 : ''
}}</mat-label
>
<mat-select
[(ngModel)]="
componentContent.dataExplorerDataToColumn[
'y' + (dataExplorerSeriesIndex > 0 ? dataExplorerSeriesIndex + 1 : '')
]
"
(ngModelChange)="componentChanged()"
>
<mat-option [value]="" i18n>(Allow student to select)</mat-option>
<mat-option
*ngFor="let columnName of columnNames; index as columnIndex"
[value]="columnIndex"
>
<ng-container *ngIf="columnName === ''">
(<span i18n>Table Column</span> {{ columnIndex + 1 }})
</ng-container>
<ng-container *ngIf="columnName !== ''">{{ columnName }}</ng-container>
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxLayoutGap="10px">
<mat-form-field>
<mat-label i18n>Tooltip Header Column</mat-label>
<mat-select
[(ngModel)]="componentContent.dataExplorerTooltipHeaderColumn"
(ngModelChange)="componentChanged()"
>
<mat-option [value]="" i18n>(Default)</mat-option>
<mat-option
*ngFor="let columnName of columnNames; index as columnIndex"
[value]="columnIndex"
>
<ng-container *ngIf="columnName === ''">
(<span i18n>Table Column</span> {{ columnIndex + 1 }})
</ng-container>
<ng-container *ngIf="columnName !== ''">{{ columnName }}</ng-container>
</mat-option>
</mat-select>
</mat-form-field>
<mat-icon
matTooltip="When the student hovers their mouse over a data point on a scatter plot or line graph, the tooltip will display the value from this column along with the x and y values. This can be left blank and the tooltip will still show the x and y values like normal."
matTooltipPosition="right"
i18n-matTooltip
>
help
</mat-icon>
</div>
</div>
</div>
<div fxLayout fxLayoutAlign="start center">
<button
mat-raised-button
color="primary"
class="import-table-button"
fxLayoutAlign="center center"
>
<span i18n>Import Table</span>
<input
type="file"
accept=".csv"
class="import-table-input"
(change)="importTableFile($event)"
/>
</button>
<mat-icon
matTooltip="Only .csv (comma separated values) files are allowed"
i18n-matTooltip
tabindex="0"
aria-role="button"
>
help
</mat-icon>
<mat-progress-spinner
*ngIf="isImportingTable"
class="import-table-spinner"
mode="indeterminate"
[diameter]="20"
>
</mat-progress-spinner>
<div class="import-table-message">{{ importTableMessage }}</div>
</div>
<div *ngIf="isNotebookEnabled()">
<edit-component-add-to-notebook-button [componentContent]="componentContent">
</edit-component-add-to-notebook-button>
</div>
<edit-component-save-button [componentContent]="componentContent"> </edit-component-save-button>
<br />
<edit-component-submit-button [componentContent]="componentContent"> </edit-component-submit-button>
<div>
<mat-checkbox
color="primary"
[(ngModel)]="componentContent.enableRowSelection"
(ngModelChange)="componentChanged()"
i18n
>
Enable Row Selection
</mat-checkbox>
</div>
@if (componentContent.showSubmitButton) {
<edit-component-max-submit [componentContent]="componentContent" />
}
<edit-component-default-feedback [componentContent]="componentContent">
</edit-component-default-feedback>
<div fxLayout="column" fxLayoutAlign="start start">
<edit-component-max-score [componentContent]="componentContent"> </edit-component-max-score>
<edit-component-exclude-from-total-score [componentContent]="componentContent">
</edit-component-exclude-from-total-score>
<edit-component-width [componentContent]="componentContent" />
<edit-component-rubric [componentContent]="componentContent"> </edit-component-rubric>
<edit-component-tags [componentContent]="componentContent"> </edit-component-tags>
</div>
<edit-table-connected-components
[nodeId]="nodeId"
[componentId]="componentId"
[allowedConnectedComponentTypes]="allowedConnectedComponentTypes"
[componentContent]="componentContent"
[connectedComponents]="componentContent.connectedComponents"
(connectedComponentsChanged)="connectedComponentsChanged($event)"
>
</edit-table-connected-components>
<edit-component-constraints [componentContent]="component.content" />
<edit-component-json [component]="component"></edit-component-json>