Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-83277

AI should not be logging information in the browser console

XMLWordPrintable

    • MOODLE_405_STABLE
    • MOODLE_405_STABLE
    • MDL-83277-main
    • Hide

      Testing Instructions

      AI Setup: 

      1. Login as admin
      2. Go to Site admin -> General -> AI -> Manage settings for AI providers.
      3. Enable 'OpenAI API Provider'.
      4. Click on the 'Settings' link in the 'OpenAI API Provider' row.
      5. Enter a valid 'OpenAI API key' and 'Organization ID' in the appropriate fields.
      6. Save changes.
      7. Enable all provider actions ('Generate image', 'Generate text' and 'Summarise text')
      8. Go to Site admin -> General -> AI -> Manage settings for AI placements.
      9. Enable 'HTML Text Editor Placement'.
      10. Access to settings and enable 'Generate text' and 'Generate image'
      11. Back to 'Manage settings for AI placements', enable "Course Assistance Placement"
      12. Access to settings and enable 'Summarise text'

       

      Test 1 - Generate image test 

      1. As admin, edit your user profile.
      2. Open your browser console.
      3. From the editor, click 'AI generate image'.
      4. If there is a popup AI usage policy, click the Accept and Continue button.
      5. Enter a prompt to generate an image (e.g. 'Cat on a mat wearing a hat').
      6. Click on 'Generate image'.
      7. Verify full object information is NOT displayed in the browser console.

       

      Test 2 - Course assistance - summarize text

      1. As admin,
      2. Restore the course using the file attached to this issue (you may have to run cron to complete the restore)
      3. Go to the restored course.
      4. View the 'Grandma's Kimchi' page.
      5. Open your browser console.
      6. Click on 'Summarise' button.
      7. Verify the object information is NOT displayed in the browser console.

       

      Test 3 - AI API key error

      1. As admin,
      2. Go to Site admin -> General -> AI -> Manage settings for AI providers.
      3. Click on the 'Settings' link in the 'OpenAI API Provider' row.
      4. Enter a invalid 'OpenAI API key' or 'Organization ID' in the appropriate fields.
      5. Go to the restored course (Previous test) and view the 'Grandma's Kimchi' page.
      6. Open your browser console.
      7. Click on 'Summarise' button.
      8. Verify you don't see an incorrect API key message... 

        Incorrect API key provided: sk-proj-********************************************peZN. You can find your API key at https://platform.openai.com/account/api-keys. 

       

      Show
      Testing Instructions AI Setup:  Login as admin Go to Site admin -> General -> AI -> Manage settings for AI providers. Enable 'OpenAI API Provider'. Click on the 'Settings' link in the 'OpenAI API Provider' row. Enter a valid 'OpenAI API key' and 'Organization ID' in the appropriate fields. Save changes. Enable all provider actions ('Generate image', 'Generate text' and 'Summarise text') Go to Site admin -> General -> AI -> Manage settings for AI placements. Enable 'HTML Text Editor Placement'. Access to settings and enable 'Generate text' and 'Generate image' Back to 'Manage settings for AI placements', enable "Course Assistance Placement" Access to settings and enable 'Summarise text'   Test 1 - Generate image test  As admin, edit your user profile. Open your browser console. From the editor, click 'AI generate image'. If there is a popup AI usage policy, click the Accept and Continue button. Enter a prompt to generate an image (e.g. 'Cat on a mat wearing a hat'). Click on 'Generate image'. Verify full object information is NOT displayed in the browser console.   Test 2 - Course assistance - summarize text As admin, Restore the course using the file attached to this issue (you may have to run cron to complete the restore) Go to the restored course. View the 'Grandma's Kimchi' page. Open your browser console. Click on 'Summarise' button. Verify the object information is NOT displayed in the browser console.   Test 3 - AI API key error As admin, Go to Site admin -> General -> AI -> Manage settings for AI providers. Click on the 'Settings' link in the 'OpenAI API Provider' row. Enter a invalid 'OpenAI API key' or 'Organization ID' in the appropriate fields. Go to the restored course (Previous test) and view the 'Grandma's Kimchi' page. Open your browser console. Click on 'Summarise' button. Verify you don't see an incorrect API key message...  Incorrect API key provided: sk-proj-********************************************peZN. You can find your API key at https: //platform.openai.com/account/api-keys.  
    • 1
    • Team Hedgehog 2024 Sprint 3.3

      AI prompts are being logged in the browser console, this seems to be a dev artifact we didn't remove from the original implementation. I think we can take it out, since it seeme to be a dev benefit rather than a user one (and the prompts are already stored in the db).

      Errors are also sometimes being logged in the console, eg if you put an incorrect API key in, the summarise action will generate a console message which gives the specific error, and in the case of the incorrect API key, lists the API key that was attempted. We should remove that (and any other cases where that is being output - though it didn't appear to output to the console from the editor placement, the generate image and text actions just show the generic error in the modal without any console output).

       

        1. ai-test-course.mbz
          7 kB
          Raquel Ortega
        2. MDL-83277 - 1.png
          748 kB
          Ron Carl Alfon Yu
        3. MDL-83277 - 2.png
          247 kB
          Ron Carl Alfon Yu
        4. MDL-83277 - 3.png
          188 kB
          Ron Carl Alfon Yu

            raquel.ortega@moodle.com Raquel Ortega
            michaelh Michael Hawkins
            Meirza Meirza
            Huong Nguyen Huong Nguyen
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 11 minutes
                4h 11m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.