Skip to content

Commit

Permalink
Added student profile and edited textbox for educator profile
Browse files Browse the repository at this point in the history
  • Loading branch information
namitasshah committed Apr 1, 2024
1 parent 431b27e commit ac69d42
Show file tree
Hide file tree
Showing 3 changed files with 229 additions and 1 deletion.
66 changes: 66 additions & 0 deletions jupyter_mentor/student_profile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/12_student_profile.ipynb.

# %% auto 0
__all__ = ['StudentProfile']

# %% ../nbs/12_student_profile.ipynb 1
import ipywidgets as widgets
from ipywidgets import VBox, HTML, HBox, Label, Tab, Output, Button, Text, Textarea
from IPython.display import display, clear_output
import ipyvuetify as v

# %% ../nbs/12_student_profile.ipynb 2
class StudentProfile(widgets.VBox):

def __init__(self):
super().__init__()


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

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

# 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)

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

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



# 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
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,
HBox([self.next_button], layout={'justify_content': 'flex-end'}), # Login button aligned to the right
]
14 changes: 13 additions & 1 deletion nbs/02_educator_profile.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,21 @@
],
"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
150 changes: 150 additions & 0 deletions nbs/12_student_profile.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "2df4d2d5-3e88-45a1-ba93-33884367b767",
"metadata": {},
"outputs": [],
"source": [
"#| default_exp student_profile"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "04513d03-ca81-4315-bd67-4a6e10cec378",
"metadata": {},
"outputs": [],
"source": [
"#| export\n",
"import ipywidgets as widgets\n",
"from ipywidgets import VBox, HTML, HBox, Label, Tab, Output, Button, Text, Textarea\n",
"from IPython.display import display, clear_output\n",
"import ipyvuetify as v"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "0c3f213a-6037-4df2-a402-b10e146f1794",
"metadata": {},
"outputs": [],
"source": [
"#| export\n",
"class StudentProfile(widgets.VBox):\n",
" \n",
" def __init__(self):\n",
" super().__init__()\n",
"\n",
" \n",
" # Username input\n",
" self.username_label = Label('Name/ID:')\n",
" self.username_input = Text(placeholder='Enter your name')\n",
" \n",
" # School input\n",
" self.school_label = Label('School/College:')\n",
" self.school_input = Text(placeholder='Enter Your School', password=True)\n",
"\n",
" # Year input\n",
" self.year_label = Label('Enter your Grade Level:')\n",
" self.year_input = v.Select(clearable=True, label='Grade Level', items=['Freshman', 'Sophomore', 'Junior', 'Senior'], value='')\n",
"\n",
" # Major input\n",
" self.major_label = Label('Major:')\n",
" self.major_input = Text(placeholder='Enter Your Major', password=True)\n",
"\n",
" # Minors/Certificates input\n",
" self.minor_label = Label('Minors/Certificates:')\n",
" self.minor_input = Text(placeholder='Enter Your Minors and/or Certificates', password=True)\n",
"\n",
" # Interests input\n",
" self.interests_label = Label('List your outside interests:')\n",
" self.interests_input = Textarea(placeholder='Enter your outside interests', password=True)\n",
"\n",
" \n",
" # Next button\n",
" self.next_button = Button(description='Next')\n",
" \n",
" # Arrange labels and inputs horizontally\n",
" self.username_box = HBox([self.username_label, self.username_input])\n",
" self.school_box = HBox([self.school_label, self.school_input])\n",
" self.year_box = HBox([self.year_label, self.year_input])\n",
" self.major_box = HBox([self.major_label, self.major_input])\n",
" self.minor_box = HBox([self.minor_label, self.minor_input])\n",
" self.interests_box = HBox([self.interests_label, self.interests_input])\n",
" \n",
" # Arrange widgets vertically\n",
" self.children = [\n",
" HTML('<h2>Student User Profile</h2>'), # Heading\n",
" self.username_box, # Username label and input box\n",
" self.school_box, # Password label and input box\n",
" self.year_box,\n",
" self.major_box,\n",
" self.minor_box,\n",
" self.interests_box,\n",
" HBox([self.next_button], layout={'justify_content': 'flex-end'}), # Login button aligned to the right\n",
" ]"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "11eb898f-c1c0-4651-ae5d-64270f663d2f",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "eca20a9d55d843d9988d2513153cdf15",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"StudentProfile(children=(HTML(value='<h2>Student User Profile</h2>'), HBox(children=(Label(value='Name/ID:'), …"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"profile = StudentProfile()\n",
"profile"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "aaa187b8-594b-4ee4-9c35-c9c2faee67e8",
"metadata": {},
"outputs": [],
"source": [
"#| hide\n",
"import nbdev; nbdev.nbdev_export()"
]
}
],
"metadata": {
"kernelspec": {
"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,
"nbformat_minor": 5
}

0 comments on commit ac69d42

Please sign in to comment.