Skip to content

Commit

Permalink
div improvements after feedback
Browse files Browse the repository at this point in the history
- change sorting
- change order
- skip question when "none" is selected
  • Loading branch information
ewangler committed Dec 15, 2024
1 parent d2cc869 commit 3178e69
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 41 deletions.
7 changes: 4 additions & 3 deletions src/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"title": "Neues Projekt",
"evaluation": {
"title": "Resultat",
"restart": "Antworten bearbeiten"
"restart": "Antworten bearbeiten",
"reset": "Antworten löschen"
},
"tools": {
"app": "App",
Expand All @@ -55,7 +56,7 @@
}
},
"simultan": {
"text": "Müssen mehrere Personen gleichzeitig mit dem Tool etwas erarbeiten/verändern können?",
"text": "Müssen mehrere Personen gleichzeitig mit dem Tool etwas erarbeiten/verändern können (Kollaboration)?",
"responses": {
"no": "Nein",
"yes": "Ja"
Expand Down Expand Up @@ -117,7 +118,7 @@
}
},
"modification": {
"text": "Wie viel Vorwissen braucht es für das Anpassen der Inhalte?",
"text": "Wie viel technisches Vorwissen braucht es für das Anpassen der Inhalte?",
"responses": {
"much": "Viel",
"medium": "Mittel",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/DigitalisationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function DigitalisationPage() {
<p>{t('digitalisation_page.introduction')}</p>
<Infobox>
{t('digitalisation_page.new_project')}{' '}
<Link to="/digitalisation/new-project">{t('digitalisation_page.title')}</Link>
<Link to="/digitalisation/new-project">{t('new_project_guidelines_page.title')}</Link>
</Infobox>
<h2>{t('digitalisation_page.content')}</h2>
<ul>
Expand Down
9 changes: 8 additions & 1 deletion src/pages/digitalisation/NewDigitalisationProjectPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ export default function NewDigitalisationProjectPage() {
setCurrentQuestion(0)
}

function reset() {
setShowScore(false)
setCurrentQuestion(0)
setReplies(defaultReplies)
}

const questionsRoot: Root = questionJson
const questions: Question[] = questionsRoot.questions

Expand Down Expand Up @@ -200,7 +206,7 @@ export default function NewDigitalisationProjectPage() {
})

return <div className='result-section'>
{score.sort((a, b) => b.score - a.score).map((a) => {
{score.sort((a, b) => (b.score - a.score) || (a.warnings.length - b.warnings.length)).map((a) => {
let warnings = a.warnings
return <div>
<h3>{t(`new_project_digitalisation_page.tools.${a.key}`)} (Score: {a.score})</h3>
Expand Down Expand Up @@ -230,6 +236,7 @@ export default function NewDigitalisationProjectPage() {
{showScore ? <div className='score-section'>
<h2>{t("new_project_digitalisation_page.evaluation.title")}</h2>
<Button type="button" onClick={() => restart()}>{t('new_project_digitalisation_page.evaluation.restart')}</Button>
<Button type="button" onClick={() => reset()}>{t('new_project_digitalisation_page.evaluation.reset')}</Button>
{calculateResult()}
</div> :
<div className='question-section'>
Expand Down
73 changes: 37 additions & 36 deletions src/questions.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
"responses": [
{
"key": "none",
"next_question": 6,
"tools": [
"app",
"game",
Expand Down Expand Up @@ -424,103 +425,103 @@
},
{
"index": 9,
"key": "modification",
"key": "moderation",
"responses": [
{
"key": "much",
"key": "often",
"tools": [
"app",
"game",
"youtube",
"e_learning",
"website",
"podcast",
"office",
"pdf",
"pm_tool",
"collaboration"
],
"kills": []
},
{
"key": "medium",
"key": "little",
"tools": [
"youtube",
"website",
"podcast",
"office",
"pdf",
"pm_tool"
"app",
"office"
],
"kills": [
"app",
"game",
"youtube",
"e_learning",
"podcast",
"pm_tool",
"collaboration"
]
},
{
"key": "little",
"key": "none",
"tools": [
"office",
"pdf",
"pm_tool"
"game",
"website",
"pdf"
],
"kills": [
"app",
"game",
"youtube",
"e_learning",
"website",
"podcast",
"office",
"pm_tool",
"collaboration"
]
}
]
},
{
"index": 10,
"key": "moderation",
"key": "modification",
"responses": [
{
"key": "often",
"key": "much",
"tools": [
"app",
"game",
"youtube",
"e_learning",
"website",
"podcast",
"office",
"pdf",
"pm_tool",
"collaboration"
],
"kills": []
},
{
"key": "little",
"key": "medium",
"tools": [
"app",
"office"
"youtube",
"website",
"podcast",
"office",
"pdf",
"pm_tool"
],
"kills": [
"youtube",
"app",
"game",
"e_learning",
"podcast",
"pm_tool",
"collaboration"
]
},
{
"key": "none",
"key": "little",
"tools": [
"game",
"website",
"pdf"
"office",
"pdf",
"pm_tool"
],
"kills": [
"app",
"game",
"youtube",
"e_learning",
"website",
"podcast",
"office",
"pm_tool",
"collaboration"
]
}
Expand Down

0 comments on commit 3178e69

Please sign in to comment.