diff --git a/htdocs/js/PGProblemEditor/pgproblemeditor.js b/htdocs/js/PGProblemEditor/pgproblemeditor.js index 5f1771916f..b4d5231fb3 100644 --- a/htdocs/js/PGProblemEditor/pgproblemeditor.js +++ b/htdocs/js/PGProblemEditor/pgproblemeditor.js @@ -312,7 +312,7 @@ if (!problemForm) return; for (const button of problemForm.querySelectorAll('input[type="submit"]')) { - button.addEventListener('click', (e) => { + button.addEventListener('click', async (e) => { e.preventDefault(); // FormData does not support the characters in raw problem source. URLSearchParams does. @@ -327,7 +327,7 @@ requestData.set(button.name, button.value); requestData.set('set_id', document.getElementsByName('hidden_set_id')[0]?.value ?? 'Unknown Set'); - renderProblem(requestData); + await renderProblem(requestData); saveTempFile(); }); diff --git a/templates/RPCRenderFormats/default.html.ep b/templates/RPCRenderFormats/default.html.ep index 83a0ca949e..2d06eaaf1d 100644 --- a/templates/RPCRenderFormats/default.html.ep +++ b/templates/RPCRenderFormats/default.html.ep @@ -68,6 +68,14 @@ % } %== $LTIGradeMessage % + % if (stash->{disable_cookies}) { + %= hidden_field disableCookies => $disableCookies + %= hidden_field passwd => $passwd + % } + % if (stash->{disable_cookies} || $ce->{session_management_via} ne 'session_cookie') { + %= hidden_field key => $key + % } + %= hidden_field user => $user %= hidden_field sourceFilePath => $sourceFilePath %= hidden_field problemSource => $problemSource %= hidden_field rawProblemSource => $rawProblemSource @@ -77,11 +85,7 @@ %= hidden_field psvn => $psvn %= hidden_field fileName => $fileName %= hidden_field courseID => $courseID - %= hidden_field user => $user - %= hidden_field passwd => $passwd - %= hidden_field disableCookies => $disableCookies %= hidden_field displayMode => $displayMode - %= hidden_field key => $key %= hidden_field outputformat => $formatName %= hidden_field theme => $theme %= hidden_field language => $formLanguage