Skip to content

Commit ca3e7cf

Browse files
authored
Merge pull request #195 from layer5io/revert-191-fix/pre-quiz-url-prefix
Revert "fix: resolve incorrect URLs for pre-quiz tests missing /academy prefix"
2 parents c62069c + d51e8fc commit ca3e7cf

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

layouts/test/single.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,9 @@ <h1>{{ $title }}</h1>
349349
{{ $tesAbsPath := .RelPermalink }}
350350

351351
<script>
352-
const testId = {{ $test.id | jsonify }};
352+
const testId = {{$test.id}};
353353
const testAbsPath = "{{$tesAbsPath}}";
354-
const build = {{ $build | jsonify }};
354+
const build = {{$build}};
355355

356356

357357
// Event Listeners
@@ -377,7 +377,7 @@ <h1>{{ $title }}</h1>
377377
window.addEventListener("academyContextReady", () => {
378378
if (isProdBuild && window.academyContext?.RegistrationData?.id) {
379379
// redirect to test page
380-
const curriculaRoot = {{ .RelPermalink | strings.TrimSuffix "/" | jsonify }};
380+
const curriculaRoot = window.location.pathname.split("/").slice(0, 5).join("/");
381381
window.location.replace(`${curriculaRoot}/test?id=${testId}&registration_id=${window.academyContext?.RegistrationData?.id}&test_abs_path=${testAbsPath}`);
382382
return;
383383
}

0 commit comments

Comments
 (0)