Ditectrev / Automation-Tools-for-Courses

2 stars 3 forks source link

fetching content for terminal testing added #11

Closed vitustockholm closed 3 months ago

vitustockholm commented 3 months ago

respond from ollama generate api url : Here is a sample JSON format for a comprehensive table of contents for a Terminal course:

{
  "course": {
    "title": "Terminal Fundamentals",
    "description": "Learn the basics and advanced concepts of using the terminal effectively.",
    "sections": [
      {
        "sectionTitle": "Introduction to Terminal",
        "lessons": [
          {
            "lessonTitle": "What is a Terminal?",
            "type": "text"
          },
          {
            "lessonTitle": "Navigating the File System",
            "type": "video",
            "url": "https://example.com/navigating-the-file-system"
          },
          {
            "lessonTitle": "Basic Commands",
            "type": "exercise",
            "instructions": "Practice these commands in the terminal: ls, cd, pwd, and mkdir.",
            "solution": "https://example.com/basic-commands-solutions"
          }
        ]
      },
      {
        "sectionTitle": "Intermediate Terminal",
        "lessons": [
          {
            "lessonTitle": "Working with Directories and Files",
            "type": "text",
            "subsections": [
              {
                "subsectionTitle": "Copy, Move, and Delete Files",
                "exercise": {
                  "instructions": "Perform these actions on files: copy, move, and delete.",
                  "solution": "https://example.com/intermediate-commands-copy-move-delete"
                }
              },
              {
                "subsectionTitle": "Archiving and Compression",
                "exercise": {
                  "instructions": "Compress and extract files using tar, gzip, and bzip2.",
                  "solution": "https://example.com/intermediate-commands-archive"
                }
              }
            ]
          },
          {
            "lessonTitle": "Working with Processes",
            "type": "text",
            "exercise": {
              "instructions": "Locate and kill running processes.",
              "solution": "https://example.com/intermediate-commands-processes"
            }
          },
          {
            "lessonTitle": "Using Aliases and Shell Functions",
            "type": "text",
            "exercise": {
              "instructions": "Create your own custom aliases and shell functions.",
              "solution": "https://example.com/intermediate-aliases-functions"
            }
          }
        ]
      },
      {
        "sectionTitle": "Advanced Terminal",
        "lessons": [
          {
            "lessonTitle": "Automating Tasks with Scripting",
            "type": "text",
            "exercise": {
              "instructions": "Create a simple shell script that performs tasks automatically.",
              "solution": "https://example.com/advanced-shell-scripting"
            }
          },
          {
            "lessonTitle": "Using Vim for Text Editing",
            "type": "video",
            "url": "https://example.com/using-vim"
          },
          {
            "lessonTitle": "Securing Your Terminal",
            "type": "text",
            "subsections": [
              {
                "subsectionTitle": "Setting Up SSH Keys",
                "exercise": {
                  "instructions": "Generate and use SSH keys for secure login.",
                  "solution": "https://example.com/advanced-ssh"
                }
              },
              {
                "subsectionTitle": "Configuring Your .bashrc or .zshrc",
                "exercise": {
                  "instructions": "Customize your terminal experience with aliases, functions, and environment variables.",
                  "solution": "https://example.com/advanced-terminal-config"
                }
              }
            ]
          }
        ]
      }
    ],
    "quizzes": [
      {
        "title": "Basic Terminal Quiz",
        "questions": [
          {
            "question": "What does the ls command do?",
            "answer": ["Lists files and directories in the current directory"]
          },
          {
            "question": "How can you navigate to a parent directory?",
            "answer": ["Use the cd .. command"]
          }
        ]
      },
      {
        "title": "Intermediate Terminal Quiz",
        "questions": [
          {
            "question": "What command can you use to archive and compress a directory?",
            "answer": ["tar -czvf <archive_name> <directory>"]
          },
          {
            "question": "How would you find all processes owned by the user 'user1'?",
            "answer": ["ps aux | grep user1"]
          }
        ]
      },
      {
        "title": "Advanced Terminal Quiz",
        "questions": [
          {
            "question": "What is a shell script and how do you create one?",
            "answer": ["A shell script is a series of commands saved in a file. To create a shell script, you can use the nano or vim text editors and save your script with a .sh extension."]
          },
          {
            "question": "How do you generate and use SSH keys for secure login?",
            "answer": [
              "First, generate an SSH key pair using ssh-keygen. Then, copy the public key to your remote server and append it to the ~/.ssh/authorized_keys file.",
              "Alternatively, you can use a tool like ssh-copy-id to automate the process."
            ]
          }
        ]
      }
    ]
  }
}

This example includes a table of contents with three sections: Introduction to Terminal, Intermediate Terminal, and Advanced Terminal. Each section contains lessons that can be text, video, or exercises, along with solutions for the exercises. The course also has quizzes containing multiple-choice questions related to each section's content.

vitustockholm commented 3 months ago

please take care with additional testing,due to issues of ollama we werent able to reach wanted respond from json.