CLASSROOMIO-T-193: Convert to single quotes CLASSROOMIO-T-193: Resolved Feedbacks landing page improvement add spacing on mobile for notes in lms little bug fixes in lms CLASSROOMIO-T-193: return the array Simplify template generation CLASSROOMIO-T-193: Styling improvement CLASSROOMIO-T-193: Exercise Templates for HTML Co-authored-by: Rotimi Best <[email protected]> Co-authored-by: Tunji Adeyemi <[email protected]> Merge-request: CLASSROOMIO-MR-88 Merged-by: Best Admin <[email protected]>
28 lines
523 B
TypeScript
28 lines
523 B
TypeScript
import type { CustomQuestionType } from '$lib/utils/types';
|
|
import type { ExerciseTemplate } from '$lib/utils/types';
|
|
|
|
export const QuestionTypes: CustomQuestionType[] = [
|
|
{
|
|
id: 1,
|
|
label: 'RADIO'
|
|
},
|
|
{
|
|
id: 2,
|
|
label: 'CHECKBOX'
|
|
},
|
|
{
|
|
id: 3,
|
|
label: 'TEXTAREA'
|
|
}
|
|
];
|
|
|
|
export function calculateTotalPoints(template: ExerciseTemplate): number {
|
|
let totalPoints = 0;
|
|
|
|
template.questionnaire.questions.forEach((question) => {
|
|
totalPoints += question.points;
|
|
});
|
|
|
|
return totalPoints;
|
|
}
|