Skip to content

Commit 478bde6

Browse files
authored
Merge pull request #79 from layer5io/exam
rename mcq question types to single_answer and multiple_answers
2 parents 57e8d67 + 1594375 commit 478bde6

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

layouts/partials/learning-path.json.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
"title": {{ .Title | jsonify }},
2424
"description": {{ .Description | jsonify }},
2525
"banner": {{ $banner_url | jsonify }},
26+
"badge": {{ .Params.badge | jsonify }},
27+
"certificate": {{ .Params.certificate | jsonify }},
2628
"permalink": {{ .Permalink | jsonify }},
2729
"categories": {{ .Params.Categories | jsonify }},
2830
"tags": {{ .Params.Tags | jsonify }},

layouts/partials/test/title.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
{{- $parentType = .Params.Type -}}
99
{{- end -}}
1010

11-
{{- if $isFinal -}}
12-
{{- $title = printf "%sFinal" $title -}}
13-
{{- end -}}
11+
1412

1513
{{- if $page.Params.is_optional -}}
1614
{{- $title = printf "%sOptional" $title -}}
@@ -28,8 +26,6 @@
2826
{{- $title = printf "%s Exam" $title -}}
2927
{{- end -}}
3028

31-
{{- if not $isFinal -}}
32-
{{- $title = printf "%s - %d" $title $index -}}
33-
{{- end -}}
29+
{{- $title = printf "%s - %d" $title $index -}}
3430

3531
{{- return $title -}}

layouts/test/single.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,11 @@ <h1>{{ $title }}</h1>
255255
<div class="question-number">Question {{ add $index 1 }}</div>
256256
<div class="question-text">{{ $question.text }}</div>
257257

258-
{{ if eq $question.type "mcq" }}
258+
{{ if or ( eq $question.type "single_answer") ( eq $question.type "multiple_answers" ) }}
259259
{{ range $optIndex, $option := $question.options }}
260260
<div class="option">
261261
<label>
262-
{{ if $question.multiple_answers }}
262+
{{ if eq $question.type "multiple_answers" }}
263263
<input type="checkbox" name="selected_option_ids_{{ $question.id }}" value="{{ $option.id }}">
264264
{{ else }}
265265
<input type="radio" name="selected_option_ids_{{ $question.id }}" value="{{ $option.id }}">
@@ -410,7 +410,7 @@ <h4 class="mb-0 ${statusClass}">${statusText}</h4>
410410
const answer = {question_id: questionID};
411411

412412
if (selectedCheckboxes.length > 0) {
413-
// Multiple choice with checkboxes (multiple_response = true)
413+
// Multiple choice with checkboxes
414414
answer.selected_option_id = Array.from(selectedCheckboxes).reduce((acc, cb) => {
415415
acc[cb.value] = true;
416416
return acc;

0 commit comments

Comments
 (0)