{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true, "id": "brzvVeAsYiG2" }, "source": [ "" ] }, { "cell_type": "markdown", "metadata": { "id": "WMKrKfx8_3fc" }, "source": [ "# Instructor Grading and Assessment\n", "This notebook executes grading of student submissions of chats with ChatGPT, exported in JSON. Run each cell should be run in order, and follow the prompts displayed when appropriate." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "id": "696FqPrTYiG3" }, "outputs": [], "source": [ "import ipywidgets as widgets\n", "from IPython.display import display, HTML, clear_output\n", "import io\n", "import zipfile\n", "import os\n", "import json\n", "import pandas as pd\n", "import glob\n", "from getpass import getpass" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "id": "fTlnrMwmYiG4" }, "outputs": [], "source": [ "# \"global\" variables modified by mutability\n", "grade_settings = {'learning_objectives':None,\n", " 'json_file_path':None,\n", " 'json_files':None }" ] }, { "cell_type": "markdown", "metadata": { "id": "jb0jnIE14Vuh" }, "source": [ "The `InstructorGradingConfig` holds the contents of the instantiated object including making graindg settings, extracting files from a zip archive, loading JSON files into DataFrames, and displaying relevant information in the output widget." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "id": "mPLdaWiuYiG4" }, "outputs": [], "source": [ "class InstructorGradingConfig:\n", " def __init__(self):\n", " # layouts to help with styling\n", " self.items_layout = widgets.Layout(width='auto')\n", "\n", " self.box_layout = widgets.Layout(display='flex',\n", " flex_flow='column',\n", " align_items='stretch',\n", " width='50%',\n", " border='solid 1px gray',\n", " padding='0px 30px 20px 30px')\n", "\n", " # Create all components\n", " self.ui_title = widgets.HTML(value=\"
\n", " | timestamp | \n", "author | \n", "message | \n", "filename | \n", "question_label | \n", "
---|---|---|---|---|---|
0 | \n", "2023-06-08T15:30:00 | \n", "user | \n", "What are the differences between stacks and queues? | \n", "demo_json/cs_demo.json | \n", "self study | \n", "
2 | \n", "2023-06-08T15:32:15 | \n", "user | \n", "Can you list examples of when you would want to use stacks over queues and vice versa? | \n", "demo_json/cs_demo.json | \n", "self study | \n", "
4 | \n", "2023-06-08T15:35:10 | \n", "user | \n", "Given the following two learning objectives: Objective 1: Understand the differences stacks and queues... Is there anything else I need to know? | \n", "demo_json/cs_demo.json | \n", "self study | \n", "
6 | \n", "2023-06-08T15:38:25 | \n", "user | \n", "I think I understand the material. Please generate a five question, multiple-choice quiz for me on the material we have just discussed... | \n", "demo_json/cs_demo.json | \n", "self study quiz | \n", "
9 | \n", "2023-06-08T15:40:47 | \n", "user | \n", "A | \n", "demo_json/cs_demo.json | \n", "self study quiz | \n", "
12 | \n", "2023-06-08T15:42:22 | \n", "user | \n", "A | \n", "demo_json/cs_demo.json | \n", "self study quiz | \n", "
15 | \n", "2023-06-08T15:43:57 | \n", "user | \n", "B | \n", "demo_json/cs_demo.json | \n", "self study quiz | \n", "
18 | \n", "2023-06-08T15:45:32 | \n", "user | \n", "C | \n", "demo_json/cs_demo.json | \n", "self study quiz | \n", "
21 | \n", "2023-06-08T15:47:07 | \n", "user | \n", "A | \n", "demo_json/cs_demo.json | \n", "self study quiz | \n", "
23 | \n", "2023-06-08T15:49:07 | \n", "user | \n", "I am ready for a final quiz on this chapter. Do not repeat any questions that you have given me already. Generate a five question, multiple-choice quiz for me on the material. As I answer each question, tell me whether I got it correct or not, and if I was incorrect, explain why. Please ask me questions one at a time and wait for my response (and your assessment) before asking me the next question. | \n", "demo_json/cs_demo.json | \n", "final assessment | \n", "
\n", " | timestamp | \n", "author | \n", "message | \n", "filename | \n", "question_label | \n", "
---|---|---|---|---|---|
1 | \n", "2023-06-07T08:05:00Z | \n", "user | \n", "How do you capitalize expenses using typical information in firm financial disclosures? | \n", "demo_json/demo_json.json | \n", "self study | \n", "
3 | \n", "2023-06-07T08:06:00Z | \n", "user | \n", "Yes | \n", "demo_json/demo_json.json | \n", "self study | \n", "
5 | \n", "2023-06-07T08:12:00Z | \n", "user | \n", "Given the following two learning objectives: Objective 1: Understand how to capitalize expenses so they can be incorporated into an estimate of corporate earnings. Objective 2: Understand what kinds of expenses should be capitalized and why. Is there anything else I need to know? | \n",
" demo_json/demo_json.json | \n", "self study | \n", "
7 | \n", "2023-06-07T08:15:00Z | \n", "user | \n", "I think I understand the material. Please generate a five-question, multiple-choice quiz for me on the material we have just discussed. As I answer each question, tell me whether I got it correct or not, and if I was incorrect, explain why. Please ask me questions one at a time and wait for my response (and your assessment) before asking me the next question. | \n", "demo_json/demo_json.json | \n", "self study quiz | \n", "
10 | \n", "2023-06-07T08:16:30Z | \n", "user | \n", "C | \n", "demo_json/demo_json.json | \n", "self study quiz | \n", "
13 | \n", "2023-06-07T08:18:00Z | \n", "user | \n", "A | \n", "demo_json/demo_json.json | \n", "self study quiz | \n", "
16 | \n", "2023-06-07T08:19:30Z | \n", "user | \n", "D | \n", "demo_json/demo_json.json | \n", "self study quiz | \n", "
19 | \n", "2023-06-07T08:21:00Z | \n", "user | \n", "C | \n", "demo_json/demo_json.json | \n", "self study quiz | \n", "
22 | \n", "2023-06-07T08:22:30Z | \n", "user | \n", "C | \n", "demo_json/demo_json.json | \n", "self study quiz | \n", "
25 | \n", "2023-06-07T08:24:00Z | \n", "user | \n", "B | \n", "demo_json/demo_json.json | \n", "self study quiz | \n", "
\n", " | Here is the table with the question number, question content, answer, whether or not the student answered correctly on the first try, and the number of attempts it took to get the right answer: | \n", "
---|---|
0 | \n", "| Question Number | Question Content | Answer | Correct on First Try | Number of Attempts | | \n", "
1 | \n", "|-----------------|-----------------|--------|----------------------|--------------------| | \n", "
2 | \n", "| 1 | | C | Yes | 1 | | \n", "
3 | \n", "| 2 | | A | No | 1 | | \n", "
4 | \n", "| 3 | | D | Yes | 2 | | \n", "
5 | \n", "| 4 | | C | Yes | 1 | | \n", "
6 | \n", "| 5 | | B | Yes | 1 | | \n", "
7 | \n", "To calculate the quiz grade, we will only count the questions where the student answered correctly on the first try. In this case, the student answered questions 1, 3, 4, and 5 correctly on the first try. Therefore, the quiz grade would be 4 out of 5, or 80%. | \n", "