Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus committed Apr 23, 2024
1 parent a681216 commit 8b9589a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions backup/moodle2/backup_qtype_aitext_plugin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ protected function define_question_plugin_structure() {
$plugin->add_child($pluginwrapper);

// Now create the qtype own structures.
$aitext = new backup_nested_element('aitext', ['id'], array(
$aitext = new backup_nested_element('aitext', ['id'], [
'aiprompt', 'responseformat', 'responsefieldlines', 'minwordlimit', 'maxwordlimit',
'graderinfo', 'graderinfoformat', 'responsetemplate',
'responsetemplateformat', 'maxbytes'));
'responsetemplateformat', 'maxbytes']);

// Now the own qtype tree.
$pluginwrapper->add_child($aitext);
Expand Down
6 changes: 3 additions & 3 deletions question.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,16 @@ public function grade_response(array $response) : array {
if (is_array($response)) {
$responsetext = strip_tags($response['answer']);
$responsetext = '[['.$responsetext.']]';
$prompt = get_config('qtype_aitext','prompt');
$prompt = get_config('qtype_aitext', 'prompt');
$prompt = preg_replace("/\[responsetext\]/", $responsetext, $prompt);
$prompt .= ' '.trim($this->aiprompt); if ($this->markscheme > '') {
$prompt .= ' '.$this->markscheme;
} else {
/** @todo should this be a plugin setting value? */
// @todo should this be a plugin setting value?.
$prompt .= ' Set marks to null in the json object.'.PHP_EOL;
}

$prompt .= ' '.trim(get_config('qtype_aitext','jsonprompt'));
$prompt .= ' '.trim(get_config('qtype_aitext', 'jsonprompt'));
$prompt .= ' respond in the language '.current_language();

$llmresponse = $ai->prompt_completion($prompt);
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'qtype_aitext';
$plugin->version = 2024041401;
$plugin->version = 2024042201;
$plugin->requires = 2020110900;
$plugin->maturity = MATURITY_BETA;
$plugin->dependencies = [
Expand Down

0 comments on commit 8b9589a

Please sign in to comment.