Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/modules/quizzes.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function createQuizUrl(quizId, parameters, options, path) {

// Pull a (answers) from parameters and transform
if (answers && answers.length) {
answersParamString = `&${helpers.stringify({ a: answers.map((ans) => [...ans].join(',')) })}`;
answersParamString = `&${helpers.stringify({ a: answers.map((ans) => [...ans.map(encodeURIComponent)].join(',')) })}`;
}

// Pull page from parameters
Expand Down
8 changes: 7 additions & 1 deletion src/types/quizzes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export interface QuizResultData extends Record<string, any> {
variations: Record<string, any>[];
}

export type Question = SelectQuestion | OpenQuestion | CoverQuestion;
export type Question = SelectQuestion | FilterValueQuestion | OpenQuestion | CoverQuestion;

export interface BaseQuestion extends Record<string, any> {
id: number;
Expand All @@ -125,6 +125,12 @@ export interface BaseQuestion extends Record<string, any> {
images?: Nullable<QuestionImages>;
}

export interface FilterValueQuestion extends BaseQuestion {
type: 'single_filter_value' |'multiple_filter_values';
filter_name: string;
options: QuestionOption[];
}

export interface SelectQuestion extends BaseQuestion {
type: 'single' | 'multiple';
options: QuestionOption[];
Expand Down
2 changes: 1 addition & 1 deletion src/types/tests/quizzes.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ expectAssignable<QuizResultsConfigResponse>({
is_active: true,
text: 'Sample response summary',
items_separator: ',',
last_separator: 'and'
last_separator: 'and',
},
},
},
Expand Down
Loading