Skip to content

Commit

Permalink
Edited student and educator course overview
Browse files Browse the repository at this point in the history
  • Loading branch information
namitasshah committed Apr 2, 2024
1 parent 247da11 commit c5f2df8
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 86 deletions.
6 changes: 3 additions & 3 deletions jupyter_mentor/educator_course_overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# %% ../nbs/04_educator_course_overview.ipynb 1
from .file_viewer import FileViewer
import ipywidgets as widgets
from ipywidgets import VBox, HBox, HTML, Button, Label, Text, Checkbox, Accordion, FileUpload
from ipywidgets import VBox, HBox, HTML, Button, Label, Text, Textarea, Checkbox, Accordion, FileUpload
from IPython.display import display, clear_output
import ipyvuetify as v
from traitlets import observe
Expand All @@ -26,7 +26,7 @@ def __init__(self, file_viewer):

# Course overview text
self.course_overview_label = Label('Course Overview:')
self.course_overview_text = Text(placeholder='Enter course overview')
self.course_overview_text = Textarea(placeholder='Enter course overview')

# AI Guidelines text
self.ai_guidelines_label = Label('AI Guidelines:')
Expand All @@ -41,7 +41,7 @@ def __init__(self, file_viewer):

# Open-ended response textbox
self.open_ended_label = Label('Open-ended Response:')
self.open_ended_text = Text(placeholder='Enter open-ended response')
self.open_ended_text = Textarea(placeholder='Enter open-ended response')

# Next button
self.next_button = Button(description='Next')
Expand Down
35 changes: 3 additions & 32 deletions jupyter_mentor/student_course_overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,19 @@

# %% ../nbs/14_student_course_overview.ipynb 2
class StudentCourseOverview(VBox):

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

# 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 = Text(placeholder='Enter course overview')

# AI Guidelines text
self.ai_guidelines_label = Label('AI Guidelines:')


# Binary features checkboxes
self.step_by_step_checkbox = Checkbox(description='Step-by-Step')
self.metaphor_checkbox = Checkbox(description='Metaphor')
self.hints_checkbox = Checkbox(description='Hints')
self.ai_guided_questions_checkbox = Checkbox(description='AI Guided Questions')


# Open-ended response textbox
self.open_ended_label = Label('Open-ended Response:')
self.open_ended_text = Text(placeholder='Enter open-ended response')

# self.course_overview_text = Text(placeholder=‘Enter course overview’)
# Next button
self.next_button = Button(description='Next')

# Arrange widgets vertically
self.children = [
HTML('<h2>Course Overview</h2>'), # Heading
HBox([self.file_upload, self.file_upload_button]), # File upload button
self.file_viewer,
self.course_overview_label, 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
HBox([self.next_button], layout={'justify_content': 'flex-end'}),
self.course_overview_label, # Course overview
HBox([self.next_button], layout={'justify_content': 'flex-end'}),
]
44 changes: 36 additions & 8 deletions nbs/04_educator_course_overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "0320fe7e-0ec7-4dd1-90c2-74a3e25bab86",
"metadata": {},
"outputs": [],
"source": [
"#| export\n",
"from jupyter_mentor.file_viewer import FileViewer\n",
"import ipywidgets as widgets\n",
"from ipywidgets import VBox, HBox, HTML, Button, Label, Text, Checkbox, Accordion, FileUpload\n",
"from ipywidgets import VBox, HBox, HTML, Button, Label, Text, Textarea, Checkbox, Accordion, FileUpload\n",
"from IPython.display import display, clear_output\n",
"import ipyvuetify as v\n",
"from traitlets import observe"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "f0e47085-1303-4292-b752-0ee05eef872d",
"metadata": {},
"outputs": [],
Expand All @@ -49,7 +49,7 @@
" \n",
" # Course overview text\n",
" self.course_overview_label = Label('Course Overview:')\n",
" self.course_overview_text = Text(placeholder='Enter course overview')\n",
" self.course_overview_text = Textarea(placeholder='Enter course overview')\n",
" \n",
" # AI Guidelines text\n",
" self.ai_guidelines_label = Label('AI Guidelines:')\n",
Expand All @@ -64,7 +64,7 @@
" \n",
" # Open-ended response textbox\n",
" self.open_ended_label = Label('Open-ended Response:')\n",
" self.open_ended_text = Text(placeholder='Enter open-ended response')\n",
" self.open_ended_text = Textarea(placeholder='Enter open-ended response')\n",
"\n",
" # Next button\n",
" self.next_button = Button(description='Next')\n",
Expand All @@ -85,10 +85,26 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "54fb4f23-dabc-4109-a482-feee5c130f36",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "7d253ac8e62941d3abb3524b47d6ba5f",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"EducatorCourseOverview(children=(HTML(value='<h2>Course Overview</h2>'), HBox(children=(FileUpload(value=(), d…"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"file_viewer = FileViewer()\n",
"main = EducatorCourseOverview(file_viewer)\n",
Expand Down Expand Up @@ -133,9 +149,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
111 changes: 68 additions & 43 deletions nbs/14_student_course_overview.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": 2,
"id": "b8b8cb16-2ceb-4b93-b5f5-615270d1b9b2",
"metadata": {},
"outputs": [],
Expand All @@ -12,7 +12,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "0320fe7e-0ec7-4dd1-90c2-74a3e25bab86",
"metadata": {},
"outputs": [],
Expand All @@ -28,67 +28,53 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"id": "f0e47085-1303-4292-b752-0ee05eef872d",
"metadata": {},
"outputs": [],
"source": [
"#| export\n",
"\n",
"class StudentCourseOverview(VBox):\n",
" \n",
" def __init__(self, file_viewer):\n",
" super().__init__()\n",
"\n",
" # File Upload button\n",
" self.file_upload = FileUpload(accept='', multiple=False)\n",
" self.file_upload_button = Button(description='Upload')\n",
"\n",
" # global file viewer (that has model)\n",
" self.file_viewer = file_viewer\n",
" \n",
" # Course overview text\n",
" self.course_overview_label = Label('Course Overview:')\n",
" self.course_overview_text = Text(placeholder='Enter course overview')\n",
" \n",
" # AI Guidelines text\n",
" self.ai_guidelines_label = Label('AI Guidelines:')\n",
" \n",
" \n",
" # Binary features checkboxes\n",
" self.step_by_step_checkbox = Checkbox(description='Step-by-Step')\n",
" self.metaphor_checkbox = Checkbox(description='Metaphor')\n",
" self.hints_checkbox = Checkbox(description='Hints')\n",
" self.ai_guided_questions_checkbox = Checkbox(description='AI Guided Questions')\n",
" \n",
" \n",
" # Open-ended response textbox\n",
" self.open_ended_label = Label('Open-ended Response:')\n",
" self.open_ended_text = Text(placeholder='Enter open-ended response')\n",
"\n",
" # self.course_overview_text = Text(placeholder=‘Enter course overview’)\n",
" # Next button\n",
" self.next_button = Button(description='Next')\n",
" \n",
" # Arrange widgets vertically\n",
" self.children = [\n",
" HTML('<h2>Course Overview</h2>'), # Heading\n",
" HBox([self.file_upload, self.file_upload_button]), # File upload button\n",
" self.file_viewer,\n",
" self.course_overview_label, self.course_overview_text, # Course overview\n",
" self.ai_guidelines_label, # AI Guidelines\n",
" VBox([self.step_by_step_checkbox, self.metaphor_checkbox,\n",
" self.hints_checkbox, self.ai_guided_questions_checkbox]), # Binary features checkboxes\n",
" self.open_ended_label, self.open_ended_text, # Open-ended response\n",
" HBox([self.next_button], layout={'justify_content': 'flex-end'}), \n",
" self.course_overview_label, # Course overview\n",
" HBox([self.next_button], layout={'justify_content': 'flex-end'}),\n",
" ]"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"id": "54fb4f23-dabc-4109-a482-feee5c130f36",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6cd5a709d7604eb18144998093897f22",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"StudentCourseOverview(children=(HTML(value='<h2>Course Overview</h2>'), FileViewer(children=(Accordion(childre…"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"file_viewer = FileViewer()\n",
"main = StudentCourseOverview(file_viewer)\n",
Expand All @@ -97,10 +83,26 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"id": "55ed3ffc-d154-4b77-9117-6f580fbeb0fe",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ec743a4863544cc1ac2e461a64d4373c",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Container(children=[Html(attributes={'title': 'a title'}, children=['My heading'], layout=None, tag='h1')], la…"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"v.Container(children=[\n",
" v.Html(\n",
Expand All @@ -113,10 +115,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"id": "11872b33-a907-4acb-9537-0a2f4237d791",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/_namitashah_/anaconda3/envs/jupyter-mentor/lib/python3.8/site-packages/nbdev/export.py:54: UserWarning: Notebook '/Users/_namitashah_/Desktop/gt/jupyter-mentor/nbs/00_main.ipynb' uses `#|export` without `#|default_exp` cell.\n",
"Note nbdev2 no longer supports nbdev1 syntax. Run `nbdev_migrate` to upgrade.\n",
"See https://nbdev.fast.ai/getting_started.html for more information.\n",
" warn(f\"Notebook '{nbname}' uses `#|export` without `#|default_exp` cell.\\n\"\n"
]
}
],
"source": [
"#| hide\n",
"import nbdev; nbdev.nbdev_export()"
Expand All @@ -133,9 +146,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

0 comments on commit c5f2df8

Please sign in to comment.