Skip to content

Commit

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

MBS-9817: Prepare for merge with upstream
  • Loading branch information
marcusgreen authored Dec 28, 2024
2 parents 2b23b94 + c2e54c9 commit 1151b69
Show file tree
Hide file tree
Showing 9 changed files with 106 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: 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 1151b69

Please sign in to comment.