chamilo / chamilo-lms

Chamilo is a learning management system focused on ease of use and accessibility
https://chamilo.org
GNU General Public License v3.0
798 stars 480 forks source link

AI Helper for learning paths #4594

Closed ywarnier closed 1 year ago

ywarnier commented 1 year ago

Add a feature to the AI helper plugin, in the form of an additional icon in the learning path list's actions toolbar.

Show a form that asks for a topic, a number of chapters, a length (in words) for each chapter.

Ask ChatGPT for the following: Generate the table of contents of a course in [$courseLanguage] in [$chaptersCount] or less chapters on the topic of "[$topic]" in the CSV format, with the chapter number in the first column and the chapter title in the second column..

This will return a CSV with the chapters. Prepare this as the structure for a new learning path in Chamilo: create one learning path of title [$topic], then create one empty document (in a flat learning path structure) for each chapter with the following content:

<!DOCTYPE html>
<html>
<head>
  <title>La science de la navigation spatiale</title>
  <meta charset="utf-8">
</head>
<body>
  PLACEHOLDER
</body>
</html>

Then, for each chapter, make an additional request: In the context of "[$topic]", generate a document with HTML tags in [$courseLanguage] with [$wordsCount] words of content or less, about "[$chapterTitle]".

With the results, replace the PLACEHOLDER in the document created previously.

Make the learning path invisible by default (the teacher needs to review it before students can access it) and send the teacher to the learning path edition view. Do not offer textarea review during the creation process like we do in the Aiken import section. Just generate the documents.

christianbeeznest commented 1 year ago

Hi @ywarnier

The request is in this PR https://github.com/chamilo/chamilo-lms/pull/4597 , it is a version for a demo. That option will work when ai helper plugin is enabled , You should run this command composer dumpautoload .

Could you confirm if it is ok please ?

It has variables to add :

$LpAiGenerator $LpAiTopic $LpAiTopicHelp $LpAiNumberOfItems $LpAiNumberOfItemsHelper $LpAiWordsCount $LpAiWordsCountHelper

Thank you.

ywarnier commented 1 year ago

Just merged the PR. Working nicely. I'm leaving this issue open for further small changes (additional plugin options) explained to Christian, to be developed in the next few days.

christianbeeznest commented 1 year ago

Hi @ywarnier,

I just added the further small changes in this PR https://github.com/chamilo/chamilo-lms/pull/4603

Thanks for confirmation.

ywarnier commented 1 year ago

Reviewed, tested and approved.