From 9d8f997efdb5721c4ce59f19b9ae6904fc78be2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kruli=C5=A1?= Date: Tue, 19 Mar 2024 23:50:41 +0100 Subject: [PATCH] Adding the isExam flag in assignment edit form. --- .../EditAssignmentForm/EditAssignmentForm.js | 29 +++++++++++++++++++ src/locales/cs.json | 2 ++ src/locales/en.json | 2 ++ src/pages/GroupInfo/GroupInfo.js | 2 +- 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/components/forms/EditAssignmentForm/EditAssignmentForm.js b/src/components/forms/EditAssignmentForm/EditAssignmentForm.js index 4ac520501..02ce4f94e 100644 --- a/src/components/forms/EditAssignmentForm/EditAssignmentForm.js +++ b/src/components/forms/EditAssignmentForm/EditAssignmentForm.js @@ -61,6 +61,7 @@ export const prepareInitialValues = defaultMemoize( canViewJudgeStdout = false, canViewJudgeStderr = false, isBonus = false, + isExam = false, disabledRuntimeEnvironmentIds = [], runtimeEnvironmentIds, isPublic = false, @@ -86,6 +87,7 @@ export const prepareInitialValues = defaultMemoize( canViewJudgeStdout, canViewJudgeStderr, isBonus, + isExam, runtimeEnvironmentIds, enabledRuntime: disabledRuntimeEnvironmentIds.reduce( (result, item) => { @@ -119,6 +121,7 @@ export const transformSubmittedData = ({ canViewJudgeStdout, canViewJudgeStderr, isBonus, + isExam, enabledRuntime, visibility, visibleFrom, @@ -143,6 +146,7 @@ export const transformSubmittedData = ({ canViewJudgeStdout, canViewJudgeStderr, isBonus, + isExam, disabledRuntimeEnvironmentIds, isPublic: visibility !== 'hidden', sendNotification, @@ -720,6 +724,31 @@ class EditAssignmentForm extends Component { +
+ + + + + + + + + + + } + /> + + + +

diff --git a/src/locales/cs.json b/src/locales/cs.json index a6357000b..0735ca5e3 100644 --- a/src/locales/cs.json +++ b/src/locales/cs.json @@ -315,6 +315,8 @@ "app.editAssignmentForm.interpolationDialog.intervalLabel": "Interval změny:", "app.editAssignmentForm.interpolationDialog.title": "Pomocník pro interpolaci bodů", "app.editAssignmentForm.isBonus": "Zadaná úloha je bonusová, její body tedy nejsou počítány do celkového maximálního počtu bodů skupiny", + "app.editAssignmentForm.isExam": "Zkoušková úloha", + "app.editAssignmentForm.isExamExplanation": "Zkouškové úlohy jsou více zabezpečené během zkouškových termínů tak, že v průběhu termínu jsou viditelné pouze studentům, kteří se již zamkli ve skupině. Pokud má zkoušková úloha nastavený termín na stejnou dobu, jako je konec zkoušky, je termín automaticky upraven pokud dojde ke změně konce zkoušky.", "app.editAssignmentForm.localized.assignmentSyncInfo": "Lokalizované texty (název a kompletní popis úlohy) jsou přepsány údaji z původní úlohy vždy, když je provedena aktualizace zadané úlohy (pokud dojde ke změně úlohy po jejím zadání). Jedinou výjimkou je položka nápověda pro studenty, která je asosciována pouze se zadanou úlohou.", "app.editAssignmentForm.localized.completeDescription": "Kompletní zadání (vše, co uživatel potřebuje, aby mohl úlohu vyřešit):", "app.editAssignmentForm.localized.description": "Krátký popis (viditelný pouze pro vedoucí):", diff --git a/src/locales/en.json b/src/locales/en.json index e7e1c7f94..aeb7507ca 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -315,6 +315,8 @@ "app.editAssignmentForm.interpolationDialog.intervalLabel": "Update interval:", "app.editAssignmentForm.interpolationDialog.title": "Points Interpolation Helper", "app.editAssignmentForm.isBonus": "Assignment is bonus one and points from it are not included in students overall score", + "app.editAssignmentForm.isExam": "Exam assignment", + "app.editAssignmentForm.isExamExplanation": "Exam assignments are secured during examination periods so that they are not visible to students that have not yet lock themselves in the group. Furthermore, if an exam assignment has the deadline synced with the end of the exam, it is updated automatically when the end of exam changes.", "app.editAssignmentForm.localized.assignmentSyncInfo": "Please note that the localized texts (name and complete description) are overwritten by the most recent data from the exercise when update of the assignment is invoked (if the exercise has been modified after the assignment). The only exception is the hint for students which is associated only with the assignment.", "app.editAssignmentForm.localized.completeDescription": "Complete description (everything the user needs to solve this exercise):", "app.editAssignmentForm.localized.description": "Short description (visible only to supervisors):", diff --git a/src/pages/GroupInfo/GroupInfo.js b/src/pages/GroupInfo/GroupInfo.js index e167760ff..0fb5c5233 100644 --- a/src/pages/GroupInfo/GroupInfo.js +++ b/src/pages/GroupInfo/GroupInfo.js @@ -160,7 +160,7 @@ class GroupInfo extends Component { /> )} - {hasPermissions(data, 'viewMembers') && ( + {hasPermissions(data, 'viewDetail') && (