Skip to content
Snippets Groups Projects
Commit 5f1a9b83 authored by klamas's avatar klamas
Browse files

Merge branch 'feature/47' into 'main'

feat: added enum translations #47

See merge request !49
parents 115f8f1e 55717114
No related branches found
No related tags found
1 merge request!49feat: added enum translations #47
......@@ -9,6 +9,7 @@ import CloseIcon from "@/app/components/assets/CloseIcon";
import data from "../../data/en.json";
const InfoModal = ({ show, onClose, details }) => {
const questionTypes = useMemo(() => {
if (
!details?.questionConfigDetails ||
......@@ -22,7 +23,7 @@ const InfoModal = ({ show, onClose, details }) => {
renderValue={(question, config) => (
<>
<div className="flex">
<div>{question.trim()}:</div>
<div>{data.question_types[question]}:</div>
<div className="pl-1">
<div>{config}</div>
</div>
......@@ -45,11 +46,13 @@ const InfoModal = ({ show, onClose, details }) => {
<KeyValueList
data={details.questionErrors}
renderValue={(question, errors) => (
<div className="flex">
<div>{question.trim()}</div>
<div className="pl-1">
<KeyValueList data={errors} />
</div>
<div className="flex flex-col">
<div className="font-bold pt-1">{question?.trim()}</div>
{errors.map((error, index) => (
<div key={index} className="flex-row pl-1">
<div>{data?.errors[error]}</div>
</div>
))}
</div>
)}
/>
......@@ -67,15 +70,15 @@ const InfoModal = ({ show, onClose, details }) => {
return (
<KeyValueList
data={details.questionWarnings}
renderValue={(question, errors) => (
<>
<div>{question.trim()}</div>
{errors.map((error, index) => (
<div key={index} className="flex">
<div>{error}</div>
renderValue={(question, warnings) => (
<div className="flex flex-col">
<div className="font-bold pt-1">{question?.trim()}</div>
{warnings.map((warning, index) => (
<div key={index} className="flex-row pl-1">
<div>{data?.warnings[warning]}</div>
</div>
))}
</>
</div>
)}
/>
);
......
......@@ -38,6 +38,24 @@
"template": "Template Documentation",
"templateName": "UniTartuCS Template",
"templateLink": "https://docs.google.com/document/d/106xTDS6IG7fofL6Ju4JnqntjxLeBfBM_LIyjKtskFb8/edit",
"docLink": "https://docs.google.com/document/d/1IZWmkxqYYqBAYqW8uumiZ1k94muKS4IjpYQuOQ8-9WU/edit "
"docLink": "https://docs.google.com/document/d/1IZWmkxqYYqBAYqW8uumiZ1k94muKS4IjpYQuOQ8-9WU/edit"
},
"errors": {
"UNKNOWN_QUESTION_TYPE": "Unknown question type",
"NO_ANSWER_OPTIONS_FOUND": "No answer options found",
"NO_CORRECT_ANSWER_FOUND": "No correct answer found",
"ANSWER_OPTIONS_DONT_MATCH_TYPE": "Answer options don't match type",
"INVALID_REGEX": "Invalid regex"
},
"warnings": {
"CHECK_QUESTION_NAME": "Couldn't find the end of the name. Name should be followed by hypen (-).",
"UNKNOWN_PARAGRAPH_TYPE": "Unknown paragraph type",
"REGEX_RESTRICTION": "Moodle has some restrictions for regex. There is a list of meta characters which you cannot youse: . ^ $ * + { } \\ / . Read more about regex in Moodle: https://docs.moodle.org/404/en/Regular_Expression_Short-Answer_question_type. Coursera supports the Java regular expression format. Use a regular expression tester, like RegexPlanet, to check syntax: http://www.regexplanet.com/advanced/java/index.html",
"question_types": {
"SINGLE_CHOICE": "Single Choice",
"MULTIPLE_CHOICE": "Multiple Choice",
"TEXT_MATCH": "Text Match",
"REGULAR_EXPRESSION": "Regular Expression",
"UNKNOWN": "Unknown"
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment