跳至主要內容

Assignment 09:Let's Chat

AI悦创原创2023年4月30日1v1java 1v1纽约大学一对一NYU 1v1web 一对一数据结构一对一留学生辅导php留学生作业辅导1v1java 1v1php纽约大学一对一NYU 1v1web 一对一留学生辅导留学生作业辅导大约 20 分钟...约 6074 字

For this program you'll be creating a basic chat room that will support multiple participants. Here's a quick video to show how the basic functionality of the site should work (the video depicts two different browser windows running the same program):

对于这个程序,你将创建一个支持多个参与者的基本聊天室。这里有一个快速的视频展示网站的基本功能应该如何工作(视频展示了运行同一程序的两个不同浏览器窗口):

Grading Rubric (25 points + 2 EC)

NoteCriteriaPoints
Completed in class - minimal points
完成课堂任务 - 最低分数
Layout: * A content panel that asks the user to provide a nickname. This panel should include a button that can be used to save the nickname. This panel should be visible when the page loads. * A content panel that displays the previous chat history, a text box for new chat messages and a button. This panel should be invisible when the page loads. * Format your page so that it's visually appealing, though you don't need to go too crazy with this.
页面布局:
* 内容面板要求用户提供昵称。该面板应包括一个按钮,用于保存昵称。该面板应在页面加载时可见。
* 显示以前聊天记录的内容面板,一个用于新聊天消息的文本框和一个按钮。该面板应在页面加载时不可见。
* 格式化页面使其外观美观,虽然您不需要过度夸张。
0
Completed in class - minimal points
完成课堂任务 - 最低分数
When the user types in a message and clicks submit / hits enter a fetch request should be generated to a PHP script - you will need to send the message they typed and their nickname to this script.0
Completed in class - minimal pointsThis script should accept this information and validate it (at least 1 character long). Store the user's name and message in a file called 'messages.txt' in your 'data' folder' or in a database (students can choose which method they want to use for this assignment)0
Completed in class - minimal pointsSet up another JavaScript function called 'getChatMessages' - this function should initiate a fetch request to the server and attempt to access the 'messages.txt' file directly, or a script that accesses the database. Use this information to populate the textarea with the previous chat history.0
Completed in class - minimal pointsSet up some kind of callback structure (setTimeout, setInterval) to repeatedly check for new chat messages. You can do this every 1-2 seconds (don't go any faster than this)0
Set up the textarea so that when new data comes in it automatically scrolls to the bottom of the box so the user can see the most recent message. However, if the user is currently scrolling inside of the textarea you should prevent this from happening (otherwise the user's textarea will "jump")5
If the user is currently scrolling inside of the textarea you should prevent this from happening (otherwise the user's textarea will "jump")5
EXTRA FEATURES - 1 required for standard credit, additional for extra creditNickname management: * Let the user sign up for an account before they can chat. To do this they will need to supply a username and a password. * Send this information to a PHP script which will save this information into a database. * Next, write a feature that lets the user log in. To do this they will need to supply a username and a password. This information should be sent to the server to be validated. * If the login credentials are correct the user should be sent to the chatroom, otherwise an error message should appear.15 for standard credit, or 2 for extra credit
EXTRA FEATURES - 1 required for standard credit, additional for extra creditMultiple Chatrooms + Admin Panel: * Have your program support multiple chat rooms - the user can select which chat room they want to use through a drop down menu on the chat interface. If you are using text files this will require you to have multiple text files to manage each chat room. If you are using databases this will requires you to update your table to include a field for the room ID. * Build in an admin page (admin.html which lets you: - Log in using the username pikachu and the password pokemon - Provide a button that lets you clear the contents of any chat room - Provide a display of the system usage logs (who's used the chat room, when they used it, their IP addresses, etc.)15 for standard credit, or 2 for extra credit
EXTRA FEATURES - 1 required for standard credit, additional for extra creditIntegrate a 3rd party API into your chat room. * For example, you can use the Pexels API or Giphy API to obtain images in the chatroom. Perhaps you can design this so the user can provide a special command, such as @image search_query to perform a request to your 3rd party API. * Note that some APIs limit how many requests you can make, so read the docs and pricing details before you commit to using an API. * You shouldn't need to pay for anything to complete this assignment. * Refer to the source code on APIs for examples of how to do this (either using a client-side request, or request through a proxy server if the API doesn't support requests from clients directly). * Note that this feature needs to be non-trivial, and you can't just copy and paste code from my samples to make this work. Pick an API that we haven't covered yet, unless you want to try doing something using Open AI's APIs (Chat GPT, DALL-E, etc.)15 for standard credit, or 2 for extra credit

欢迎关注我公众号:AI悦创,有更多更好玩的等你发现!

公众号:AI悦创【二维码】

AI悦创·编程一对一

AI悦创·推出辅导班啦,包括「Python 语言辅导班、C++ 辅导班、java 辅导班、算法/数据结构辅导班、少儿编程、pygame 游戏开发」,全部都是一对一教学:一对一辅导 + 一对一答疑 + 布置作业 + 项目实践等。当然,还有线下线上摄影课程、Photoshop、Premiere 一对一教学、QQ、微信在线,随时响应!微信:Jiabcdefh

C++ 信息奥赛题解,长期更新!长期招收一对一中小学信息奥赛集训,莆田、厦门地区有机会线下上门,其他地区线上。微信:Jiabcdefh

方法一:QQ

方法二:微信:Jiabcdefh

你认为这篇文章怎么样?
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0
评论
  • 按正序
  • 按倒序
  • 按热度
通知
关于编程私教&加密文章