Professional Documents
Culture Documents
ID F20030108
Department 计算机科学与技术系
Date 2023.6.5-2022.6.11
-
计分(每项
课程目标 评价准则
10 分)
1、能够掌握计算机软件设计的相关基础知识,并能够针
对求解的工程问题,进行合理的分析与设计
课程目标 1:
2、具备一定自学能力与探索创新意识,能够充分利用教
通过课程设计提高学生的理论联 科书及其资源(如网络等)自学新知识与新技能
系实际、查阅资料、自学和独立分
析与解决复杂工程问题的能力 3、能够给出数据结构和算法的设计描述,给出关键算法
的流程图或伪代码,并给出各算法之间的结构关系描述
(40 分)
4、具备一定的人机交互设计意识,人机交互设计合理、
友好,操作简便
课程目标 2: 5、能够结合计算机软硬件资源,合理选用算法、数据结
要求学生在深入理解软件系统的 构、数据存储方式等技术手段,对求解的工程问题进行
相关知识基础上,综合运用所学的 有效建模和求解
方法和理论自主地完成课程设计。
6、能够选择合适的程序设计语言与软件开发平台,对求
要求学生通过软件课题的开发实
解的工程问题进行编程实现
践活动熟悉一种主流的数据库管
理系统产品和软件开发工具,掌握 7、掌握调试方法与工具,对程序开发过程中出现的问题
软件设计和开发的理论方法与实 进行分析、跟踪与调试,并能够进行充分测试
施步骤。要求学生在软件开发的过
程中考虑到可持续发展的因素,例 8、在完成课题要求的各项任务和指标时能够充分考虑可
如安全以及环保等。(40 分) 持续发展因素,例如安全和环保等
课程目标 3:
9、能够正确、完整地回答指导教师关于课题的问询,反
要求学生分组完成一次项目设计 映其对课题内容,并能够明确团队交流和协作的重要性,
与开发的全过程,掌握软件需求分 以及相关的项目管理知识具有较好的理解和掌握
析、软件设计、软件测试和团队协
同开发的基本理论和技术实践。应
用工程项目管理原理和经济决策 10、具备一定的语言表达能力与文字处理能力,能够结
方法划分和管理课题任务,培养项 合复杂工程问题撰写报告,报告内容和实验数据详实,
格式规范
目组织管理能力。(20 分)
-
Course Design I 能力测评总分
指导教师: 年 月 日
-
Science Tutoring
-
5) Responsive Design: Create a visually appealing and user-friendly interface using
HTML, CSS, and JS. The design should be responsive to different screen sizes and
devices for a seamless user experience.
6) Deployment: Deploy the application on a server accessible through an IPv4 link,
enabling users to access the tutoring platform from any device connected to the same
internet IP address as the server.
-
User Interface: The user interface provides a visually appealing and user-friendly design to
facilitate a seamless experience for users.
Server-Side:
Back-End: The back-end of the system is built using Python Flask, a lightweight web
framework. Flask handles the server-side logic, processing user requests, and managing the
database interactions.
ChatGPT API: The system integrates with the ChatGPT API to provide the chat
functionality between users and tutors. The API allows for real-time messaging and facilitates the
exchange of scientific knowledge based on the selected mode (scientific or oversimplified).
Tutor Matching: A matching algorithm runs on the server-side to pair users with appropriate
tutors based on the selected mode and tutor availability. The algorithm considers factors like
expertise, availability, and user preferences.
2.4 UI Design
When it comes to the UI design, the CSS styling of the project integrates the NJUPT
university logo and the primary blue color to create a visually appealing and cohesive interface,
providing users with an engaging and immersive experience while reflecting the brand identity
of NJUPT. In the CSS styling, careful attention is given to create a visually cohesive and
user-friendly interface. The layout is designed to be intuitive, with clear navigation and
organized sections. The use of responsive design ensures that the project is accessible and
visually pleasing on various devices and screen sizes. The NJUPT blue color is utilized
strategically to highlight important elements, such as buttons, links, and interactive components,
creating visual emphasis and enhancing user interaction. It contributes to a harmonious and
visually consistent experience across different pages of the project. The pictures are inside the
project folder for more clarity!
-
-
3、Design of Related Data
1 Class and Data Type Design
In my project, I have implemented the following classes and data types to organize the data and
ensure efficient processing:
ServerApp Class: This class represents the Flask application and contains the route handlers for
different pages. It is responsible for rendering HTML templates, handling user requests, and
managing the chat functionality.
inputs: This is a list that stores the user inputs during the chat sessions. Each input represents a
question or query from the user.
outputs: This list stores the corresponding responses generated by the chat model. Each output is
the answer provided by the tutor in response to a user input.
dates: This list stores the timestamps for each user input and tutor output, indicating the time
when the interaction occurred.
mode: A Boolean variable that represents the selected tutoring mode. When mode is True, the
scientific mode is active, and when False, the oversimplified mode is active.
-
2 Flowchart of the system
server.py:
@app.route('/')
def index():
return render_template('index.html')
- This function handles the root URL ("/") and renders the "index.html" template, which
represents the home page of the tutoring platform.
@app.route('/menu')
def menu():
return render_template('menu.html')
- This function handles the "/menu" URL and renders the "menu.html" template, which
displays the menu page for selecting the tutoring mode.
@app.route('/false')
def false():
-
global mode
mode = False
return redirect(url_for('clear'))
- This function handles the "/false" URL and sets the tutoring mode to False (oversimplified
mode). It then redirects to the 'clear' route.
@app.route('/true')
def true():
global mode
mode = True
return redirect(url_for('clear'))
- This function handles the "/true" URL and sets the tutoring mode to True (scientific mode).
It then redirects to the 'clear' route.
@app.route('/clear')
def clear():
inputs.clear()
outputs.clear()
return redirect(url_for('chat'))
- This function handles the "/clear" URL and clears the inputs and outputs lists. It then
redirects to the 'chat' route.
if mode == True:
brief = "Greetings, I am your science tutor..."
role = "You're a science serious tutor..."
if request.method == 'POST':
# User input processing
input = request.form['input']
-
# Constructing messages for the ChatGPT API
messages = [
{"role": "system", "content": role}
]
content = input
messages.append({"role": "user", "content": content})
- This function handles the "/chat" URL and serves as the main chat interface. It processes
user inputs, generates responses using the ChatGPT API, stores inputs/outputs, and renders the
chat template with relevant data.
chat.html:
- The purpose of this loop is to dynamically generate HTML elements for each input and
output pair, creating a visually organized chat history. The loop iterates through the arrays using
the {% for input in inputs %} and {% endfor %} tags. Within the loop, the individual input and
output messages are accessed using the input, outputs[loop.index0] and dates[loop.index0]
variables, respectively. The loop.index0 variable represents the current index of the loop,
allowing the correct corresponding output to be fetched from the outputs array.
5、Results
In conclusion, the implementation of the science tutoring project has achieved the desired results
by providing a comprehensive platform for users to receive science tutoring based on their
preferred mode. The project successfully integrates front-end and back-end technologies,
leverages the ChatGPT API for chat functionality, and incorporates essential features like mode
selection, chat interface, tutor matching, science content integration and responsive design. The
deployed server allows users to access the platform conveniently from various devices,
enhancing the overall user experience. Laoshi will receive the demo of how the program work
and also the source files.