Skip to content

Commit

Permalink
Adding the isExam flag in assignment edit form.
Browse files Browse the repository at this point in the history
  • Loading branch information
krulis-martin committed Mar 19, 2024
1 parent 6ce16c2 commit 9d8f997
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
29 changes: 29 additions & 0 deletions src/components/forms/EditAssignmentForm/EditAssignmentForm.js
Expand Up @@ -61,6 +61,7 @@ export const prepareInitialValues = defaultMemoize(
canViewJudgeStdout = false,
canViewJudgeStderr = false,
isBonus = false,
isExam = false,
disabledRuntimeEnvironmentIds = [],
runtimeEnvironmentIds,
isPublic = false,
Expand All @@ -86,6 +87,7 @@ export const prepareInitialValues = defaultMemoize(
canViewJudgeStdout,
canViewJudgeStderr,
isBonus,
isExam,
runtimeEnvironmentIds,
enabledRuntime: disabledRuntimeEnvironmentIds.reduce(
(result, item) => {
Expand Down Expand Up @@ -119,6 +121,7 @@ export const transformSubmittedData = ({
canViewJudgeStdout,
canViewJudgeStderr,
isBonus,
isExam,
enabledRuntime,
visibility,
visibleFrom,
Expand All @@ -143,6 +146,7 @@ export const transformSubmittedData = ({
canViewJudgeStdout,
canViewJudgeStderr,
isBonus,
isExam,
disabledRuntimeEnvironmentIds,
isPublic: visibility !== 'hidden',
sendNotification,
Expand Down Expand Up @@ -720,6 +724,31 @@ class EditAssignmentForm extends Component {
</Row>
</Container>

<hr className="mt-0 mb-4" />

<Container fluid>
<Row>
<Col xs={12}>
<Field
name="isExam"
component={CheckboxField}
onOff
label={
<>
<FormattedMessage id="app.editAssignmentForm.isExam" defaultMessage="Exam assignment" />
<Explanation id="isExamExplanation">
<FormattedMessage
id="app.editAssignmentForm.isExamExplanation"
defaultMessage="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."
/>
</Explanation>
</>
}
/>
</Col>
</Row>
</Container>

<hr />

<h4>
Expand Down
2 changes: 2 additions & 0 deletions src/locales/cs.json
Expand Up @@ -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í):",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/en.json
Expand Up @@ -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):",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/GroupInfo/GroupInfo.js
Expand Up @@ -160,7 +160,7 @@ class GroupInfo extends Component {
/>
)}

{hasPermissions(data, 'viewMembers') && (
{hasPermissions(data, 'viewDetail') && (
<Box
noPadding
collapsable
Expand Down

0 comments on commit 9d8f997

Please sign in to comment.