Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions conditional/blueprints/major_project_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def display_major_project(user_dict=None):
"username": p.uid,
"name": ldap_get_member(p.uid).cn,
"proj_name": p.name,
"ai_usage": p.ai_usage,
"tldr": p.tldr,
"time_spent": p.time_spent,
"skills": p.skills,
Expand Down Expand Up @@ -103,6 +104,7 @@ def submit_major_project(user_dict=None):

name = post_data["projectName"]
tldr = post_data['projectTldr']
ai_usage = post_data['projectAIUsage']
time_spent = post_data['projectTimeSpent']
skills = post_data['projectSkills']
description = post_data["projectDescription"]
Expand All @@ -113,10 +115,10 @@ def submit_major_project(user_dict=None):
log.info(user_id)

# All fields are required in order to be able to submit the form
if not name or not tldr or not time_spent or not description:
if not name or not tldr or not ai_usage or not time_spent or not description:
return jsonify({"success": False}), 400

project: MajorProject = MajorProject(user_id, name, tldr, time_spent, description, links)
project: MajorProject = MajorProject(user_id, name, tldr, ai_usage, time_spent, description, links)

# Save the info to the database
db.session.add(project)
Expand Down
4 changes: 3 additions & 1 deletion conditional/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ class MajorProject(db.Model):
uid = Column(String(32), nullable=False, index=True)
name = Column(String(64), nullable=False)
tldr = Column(String(128), nullable=True)
ai_usage = Column(Text, nullable=False)
time_spent = Column(Text, nullable=True)
description = Column(Text, nullable=False)
links = Column(Text, nullable=True)
Expand All @@ -164,11 +165,12 @@ class MajorProject(db.Model):
name="major_project_enum"),
nullable=False)

def __init__(self, uid, name, tldr, time_spent, description, links): # pylint: disable=too-many-positional-arguments
def __init__(self, uid, name, tldr, ai_usage, time_spent, description, links): # pylint: disable=too-many-positional-arguments
self.uid = uid
self.date = datetime.now()
self.name = name
self.tldr = tldr
self.ai_usage = ai_usage
self.time_spent = time_spent
self.description = description
self.links = links
Expand Down
16 changes: 16 additions & 0 deletions conditional/templates/major_project_submission.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@ <h3 class="mb-4">Major Project Form</h3>
</small>
</div>
</div>

<div class="col-lg-6">
<label for="ai-usage" class="d-block h5 mt-4 mb-2">
AI Usage
</label>

<textarea
id="ai-usage"
name="ai-usage"
rows="4"
class="form-control mb-extra"
placeholder="AI has become a staple to the computer science field. There's no shame in saying you used AI, but be honest about how much you used AI versus how much you did."
required
></textarea>
</div>
</div>

<div class="col-lg-6">
<label for="time-commitment" class="d-block h5 mt-5 mb-2">
Expand Down
Loading