2023-10-04 08:18:33 +01:00
|
|
|
import type { CustomQuestionType } from '$lib/utils/types';
|
2023-10-06 09:06:03 +00:00
|
|
|
import type { ExerciseTemplate } from '$lib/utils/types';
|
2023-10-04 08:18:33 +01:00
|
|
|
|
|
|
|
|
export const QuestionTypes: CustomQuestionType[] = [
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
label: 'RADIO'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
label: 'CHECKBOX'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
label: 'TEXTAREA'
|
|
|
|
|
}
|
|
|
|
|
];
|
2023-10-06 09:06:03 +00:00
|
|
|
|
|
|
|
|
export function calculateTotalPoints(template: ExerciseTemplate): number {
|
|
|
|
|
let totalPoints = 0;
|
|
|
|
|
|
|
|
|
|
template.questionnaire.questions.forEach((question) => {
|
|
|
|
|
totalPoints += question.points;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return totalPoints;
|
|
|
|
|
}
|