Skip to content

Commit

Permalink
Merge pull request marcusgreen#13 from mebis-lp/MBS-9817-Prepare_for_…
Browse files Browse the repository at this point in the history
…merge_with_upstream

MBS-9817: Prepare for merge with upstream
  • Loading branch information
marcusgreen committed Dec 29, 2024
2 parents 2b23b94 + c2e54c9 commit 736d4f7
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 176 deletions.
2 changes: 1 addition & 1 deletion amd/build/spellcheck.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amd/build/spellcheck.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions amd/src/spellcheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ import {getString as getString} from 'core/str';
/**
* Init the module.
*
* @param {int} cmid the course module id of the quiz.
* @param {string} readonlyareaselector the selector for the readonly area to apply the spellchecking
* @param {string} spellcheckeditbuttonselector the selector for the spell check edit button
*/
export const init = (cmid, readonlyareaselector, spellcheckeditbuttonselector) => {
export const init = (readonlyareaselector, spellcheckeditbuttonselector) => {
renderDiff(readonlyareaselector);

if (!document.querySelector(spellcheckeditbuttonselector)) {
Expand All @@ -42,7 +41,7 @@ export const init = (cmid, readonlyareaselector, spellcheckeditbuttonselector) =
document.querySelector(spellcheckeditbuttonselector).addEventListener('click',
async(event) => {
event.preventDefault();
await showModalForm(cmid, readonlyareaselector);
await showModalForm(readonlyareaselector);
});
};

Expand Down Expand Up @@ -86,19 +85,17 @@ export const renderDiff = (readonlyareaselector) => {
/**
* Show the dynamic spellcheck form.
*
* @param {int} cmid the course module id of the quiz
* @param {string} readonlyareaselector the selector for the readonly area
*/
export const showModalForm = async(cmid, readonlyareaselector) => {
export const showModalForm = async(readonlyareaselector) => {
const attemptstepid = document.querySelector(readonlyareaselector).dataset.spellcheckattemptstepid;
const answerstepid = document.querySelector(readonlyareaselector).dataset.spellcheckattemptstepanswerid;
const title = await getString('spellcheckedit', 'qtype_aitext');
const modalForm = new ModalForm({
formClass: "qtype_aitext\\form\\edit_spellchek",
formClass: "qtype_aitext\\form\\edit_spellcheck",
args: {
attemptstepid,
answerstepid,
cmid
answerstepid
},
modalConfig: {title},
});
Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Marks prompt in the editing interface is optional

Translation of the response is now optional

Big thanks to Philipp Memmel for help with the switchable backend settings to work and for testing and many other things.

Thanks to Farah Ahmad of Aga Khan University for reporting an issue with plagiarism plugins.

Thanks to Matt Metzgar for reporting an issue with the tranlation postfix.
Expand Down
2 changes: 1 addition & 1 deletion classes/external.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static function fetch_ai_grade($response, $defaultmark, $prompt, $markssc
if (!empty($response) && !empty($prompt) && $defaultmark > 0) {
$fullaiprompt = $aiquestion->build_full_ai_prompt($response, $prompt, $defaultmark, $marksscheme);
$feedback = $aiquestion->perform_request($fullaiprompt);
$contentobject = json_decode($feedback);
$contentobject = $aiquestion->process_feedback($feedback);
} else {
$contentobject = (object)["feedback" => get_string('err_parammissing', 'qtype_aitext'), "marks" => 0];
}
Expand Down
Loading

0 comments on commit 736d4f7

Please sign in to comment.