From c5f2df8427c31e4690d9a57ff98b2afcb34bef98 Mon Sep 17 00:00:00 2001 From: Namita Shah Date: Tue, 2 Apr 2024 13:39:49 -0700 Subject: [PATCH] Edited student and educator course overview --- jupyter_mentor/educator_course_overview.py | 6 +- jupyter_mentor/student_course_overview.py | 35 +------ nbs/04_educator_course_overview.ipynb | 44 ++++++-- nbs/14_student_course_overview.ipynb | 111 +++++++++++++-------- 4 files changed, 110 insertions(+), 86 deletions(-) diff --git a/jupyter_mentor/educator_course_overview.py b/jupyter_mentor/educator_course_overview.py index 5399f43..0e50c21 100644 --- a/jupyter_mentor/educator_course_overview.py +++ b/jupyter_mentor/educator_course_overview.py @@ -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 @@ -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:') @@ -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') diff --git a/jupyter_mentor/student_course_overview.py b/jupyter_mentor/student_course_overview.py index 028c4df..25b81ff 100644 --- a/jupyter_mentor/student_course_overview.py +++ b/jupyter_mentor/student_course_overview.py @@ -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('

Course Overview

'), # 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'}), ] diff --git a/nbs/04_educator_course_overview.ipynb b/nbs/04_educator_course_overview.ipynb index eea3c88..db1a0dc 100644 --- a/nbs/04_educator_course_overview.ipynb +++ b/nbs/04_educator_course_overview.ipynb @@ -12,7 +12,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "0320fe7e-0ec7-4dd1-90c2-74a3e25bab86", "metadata": {}, "outputs": [], @@ -20,7 +20,7 @@ "#| 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" @@ -28,7 +28,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "f0e47085-1303-4292-b752-0ee05eef872d", "metadata": {}, "outputs": [], @@ -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", @@ -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", @@ -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='

Course Overview

'), HBox(children=(FileUpload(value=(), d…" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "file_viewer = FileViewer()\n", "main = EducatorCourseOverview(file_viewer)\n", @@ -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, diff --git a/nbs/14_student_course_overview.ipynb b/nbs/14_student_course_overview.ipynb index d312e3a..be3ca1d 100644 --- a/nbs/14_student_course_overview.ipynb +++ b/nbs/14_student_course_overview.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "b8b8cb16-2ceb-4b93-b5f5-615270d1b9b2", "metadata": {}, "outputs": [], @@ -12,7 +12,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "0320fe7e-0ec7-4dd1-90c2-74a3e25bab86", "metadata": {}, "outputs": [], @@ -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('

Course Overview

'), # 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='

Course Overview

'), FileViewer(children=(Accordion(childre…" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "file_viewer = FileViewer()\n", "main = StudentCourseOverview(file_viewer)\n", @@ -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", @@ -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()" @@ -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,