Plugin: AI Helper: Finetuning documentation and query before release

pull/4550/head
Yannick Warnier 3 years ago
parent bdd87525a8
commit 1a41e322e3
  1. 4
      main/exercise/export/aiken/aiken_import.inc.php
  2. 4
      plugin/ai_helper/AiHelperPlugin.php
  3. 3
      plugin/ai_helper/README.md
  4. 4
      plugin/ai_helper/lang/english.php
  5. 2
      plugin/ai_helper/lang/french.php
  6. 2
      plugin/ai_helper/tool/answers.php

@ -60,9 +60,9 @@ function generateAikenForm()
null,
);
$form->addElement('header', get_lang('AIQuestionsGenerator'));
$form->addElement('text', 'quiz_name', get_lang('Topic'));
$form->addElement('text', 'quiz_name', [get_lang('QuestionsTopic'),get_lang('QuestionsTopicHelp')]);
$form->addRule('quiz_name', get_lang('ThisFieldIsRequired'), 'required');
$form->addElement('number', 'nro_questions', get_lang('NumberOfQuestions'));
$form->addElement('number', 'nro_questions', [get_lang('NumberOfQuestions'), get_lang('AIQuestionsGeneratorNumberHelper')]);
$form->addRule('nro_questions', get_lang('ThisFieldIsRequired'), 'required');
$options = [

@ -15,7 +15,7 @@ class AiHelperPlugin extends Plugin
$version = '1.0';
$author = 'Christian Beeznest';
$message = Display::return_message($this->get_lang('Description'));
$message = 'Description';
$settings = [
$message => 'html',
@ -39,7 +39,7 @@ class AiHelperPlugin extends Plugin
public function getApiList()
{
$list = [
self::OPENAI_API => $this->get_lang('OpenAi'),
self::OPENAI_API => 'OpenAI',
];
return $list;

@ -8,3 +8,6 @@ release).
The AI helper plugin integrates into parts of the platform that seem the most useful to teachers/trainers or learners.
Because available Artificial Intelligence (to use the broad term) now allows us to ask for meaningful texts to be generated, we can use those systems to pre-generate content, then let the teacher/trainer review the content before publication.
Currently, this plugin is only integrated into:
- exercises: in the Aiken import form, scrolling down

@ -3,9 +3,9 @@
$strings['plugin_title'] = 'AI Helper plugin';
$strings['plugin_comment'] = 'Integrates into parts of the platform that seem the most useful to teachers/trainers or learners';
$strings['Description'] = 'Due available Artificial Intelligence (to use the broad term) now allows us to ask for meaningful texts to be generated, we can use those systems to pre-generate content, then let the teacher/trainer review the content before publication.';
$strings['Description'] = 'Available Artificial Intelligence services (to use the broad term) now allows you to ask for meaningful texts to be generated, we can use those systems to pre-generate content, then let the teacher/trainer review the content before publication.';
$strings['tool_enable'] = 'Enable plugin';
$strings['api_name'] = 'Ai Api to connect';
$strings['api_name'] = 'AI API to use';
$strings['api_key'] = 'Api key';
$strings['api_key_help'] = 'Secret key generated for your Ai api';
$strings['organization_id'] = 'Organization ID';

@ -3,7 +3,7 @@
$strings['plugin_title'] = 'AI Helper plugin.';
$strings['plugin_comment'] = 'S\'intègre dans les parties de la plateforme qui semblent les plus utiles aux enseignants.';
$strings['Description'] = 'L\'intelligence artificielle disponible (pour utiliser le terme large) nous permet désormais de demander la génération de textes significatifs, nous pouvons utiliser ces systèmes pour pré-générer du contenu, puis laisser l\'enseignant/formateur réviser le contenu avant publication.';
$strings['Description'] = 'L\'intelligence artificielle disponible (pour utiliser le terme large) nous permet désormais de demander la génération de textes significatifs, nous pouvons utiliser ces systèmes pour pré-générer du contenu, et laisser l\'enseignant/formateur perfectionner le contenu avant publication.';
$strings['tool_enable'] = 'Activer le plug-in';
$strings['api_name'] = 'Ai Api pour se connecter';
$strings['api_key'] = 'Api key';

@ -30,7 +30,7 @@ switch ($apiName) {
$topic = (string) $_REQUEST['quiz_name'];
$questionType = $questionTypes[$_REQUEST['question_type']] ?? $questionTypes['multiple_choice'];
$prompt = 'Generate %d "%s" questions in Aiken format in the %s language about "%s", making sure there is a \'ANSWER\' line for each question. \'ANSWER\' lines must only mention the letter of the correct answer, not the full answer text and not a parenthesis. The response line must not be separated from the last answer by a blank line. Each answer starts with an uppercase letter, a dot, one space and the answer text. Include an \'ANSWER_EXPLANATION\' line after the \'ANSWER\' line for each question. The terms between single quotes above must not be translated. There must be a blank line between each question.';
$prompt = 'Generate %d "%s" questions in Aiken format in the %s language about "%s", making sure there is a \'ANSWER\' line for each question. \'ANSWER\' lines must only mention the letter of the correct answer, not the full answer text and not a parenthesis. The response line must not be separated from the last answer by a blank line. Each answer starts with an uppercase letter, a dot, one space and the answer text. Include an \'ANSWER_EXPLANATION\' line after the \'ANSWER\' line for each question. The terms between single quotes above must not be translated. There must be a blank line between each question. Show the question directly without any prefix. Each answer must not be quoted.';
$apiKey = $plugin->get('api_key');
$organizationId = $plugin->get('organization_id');

Loading…
Cancel
Save