Skip to content

Commit

Permalink
fix: Change default question settings and minor ui fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
twinkarma committed Feb 12, 2025
1 parent bb97a86 commit 60169a5
Show file tree
Hide file tree
Showing 21 changed files with 53 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<input type="hidden" name="csrfmiddlewaretoken" value="{csrf}"/>
<input type="hidden" name="consent_config" value="{consentConfigStr}"/>
<input type="hidden" name="demography_config" value="{demographyConfigStr}"/>
<input type="submit" class="btn btn-primary" value="Submit"/>
<input type="submit" class="btn btn-primary" value="Save"/>
</form>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,16 @@
</div>
{/if}

<div class="row">
<div class="col-1">
<button class="btn btn-primary" disabled={currentPage < 1} onclick={previousPage}>Previous</button>
</div>
<div class="col-1">
<div class="d-flex">
<button class="btn btn-primary me-3" disabled={currentPage < 1} onclick={previousPage}>&lt; Previous</button>

{#if currentPage < config.sections.length - 1}
<button class="btn btn-primary" onclick={nextPage}>Next</button>
<button class="btn btn-primary" onclick={nextPage}>Next &gt;</button>
{:else}
<form method="post" onsubmit={onSubmitHandler}>
<input type="hidden" name="csrfmiddlewaretoken" value="{csrf}"/>
<input type="hidden" name="value" value="{valueStr}"/>
<input type="submit" class="btn btn-primary" value="Submit"/>
<button type="submit" class="btn btn-primary">Submit <i class="bx bxs-send" ></i></button>
</form>
{/if}
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
}
</script>
<div class={{"form-label":true }}>
{config.label}
{#if config.required}<span style="color: red">*</span>{/if}
{config.label}{#if config.required}<span style="color: red">*</span>{/if}
{#if config.description || config.description.length > 0}<p class="form-text">{config.description}</p>{/if}
{#each config.options as option, index}
<div class="form-check">
<input class={{"form-check-input": true, "is-valid": isValid, "is-invalid": isInvalid}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
return {
type: "text",
label: "New Question",
description: "Question description",
description: "",
required: true,
sublabels: [], // Subquestions for likert
options: [], // Options for Checkbox, Radio, Select and Likert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
</script>

<div class="form-label">
{config.label}
{#if config.required}<span style="color: red">*</span>{/if}
{config.label}{#if config.required}<span style="color: red">*</span>{/if}
{#if config.description || config.description.length > 0}<p class="form-text">{config.description}</p>{/if}
<table class="table table-striped" style="width: 100%;">
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
</script>
<div class="form-label">
{config.label}
{#if config.required}<span style="color: red">*</span>{/if}
{config.label}{#if config.required}<span style="color: red">*</span>{/if}
{#if config.description || config.description.length > 0}<p class="form-text">{config.description}</p>{/if}

{#each config.options as option, index}
<div class="form-check">
<input class={{"form-check-input": true, "is-valid": isValid, "is-invalid": isInvalid}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</script>
<div class="col-12">
<label class="form-label" for={componentId}>{config.label}</label>
{#if config.required}<span style="color: red">*</span>{/if}
<label class="form-label" for={componentId}>{config.label}{#if config.required}<span style="color: red">*</span>{/if}</label>
{#if config.description || config.description.length > 0}<p class="form-text">{config.description}</p>{/if}
<select class={{"form-select": true,"is-valid": isValid, "is-invalid": isInvalid}}
bind:value={value}
required={config.required}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
</script>
<div class="col-12">
<label class="form-label" for={componentId}>{config.label}</label>
{#if config.required}<span style="color: red">*</span>{/if}
<label class="form-label" for={componentId}>{config.label}{#if config.required}<span style="color: red">*</span>{/if}</label>
{#if config.description || config.description.length > 0}<p class="form-text">{config.description}</p>{/if}
<input type="text"
class={{"form-control": true,"is-valid": isValid, "is-invalid": isInvalid}}
bind:value={value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
</script>
<div class="col-12">
<label class="form-label" for={componentId}>{config.label}</label>
{#if config.required}<span style="color: red">*</span>{/if}
<label class="form-label" for={componentId}>{config.label}{#if config.required}<span style="color: red">*</span>{/if}</label>
{#if config.description || config.description.length > 0}<p class="form-text">{config.description}</p>{/if}
<textarea class={{"form-control": true,"is-valid": isValid, "is-invalid": isInvalid}}
bind:value={value}
required={config.required}
Expand Down
7 changes: 3 additions & 4 deletions data/survey_config/consent_only_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
"description": "Welcome to the study",
"fields": [
{
"type": "radio",
"type": "checkbox",
"name": "consent",
"label": "Your agreement to complete the survey",
"label": "Do you agreee to complete the survey?",
"required": true,
"sublabels": [],
"options": [
"Yes, I agree to complete the survey",
"No, I do not agree"
"Yes, I agree to complete the survey"
]
}
]
Expand Down
19 changes: 12 additions & 7 deletions data/survey_config/demography_only_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
{
"type": "text",
"label": "What is your age",
"description": "Question description",
"required": true,
"sublabels": [],
"options": []
"options": [],
"enforceValueConstraints": false,
"maxNumChar": 500,
"minNumValue": 0,
"maxNumValue": 100,
"textType": "INTEGER_TEXT"
},
{
"type": "radio",
Expand All @@ -24,31 +28,32 @@
{
"type": "text",
"label": "How long have you been working in your current organisation? (Number of years)",
"description": "Question description",
"required": true,
"sublabels": [],
"options": []
"options": [],
"enforceValueConstraints": false,
"maxNumChar": 500,
"minNumValue": 0,
"maxNumValue": 100,
"textType": "INTEGER_TEXT"
},
{
"type": "radio",
"label": "What is your current Band/Grade",
"description": "Question description",
"required": true,
"sublabels": [],
"options": ["Band 5 ", "Band 6", "Band 7", "Band 8", "Band 9"]
},
{
"type": "radio",
"label": "Please indicate your highest qualification",
"description": "Question description",
"required": true,
"sublabels": [],
"options": ["Diploma", "Degree", "Masters", "PhD/Doctorate"]
},
{
"type": "radio",
"label": "What is your ethnicity?",
"description": "Question description",
"required": true,
"sublabels": [],
"options": [
Expand Down
19 changes: 5 additions & 14 deletions data/survey_config/sort_only_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
"type": "textarea",
"name": "releasing_potential_comments",
"label": "A23. If you would like to add any comments with regards to any of the statements in section above (Releasing Potential), please write below.",
"description": "Question description",
"required": true,
"required": false,
"sublabels": [],
"options": []
}
Expand All @@ -63,7 +62,6 @@
"type": "likert",
"name": "embedding_research",
"label": "Our Organisation: (0=Not yet planned; 1=Planned; 2=Early progress; 3= Substantial Progress; 4=Established)",
"description": "Question description",
"required": true,
"sublabels": [
"B1. provides protected time for clinical nurses to support research related activities",
Expand All @@ -84,8 +82,7 @@
"type": "textarea",
"name": "embedding_research_comments",
"label": "B6. If you would like to add any comments with regards to any of the statements in the section above (Embedding Research), please write below.",
"description": "Question description",
"required": true,
"required": false,
"sublabels": [],
"options": []
}
Expand All @@ -100,7 +97,6 @@
"type": "likert",
"name": "linkages_and_leadership",
"label": "Our organisation: (0=Not yet planned; 1=Planned; 2=Early progress; 3= Substantial Progress; 4=Established)",
"description": "Question description",
"required": true,
"sublabels": [
"C1. take part in research leadership and advisory activities outside our organisation (for example, sitting on ethics committees; funding committees; editorial boards and reviewing papers)",
Expand All @@ -120,8 +116,7 @@
"type": "textarea",
"name": "linkages_and_leadership_comments",
"label": "C5. If you would like to add any comments with regards to any of the statements in the section above (Linkages and Leadership), please write below.",
"description": "Question description",
"required": true,
"required": false,
"sublabels": [],
"options": []
}
Expand All @@ -136,7 +131,6 @@
"type": "likert",
"name": "inclusive_research_delivery",
"label": "Our organisation: (0=Not yet planned; 1=Planned; 2=Early progress; 3= Substantial Progress; 4=Established)",
"description": "Question description",
"required": true,
"sublabels": [
"D1. have skills to support Public and Patient Involvement and Engagement",
Expand All @@ -156,8 +150,7 @@
"type": "textarea",
"name": "inclusive_research_delivery_comments",
"label": "D5. If you would like to add any comments with regards to any of the statements in the section above (Inclusive research delivery), please write below.",
"description": "Question description",
"required": true,
"required": false,
"sublabels": [],
"options": []
}
Expand All @@ -172,7 +165,6 @@
"type": "likert",
"name": "digital_enabled_research",
"label": "Our Organisation: (0=Not yet planned; 1=Planned; 2=Early progress; 3= Substantial Progress; 4=Established",
"description": "Question description",
"required": true,
"sublabels": [
"E1. provides training for nurses to enable them to practise effectively in a digitally enabled environment",
Expand All @@ -197,8 +189,7 @@
"type": "textarea",
"name": "digital_enabled_research_comments",
"label": "E10. If you would like to add any comments with regards to any of the statements in the section above (Digital enabled research), please write below.",
"description": "Question description",
"required": true,
"required": false,
"sublabels": [],
"options": []
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Large diffs are not rendered by default.

Loading

0 comments on commit 60169a5

Please sign in to comment.