Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0+2026.02.27T21.25.37.849Z.3207a114.berickson.20260220.dami.portfolio.pr
0.1.0+2026.03.06T16.07.48.997Z.0bfff3a0.berickson.20260303.copy.paste.reducer
2 changes: 1 addition & 1 deletion modules/wo_bulk_essay_analysis/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0+2026.02.20T19.02.56.547Z.85e344b1.berickson.20260210.dashboard.updates
0.1.0+2026.03.06T16.07.48.997Z.0bfff3a0.berickson.20260303.copy.paste.reducer
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,62 @@ function fetchSelectedItemsFromOptions (value, options, type) {
}, []);
}

function createPasteBadge (children, color = 'secondary', className = 'me-1') {
return createDashComponent(
DASH_BOOTSTRAP_COMPONENTS,
'Badge',
{ children, color, className }
);
}

function createBinnedPasteEventsBadge (document) {
const lengthBins = document?.length_bins ?? {};
const smallPastes = lengthBins.short_1_20 ?? 0;
const mediumPastes = lengthBins.medium_21_200 ?? 0;
const largePastes = lengthBins.long_201_plus ?? 0;
const largeColor = largePastes > 0 ? 'warning' : 'secondary';
const mediumColor = mediumPastes > 0 ? 'warning' : 'seconday';

return createDashComponent(
DASH_HTML_COMPONENTS,
'Div',
{
children: [
createPasteBadge(`${smallPastes} small (<20)`, 'secondary'),
createPasteBadge(`${mediumPastes} medium (21-200)`,mediumColor),
createPasteBadge(`${largePastes} large (201+)`, largeColor)
],
className: 'd-inline'
}
);
}

function createPasteMetricComponent (document, metricId) {
const pasteCount = document?.pastes_with_length ?? 0;
const totalPasteChars = document?.total_paste_chars ?? 0;

switch (metricId) {
case 'paste_events':
return createPasteBadge(`${pasteCount} pastes`, pasteCount > 0 ? 'secondary' : 'light', 'me-1');
case 'paste_bins':
return createBinnedPasteEventsBadge(document);
case 'total_paste_chars':
const totalPastedColor = totalPasteChars > 500 ? 'danger' : totalPasteChars > 100 ? 'warning' : 'secondary';
return createPasteBadge(`${totalPasteChars} pasted chars`, totalPastedColor, 'me-1');
case 'paste':
return createPasteMetricComponent(document, 'paste_events');
default:
return null;
}
}

window.WOPasteMetricHelpers = {
createPasteBadge,
createBinnedPasteEventsBadge,
createPasteMetricComponent
};


function createProcessTags (document, metrics) {
const children = metrics.map(metric => {
switch (metric.id) {
Expand All @@ -32,10 +88,22 @@ function createProcessTags (document, metrics) {
DASH_BOOTSTRAP_COMPONENTS, 'Badge',
{ children: document[metric.id], color }
);
case 'paste_events':
case 'paste_bins':
case 'total_paste_chars':
case 'paste':
return window.WOPasteMetricHelpers.createPasteMetricComponent(document, metric.id);
case 'copy':
const copyCount = document?.copy_count ?? 0;
const copyColor = copyCount > 0 ? 'primary' : 'secondary'
return createDashComponent(
DASH_BOOTSTRAP_COMPONENTS, 'Badge',
{ children: `${copyCount} copies`, color: copyColor }
);
default:
break;
}
});
}).filter(Boolean);
return createDashComponent(DASH_HTML_COMPONENTS, 'Div', { children, className: 'sticky-top' });
}

Expand Down Expand Up @@ -214,7 +282,7 @@ const fileTextExtractors = {
docx: extractDOCX
};

const AIAssistantLoadingQueries = ['gpt_bulk', 'time_on_task', 'activity'];
const AIAssistantLoadingQueries = ['gpt_bulk', 'time_on_task', 'activity', 'paste_metrics', 'copy_cut_metrics'];

// ── Walkthrough step definitions ──────────────────────────────────────
const BULK_WALKTHROUGH_STEPS = [
Expand Down Expand Up @@ -633,7 +701,7 @@ window.dash_clientside.bulk_essay_feedback = {
const message = {
wo: {
execution_dag: 'writing_observer',
target_exports: ['gpt_bulk', 'document_list', 'document_sources', 'time_on_task', 'activity'],
target_exports: ['gpt_bulk', 'document_list', 'document_sources', 'time_on_task', 'activity', 'paste_metrics', 'copy_cut_metrics'],
kwargs: decoded
}
};
Expand Down
2 changes: 1 addition & 1 deletion modules/wo_classroom_text_highlighter/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0+2026.02.20T19.02.56.547Z.85e344b1.berickson.20260210.dashboard.updates
0.1.0+2026.03.06T16.07.48.997Z.0bfff3a0.berickson.20260303.copy.paste.reducer
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,25 @@ function createProcessTags (document, metrics) {
const color = document[metric.id] === 'active' ? 'success' : 'warning';
return createDashComponent(
DASH_BOOTSTRAP_COMPONENTS, 'Badge',
{ children: document[metric.id], color }
{ children: document[metric.id], color, className: 'me-1' }
);
case 'paste_events':
case 'paste_bins':
case 'total_paste_chars':
case 'paste':
if (!window.WOPasteMetricHelpers?.createPasteMetricComponent) { return null; }
return window.WOPasteMetricHelpers.createPasteMetricComponent(document, metric.id);
case 'copy':
const copyCount = document?.copy_count ?? 0;
const copyColor = copyCount > 0 ? 'primary' : 'secondary'
return createDashComponent(
DASH_BOOTSTRAP_COMPONENTS, 'Badge',
{ children: `${copyCount} copies`, color: copyColor }
);
default:
break;
}
});
}).filter(Boolean);
return createDashComponent(DASH_HTML_COMPONENTS, 'Div', { children, className: 'sticky-top' });
}

Expand All @@ -140,7 +153,7 @@ function studentHasResponded (student, appliedHash) {
return true;
}

const ClassroomTextHighlightLoadingQueries = ['docs_with_nlp_annotations', 'time_on_task', 'activity'];
const ClassroomTextHighlightLoadingQueries = ['docs_with_nlp_annotations', 'time_on_task', 'activity', 'paste_metrics', 'copy_cut_metrics'];

// ── Walkthrough step definitions ──────────────────────────────────────
const WALKTHROUGH_STEPS = [
Expand Down Expand Up @@ -369,7 +382,7 @@ window.dash_clientside.wo_classroom_text_highlighter = {
const outgoingMessage = {
wo_classroom_text_highlighter_query: {
execution_dag: 'writing_observer',
target_exports: ['docs_with_nlp_annotations', 'document_sources', 'document_list', 'time_on_task', 'activity'],
target_exports: ['docs_with_nlp_annotations', 'document_sources', 'document_list', 'time_on_task', 'activity', 'paste_metrics', 'copy_cut_metrics'],
kwargs: decodedParams
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
PROCESS_OPTIONS = [
{'id': 'process_information', 'label': 'Process Information', 'parent': ''},
{'id': 'time_on_task', 'label': 'Time on Task', 'types': ['metric'], 'parent': 'process_information'},
{'id': 'status', 'label': 'Status', 'types': ['metric'], 'parent': 'process_information'}
{'id': 'status', 'label': 'Status', 'types': ['metric'], 'parent': 'process_information'},
{'id': 'paste_events', 'label': '# Paste Events', 'types': ['metric'], 'parent': 'process_information'},
{'id': 'paste_bins', 'label': 'Binned Paste Events', 'types': ['metric'], 'parent': 'process_information'},
{'id': 'total_paste_chars', 'label': 'Total Characters Pasted', 'types': ['metric'], 'parent': 'process_information'},
{'id': 'copy', 'label': 'Copy', 'types': ['metric'], 'parent': 'process_information'}
]
OPTIONS = PROCESS_OPTIONS + [
{'id': indicator['id'], 'types': ['highlight'], 'label': indicator['name'], 'parent': indicator['category']}
Expand All @@ -16,7 +20,11 @@

DEFAULT_VALUE = {
'time_on_task': {'metric': {'value': True}},
'status': {'metric': {'value': True}}
'status': {'metric': {'value': True}},
'paste_events': {'metric': {'value': True}},
'paste_bins': {'metric': {'value': True}},
'total_paste_chars': {'metric': {'value': True}},
'copy': {'metric': {'value': True}}
}

# Set of colors to use for highlighting with presets
Expand Down
2 changes: 1 addition & 1 deletion modules/writing_observer/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0+2026.02.27T13.40.48.021Z.a86fc6ac.berickson.20260220.dami.portfolio.pr
0.1.0+2026.03.06T16.07.48.997Z.0bfff3a0.berickson.20260303.copy.paste.reducer
Loading
Loading