Skip to content

Commit 8e9f944

Browse files
Merge pull request #338 from RSE-Sheffield/feat/report-summary-text
Add boilerplate text to describe the readiness score
2 parents 0d22c35 + a97df16 commit 8e9f944

File tree

6 files changed

+92
-21
lines changed

6 files changed

+92
-21
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[
2+
[
3+
"there is no consideration of talent development activities, with little awareness of the need to spot talent, provide training, or create an enabling environment for research careers.",
4+
"planning is underway to develop talent-spotting and training initiatives, with growing awareness of the need to support research careers and create an enabling environment.",
5+
"talent development activities including training and research skill building are beginning to occur in small pockets of the organization.",
6+
"talent development, training programs, and research career support are expanding throughout the organization beyond isolated areas.",
7+
"comprehensive talent development and research career support systems are fully embedded across the organization with continuous monitoring and improvement processes in place."
8+
],
9+
[
10+
"the organization has not considered reducing barriers to research activities and shows little awareness of the need to provide time, resources, or legitimacy for research work.",
11+
"plans are being developed to reduce research barriers and provide necessary resources, with early evidence of activities based on these plans.",
12+
"efforts to provide research time and resources while legitimizing research activities are emerging in small areas of the organization.",
13+
"research support through dedicated time and resources is widely adopted across the organization, with growing recognition of research impact and contributions.",
14+
"research activities are fully embedded with established resource allocation, widespread recognition of research contributions, and systematic review processes for continuous improvement."
15+
],
16+
[
17+
"there is no consideration of forming external research partnerships or developing midwifery research leadership to influence broader research agendas.",
18+
"planning is underway to establish external research links and develop leadership capacity, with some early activities beginning to emerge.",
19+
"research partnerships and leadership development activities are starting to form in small pockets of the organization.",
20+
"external research linkages and leadership initiatives are expanding significantly and becoming widely adopted throughout the organization.",
21+
"strong research partnerships and leadership programs are fully established across the organization with ongoing monitoring and continuous improvement mechanisms."
22+
],
23+
[
24+
"the organization has not considered involving patients and the public in research or engaging the wider workforce in research delivery activities.",
25+
"plans are being developed to support public involvement in research and engage more staff in research delivery, with early implementation beginning.",
26+
"patient and public involvement initiatives along with workforce engagement in research delivery are emerging in small areas of the organization.",
27+
"inclusive research practices involving patients, public, and the wider workforce are expanding and becoming widely adopted across the organization.",
28+
"comprehensive inclusive research delivery systems are embedded throughout the organization with established monitoring and improvement processes."
29+
],
30+
[
31+
"there is no consideration of developing digital research capabilities or data science skills for research and service development purposes.",
32+
"planning is underway to build digital research leadership and data science skills, with early evidence of training and development activities.",
33+
"digital research capabilities and data science skill development are beginning to emerge in small pockets of the organization.",
34+
"digital research leadership and data science capabilities are expanding significantly and being widely adopted across the organization.",
35+
"advanced digital research capabilities and data science expertise are fully embedded throughout the organization with continuous monitoring and improvement systems."
36+
]
37+
]

survey/templates/survey/report.html

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
{% block content %}
66
<div class="container">
77
<h1><i class='bx bxs-report'></i> Report: {{ survey.name }}</h1>
8-
98
<p>{{ survey.description }}</p>
109

11-
1210
<div class="mb-3">
13-
1411
<h2>Summary Ranking Matrix</h2>
1512
<div class="sort-response-summary-matrix"
1613
data-json-config-id="configData"
@@ -23,21 +20,20 @@ <h3>Report sections</h3>
2320
<li><a href="#page-section-{{ forloop.counter0 }}">{{ section.section_config.title }}</a></li>
2421
{% endif %}
2522
{% endfor %}
26-
2723
</ul>
2824

29-
3025
{% for section in sections %}
3126
{% if section.section_config.type != "consent" %}
3227
<div class="page-break"></div>
3328
<div>
34-
<h2 id="page-section-{{ forloop.counter0 }}">{{ section.section_config.title }}</h2>
29+
<h2 id="page-section-{{ forloop.counter0 }}">Section {{ section.section_config.title }}</h2>
3530
</div>
3631
<div>
3732
<div
3833
class="sort-response-section-viewer"
3934
data-json-config-id="configData"
4035
data-json-responses-id="responsesData"
36+
data-json-readiness-descriptions-id="readinessDescriptions"
4137
data-section-index="{{ forloop.counter0 }}"
4238
></div>
4339

@@ -46,8 +42,6 @@ <h3>Evidence statement</h3>
4642
<div class="sort-richtext-field"
4743
data-update-url="{% url 'survey_evidence_gathering_update' survey.id forloop.counter0 %}"
4844
data-init-contents="{{ section.evidence.text }}" data-view-only="true"></div>
49-
{# <h5>Evidence files</h5>#}
50-
{# <div class="sort-file-browser" data-json-id="filesListData"></div>#}
5145
{% endif %}
5246

5347
{% if section.improvement %}
@@ -73,6 +67,7 @@ <h3>Improvement plan</h3>
7367
{{ files_list | json_script:"filesListData" }}
7468
{{ survey.survey_config | json_script:"configData" }}
7569
{{ responses | json_script:"responsesData" }}
70+
{{ readiness_descriptions | json_script:"readinessDescriptions" }}
7671
{% vite_client %}
7772
{% vite_asset "src/main.ts" %}
7873

survey/views.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,11 @@ def get(self, request: HttpRequest, pk: int):
458458
# "fileUrl": file_url
459459
# })
460460

461+
462+
# Response descriptions
463+
with open("data/readiness_descriptions/matrix.json") as file:
464+
readiness_descriptions: list[list[str]] = list(json.load(file))
465+
461466
context = {
462467
"survey": survey,
463468
"responses": [
@@ -467,6 +472,7 @@ def get(self, request: HttpRequest, pk: int):
467472
"sections": sections,
468473
"csrf": str(csrf(self.request)["csrf_token"]),
469474
# "files_list": files_list,
475+
"readiness_descriptions": readiness_descriptions,
470476
}
471477

472478
return render(request, "survey/report.html", context)

ui_components/src/lib/components/SortLikertStats.svelte

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
config: SurveyConfig;
1717
surveyStats: SurveyStats;
1818
sectionIndex: number,
19-
fieldIndex: number
19+
fieldIndex: number,
20+
readinessDescriptions: string[],
2021
}
21-
let {config, surveyStats, sectionIndex, fieldIndex}: Props = $props();
22+
let {config, surveyStats, sectionIndex, fieldIndex, readinessDescriptions}: Props = $props();
2223
2324
let sectionConfig = $derived(config.sections[sectionIndex]);
2425
let fieldConfig = $derived(config.sections[sectionIndex].fields[fieldIndex]);
@@ -38,26 +39,50 @@
3839
strongestList.map(qm => {
3940
output.push(fieldConfig.sublabels[qm.index]);
4041
})
41-
return output.join(", ");
42+
return output;
4243
})
4344
let weakestAreas: string = $derived.by(()=>{
4445
const weakestList = questionMeanSorted.slice(0,2);
4546
const output: string[] = [];
4647
weakestList.map(qm => {
4748
output.push(fieldConfig.sublabels[qm.index]);
4849
})
49-
return output.join(", ");
50+
return output;
5051
})
52+
const sectionMeanReadiness: number = surveyStats.sections[sectionIndex].fields[fieldIndex].mean;
53+
const sectionMeanReadinessInt: bigint = parseInt(sectionMeanReadiness);
54+
const readinessDescription: string = readinessDescriptions[sectionMeanReadinessInt-1];
5155
5256
</script>
57+
<h3>Summary <span class="badge badge-secondary bg-secondary">{sectionMeanReadiness.toFixed(0)}</span></h3>
5358
<p>
5459
Section {sectionConfig.title} demonstrates an overall score <strong>
55-
of {formatNumber(surveyStats.sections[sectionIndex].fields[fieldIndex].mean)} out of
60+
of {sectionMeanReadiness.toFixed(2)} out of
5661
{getHighestHistogramValue(surveyStats.sections[sectionIndex].fields[fieldIndex].histograms[0])}</strong> indicating maturity
5762
ranking of <strong>{getSortMaturityLabel(surveyStats.sections[sectionIndex].fields[fieldIndex].mean)}</strong>.
58-
Areas of strength are demonstrated in questions <strong>{strongestAreas}</strong>.
59-
Areas of improvements are identified in questions <strong>{weakestAreas}</strong>.
63+
The responses suggest that {readinessDescription}
6064
</p>
65+
<div class="progress">
66+
<div class="progress-bar bg-secondary" role="progressbar" style="width: {0.2*sectionMeanReadiness*100}%" aria-valuenow="{sectionMeanReadiness}" aria-valuemin="0" aria-valuemax="4">
67+
{sectionMeanReadiness.toFixed(1)} / 5
68+
</div>
69+
</div>
70+
<h4>Areas of strength</h4>
71+
<p>Areas of strength are demonstrated in the following questions:</p>
72+
<ul>
73+
{#each strongestAreas as strongArea }
74+
<li>{strongArea}</li>
75+
{/each}
76+
</ul>
77+
<h4>Areas for improvement</h4>
78+
<p>
79+
Areas of improvements are identified in the following questions:
80+
</p>
81+
<ul>
82+
{#each weakestAreas as weakArea }
83+
<li>{weakArea}</li>
84+
{/each}
85+
</ul>
6186
<LikertHistogram fieldConfig={fieldConfig}
6287
fieldStats={surveyStats.sections[sectionIndex].fields[fieldIndex]}></LikertHistogram>
6388
<table class="table table-bordered mt-4">

ui_components/src/lib/components/SurveySectionDataView.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
interface Props {
1212
config: SurveyConfig,
1313
surveyStats: SurveyStats | null,
14-
sectionIndex: number
14+
sectionIndex: number,
15+
readinessDescriptions: string[],
1516
}
1617
17-
let {config, surveyStats, sectionIndex = 0}: Props = $props();
18+
let {config, surveyStats, sectionIndex = 0, readinessDescriptions}: Props = $props();
1819
let sectionConfig = $derived(config.sections[sectionIndex]);
1920
2021
</script>
@@ -29,7 +30,8 @@
2930
config={config}
3031
surveyStats={surveyStats}
3132
sectionIndex={sectionIndex}
32-
fieldIndex={fi}>
33+
fieldIndex={fi}
34+
readinessDescriptions={readinessDescriptions}>
3335
</SortLikertStats>
3436
</div>
3537

ui_components/src/main.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,24 @@ mapMatchedElement(".sort-response-viewer", (elem) => {
107107
});
108108

109109
mapMatchedElement(".sort-response-section-viewer", (elem) => {
110-
const sectionIndex = elem.dataset.sectionIndex;
110+
const sectionIndex = Number(elem.dataset.sectionIndex);
111111
const configId = elem.dataset.jsonConfigId;
112112
const responsesId = elem.dataset.jsonResponsesId;
113+
// Get readiness-level descriptions for all sections
114+
const readinessDescriptionsId = elem.dataset.jsonReadinessDescriptionsId;
115+
const readinessDescriptionsAllSections = getDataInElem(readinessDescriptionsId, []);
116+
// Readiness descriptions for just this section (levels 0 to 4)
117+
const readinessDescriptions = readinessDescriptionsAllSections[sectionIndex-1];
113118
const config = getDataInElem(configId, {}) as SurveyConfig;
114119
const responses: SurveyResponseBatch = getDataInElem(responsesId, []) as [];
115-
const surveyStats = generateStatsFromSurveyResponses(config, responses)
120+
const surveyStats = generateStatsFromSurveyResponses(config, responses);
116121
mount(SurveySectionDataView, {
117122
target: elem,
118123
props: {
119124
config: config,
120125
surveyStats: surveyStats,
121-
sectionIndex: Number(sectionIndex)
126+
sectionIndex: sectionIndex,
127+
readinessDescriptions: readinessDescriptions,
122128
}
123129
});
124130
});

0 commit comments

Comments
 (0)