Skip to content

Commit

Permalink
Edited UI Views on educator view, login, and student profile
Browse files Browse the repository at this point in the history
  • Loading branch information
namitasshah committed Apr 5, 2024
1 parent 9d920d8 commit 5e988c4
Show file tree
Hide file tree
Showing 8 changed files with 279 additions and 170 deletions.
25 changes: 16 additions & 9 deletions jupyter_mentor/educator_course_overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ def __init__(self, file_viewer):

# File Upload button
self.file_upload = FileUpload(accept='', multiple=False)
self.file_upload_button = Button(description='Upload')

# global file viewer (that has model)
self.file_viewer = file_viewer

# Course overview text
self.course_overview_label = Label('Course Overview:')
self.course_overview_text = Textarea(placeholder='Enter course overview')
self.course_overview_text = v.TextField(label='Course Overview:', placeholder='Enter course overview')

# AI Guidelines text
self.ai_guidelines_label = Label('AI Guidelines:')
Expand All @@ -40,21 +38,30 @@ def __init__(self, file_viewer):


# Open-ended response textbox
self.open_ended_label = Label('Open-ended Response:')
self.open_ended_text = Textarea(placeholder='Enter open-ended response')
self.open_ended_text = v.TextField(label='Open-ended Response:', placeholder='Enter open-ended query')

# Next button
self.next_button = Button(description='Next')

#Header
self.header = v.Container(children=[
v.Html(
tag='h1',
attributes={'title': 'a title'},
children=['Educator Course Overview']
)
])


# Arrange widgets vertically
self.children = [
HTML('<h2>Course Overview</h2>'), # Heading
HBox([self.file_upload, self.file_upload_button]), # File upload button
self.header, # Heading
HBox([self.file_upload]), # File upload button
self.file_viewer,
self.course_overview_label, self.course_overview_text, # Course overview
self.course_overview_text, # Course overview
self.ai_guidelines_label, # AI Guidelines
VBox([self.step_by_step_checkbox, self.metaphor_checkbox,
self.hints_checkbox, self.ai_guided_questions_checkbox]), # Binary features checkboxes
self.open_ended_label, self.open_ended_text, # Open-ended response
self.open_ended_text, # Open-ended response
HBox([self.next_button], layout={'justify_content': 'flex-end'}),
]
32 changes: 20 additions & 12 deletions jupyter_mentor/educator_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# %% ../nbs/04_educator_profile.ipynb 1
from ipywidgets import VBox, HBox, HTML, Text, Button, Label
import ipyvuetify as v

# %% ../nbs/04_educator_profile.ipynb 2
class EducatorProfileView(VBox):
Expand All @@ -13,24 +14,31 @@ def __init__(self):
super().__init__()

# Username input
self.username_label = Label('Name:')
self.username_input = Text(placeholder='Enter your name')

self.username_input = v.TextField(label='Name:', placeholder='Enter your first and last name')

# Password input
self.key_label = Label('Educator:')
self.key_input = Text(placeholder='Enter Your Level', password=True)
# Eductor Level input
self.key_input = v.Select(
label='Educator Level',
items=['Elementary School', 'Middle School', 'High School', 'College'])

# Next button
# Next button
self.next_button = Button(description='Next')

# Arrange labels and inputs horizontally
self.username_box = HBox([self.username_label, self.username_input])
self.key_box = HBox([self.key_label, self.key_input])
#Header
self.header = v.Container(children=[
v.Html(
tag='h1',
attributes={'title': 'a title'},
children=['Educator User Profile']
)
])


# Arrange widgets vertically
self.children = [
HTML('<h2>User Profile</h2>'), # Heading
self.username_box, # Username label and input box
self.key_box, # Password label and input box
self.header, # Heading
self.username_input, # Username label and input box
self.key_input, # Password label and input box
HBox([self.next_button], layout={'justify_content': 'flex-end'}), # Login button aligned to the right
]
29 changes: 16 additions & 13 deletions jupyter_mentor/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,28 @@ def __init__(self):
super().__init__()

# Username input
self.username_label = Label('Username:')
self.username_input = Text(placeholder='Enter username')
self.username_input = v.TextField(label='Username:', placeholder='Enter username')

# Password input
self.key_label = Label('API Key:')
self.key_input = Text(placeholder='Enter API key', password=True)
# Password input
self.key_input = v.TextField(label='API Key:', placeholder='Enter API key')

# Login button
self.login_button = Button(description='Login')

# Arrange labels and inputs horizontally
self.username_box = HBox([self.username_label, self.username_input])
self.key_box = HBox([self.key_label, self.key_input])

#Header
self.header = v.Container(children=[
v.Html(
tag='h1',
attributes={'title': 'a title'},
children=['Log In']
)
])


# Arrange widgets vertically
self.children = [
HTML('<h2>Login</h2>'), # Heading
self.username_box, # Username label and input box
self.key_box, # Password label and input box
self.header, # Heading
self.username_input, # Username label and input box
self.key_input, # Password label and input box
HBox([self.login_button], layout={'justify_content': 'flex-end'}), # Login button aligned to the right
]

58 changes: 30 additions & 28 deletions jupyter_mentor/student_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,49 +17,51 @@ def __init__(self):


# Username input
self.username_label = Label('Name/ID:')
self.username_input = Text(placeholder='Enter your name')
self.username_input = v.TextField(label='Name:', placeholder='Enter username')


# School input
self.school_label = Label('School/College:')
self.school_input = Text(placeholder='Enter Your School', password=True)
self.school_input = v.TextField(label='School:', placeholder='Enter your school')

# Year input
self.year_label = Label('Enter your Grade Level:')
self.year_input = v.Select(clearable=True, label='Grade Level', items=['Freshman', 'Sophomore', 'Junior', 'Senior'], value='')

# Major input
self.major_label = Label('Major:')
self.major_input = Text(placeholder='Enter Your Major', password=True)
self.major_input = v.TextField(label='Major:', placeholder='Enter your major')

# Minors/Certificates input
self.minor_label = Label('Minors/Certificates:')
self.minor_input = Text(placeholder='Enter Your Minors and/or Certificates', password=True)
self.minor_input = v.TextField(label='Minors/Certificates:', placeholder='Enter your minors and/or certificates')

# Interests input
self.interests_label = Label('List your outside interests:')
self.interests_input = Textarea(placeholder='Enter your outside interests', password=True)
self.interests_input = v.TextField(label='Outside Interests:', placeholder='Enter your outside interests')



# Next button
self.next_button = Button(description='Next')

# Arrange labels and inputs horizontally
self.username_box = HBox([self.username_label, self.username_input])
self.school_box = HBox([self.school_label, self.school_input])
self.year_box = HBox([self.year_label, self.year_input])
self.major_box = HBox([self.major_label, self.major_input])
self.minor_box = HBox([self.minor_label, self.minor_input])
self.interests_box = HBox([self.interests_label, self.interests_input])

# Arrange widgets vertically


#Header
self.header = v.Container(children=[
v.Html(
tag='h1',
attributes={'title': 'a title'},
children=['Student Profile']
),

v.Icon(children=['mdi-account'])


])

# Arrange widgets vertically
self.children = [
HTML('<h2>Student User Profile</h2>'), # Heading
self.username_box, # Username label and input box
self.school_box, # Password label and input box
self.year_box,
self.major_box,
self.minor_box,
self.interests_box,
self.header, # Heading
self.username_input, # Username label and input box
self.school_input, # Password label and input box
self.year_input,
self.major_input,
self.minor_input,
self.interests_input,
HBox([self.next_button], layout={'justify_content': 'flex-end'}), # Login button aligned to the right
]
90 changes: 69 additions & 21 deletions nbs/01_login.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 38,
"id": "f561c615-c749-46ad-be05-1c23b4895b1c",
"metadata": {},
"outputs": [],
Expand All @@ -12,7 +12,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 39,
"id": "543f060f-5d9b-4b76-9354-f8483575b468",
"metadata": {},
"outputs": [],
Expand All @@ -22,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 40,
"id": "112bc93b-c8cb-4576-87e9-045e953979d0",
"metadata": {},
"outputs": [],
Expand All @@ -36,7 +36,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 57,
"id": "7a9ea954-5bcd-4871-87a6-fe01fc3590f3",
"metadata": {},
"outputs": [],
Expand All @@ -48,57 +48,105 @@
" super().__init__()\n",
" \n",
" # Username input\n",
" self.username_label = Label('Username:')\n",
" self.username_input = Text(placeholder='Enter username')\n",
" self.username_input = v.TextField(label='Username:', placeholder='Enter username')\n",
" \n",
" # Password input\n",
" self.key_label = Label('API Key:')\n",
" self.key_input = Text(placeholder='Enter API key', password=True)\n",
" # Password input \n",
" self.key_input = v.TextField(label='API Key:', placeholder='Enter API key')\n",
" \n",
" # Login button\n",
" self.login_button = Button(description='Login')\n",
" \n",
" # Arrange labels and inputs horizontally\n",
" self.username_box = HBox([self.username_label, self.username_input])\n",
" self.key_box = HBox([self.key_label, self.key_input])\n",
"\n",
" #Header\n",
" self.header = v.Container(children=[\n",
" v.Html(\n",
" tag='h1',\n",
" attributes={'title': 'a title'},\n",
" children=['Log In']\n",
" )\n",
" ])\n",
"\n",
" \n",
" # Arrange widgets vertically\n",
" self.children = [\n",
" HTML('<h2>Login</h2>'), # Heading\n",
" self.username_box, # Username label and input box\n",
" self.key_box, # Password label and input box\n",
" self.header, # Heading\n",
" self.username_input, # Username label and input box\n",
" self.key_input, # Password label and input box\n",
" HBox([self.login_button], layout={'justify_content': 'flex-end'}), # Login button aligned to the right\n",
" ]\n"
" ]"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 58,
"id": "6e8d6319-0a74-4021-b604-cf66c4656cf9",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9094a779ce6a4c4588a978fb5d47e717",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Login(children=(Container(children=[Html(attributes={'title': 'a title'}, children=['Log In'], layout=None, ta…"
]
},
"execution_count": 58,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"main = Login()\n",
"main"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 59,
"id": "94fce144-391e-4917-86ea-d8e8fde8c3ca",
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"import nbdev; nbdev.nbdev_export()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ebb79ca1-824c-4eba-970b-83fa04b4af7a",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "3f26512b-9376-45c0-aa0a-51fd82356acb",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "python3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.19"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 5e988c4

Please sign in to comment.