File size: 15,615 Bytes
10de3c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# self_study_prompts.ipynb\n",
    "> A listing of all prompts for self-study\n",
    "\n",
    "This notebook contains all prompts used for self-study as a central place that can be monitored and evaluated for appropriate functionality. Note that these perform the requests part of the prompts.\n",
    "\n",
    ":::{.callout-caution}\n",
    "These notebooks are development notebooks, meaning that they are meant to be run locally or somewhere that supports navigating a full repository (in other words, not Google Colab unless you clone the entire repository to drive and then mount the Drive-Repository.) However, it is expected if you're able to do all of those steps, you're likely also able to figure out the required pip installs for development there.\n",
    ":::"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    "---\n",
    "skip_exec: true\n",
    "---"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#| default_exp SelfStudyPrompts"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Self-study texts\n",
    "We'll now define the text for our self-study questions. Note that these will align with `assessment_request` in the `PromptInteractionBase` module."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#| export\n",
    "# used for pretty display\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#| export\n",
    "MC_QUIZ_DEFAULT = \"Please design a 5 question multiple choice quiz about the provided text.\"\n",
    "\n",
    "SHORT_ANSWER_DEFAULT = (\"Please design a 5 question short answer quiz about the provided text. \"\n",
    "                        \"The question types should be short answer. Expect the correct answers to be a few sentences long.\")\n",
    "\n",
    "FILL_BLANK_DEFAULT = \"\"\"Create a 5 question fill in the blank quiz referencing parts of the provided text.\n",
    "The \"blank\" part of the question should appear as \"________\". The answers should reflect what word(s) should go in the blank an accurate statement.\n",
    "An example is as follows: \"The author of the book is ______.\" The question should be a statement.\n",
    "\"\"\"\n",
    "\n",
    "SEQUENCING_DEFAULT = \"\"\"Create a 5 question questionnaire that will ask me to recall the steps or sequence of events\n",
    "in the provided text.\"\"\"\n",
    "\n",
    "RELATIONSHIP_DEFAULT = (\"Create a 5 question quiz for the student that asks the student to identify relationships between\"\n",
    "                        \"topics or concepts that are important to understanding this text.\")\n",
    "\n",
    "CONCEPTS_DEFAULT = \"\"\" Design a 5 question quiz that asks me about definitions or concepts of importance in the provided text.\"\"\"\n",
    "\n",
    "REAL_WORLD_EXAMPLE_DEFAULT = \"\"\"Demonstrate how the provided context can be applied to solve a real world problem.\n",
    "Ask me questions about how the demonstration you provided relates to solving a real world problem.\"\"\"\n",
    "\n",
    "RANDOMIZED_QUESTIONS_DEFAULT = \"\"\"Generate a high-quality assessment consisting of 5 varied questions,\n",
    "each of different types (open-ended, multiple choice, short answer, analogies, etc.)\"\"\"\n",
    "\n",
    "SELF_STUDY_PROMPT_NAMES = ['MC_QUIZ_DEFAULT',\n",
    "'SHORT_ANSWER_DEFAULT',\n",
    "'FILL_BLANK_DEFAULT',\n",
    "'SEQUENCING_DEFAULT',\n",
    "'RELATIONSHIP_DEFAULT',\n",
    "'CONCEPTS_DEFAULT',\n",
    "'REAL_WORLD_EXAMPLE_DEFAULT',\n",
    "'RANDOMIZED_QUESTIONS_DEFAULT']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Create functions to assist with creating prompts\n",
    "Now, we'll use this section in order to create some functions which will allow the user to display all available prompts."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#| export\n",
    "# Define self study dictionary for lookup\n",
    "SELF_STUDY_DEFAULTS = {'mc': MC_QUIZ_DEFAULT,\n",
    "'short_answer': SHORT_ANSWER_DEFAULT,\n",
    "'fill_blank': FILL_BLANK_DEFAULT,\n",
    "'sequencing': SEQUENCING_DEFAULT,\n",
    "'relationships': RELATIONSHIP_DEFAULT,\n",
    "'concepts': CONCEPTS_DEFAULT,\n",
    "'real_world_example': REAL_WORLD_EXAMPLE_DEFAULT,\n",
    "'randomized_questions': RANDOMIZED_QUESTIONS_DEFAULT\n",
    "} \n",
    "\n",
    "# Return list of all self study prompts\n",
    "def list_all_self_study_prompt_keys():\n",
    "    return list(SELF_STUDY_DEFAULTS.keys())\n",
    "\n",
    "def list_all_self_study_prompts():\n",
    "    return list(SELF_STUDY_DEFAULTS.values())\n",
    "    \n",
    "# Return list of all self study variable names\n",
    "def list_default_self_prompt_varnames():\n",
    "    return SELF_STUDY_PROMPT_NAMES\n",
    "\n",
    "# Print as a table\n",
    "def print_all_self_study_prompts():\n",
    "    with pd.option_context('max_colwidth', None):\n",
    "        display(pd.DataFrame({'SELF_STUDY_DEFAULTS key': list(SELF_STUDY_DEFAULTS.keys()),\n",
    "        'Prompt': list(SELF_STUDY_DEFAULTS.values())}))\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now, we'll have quick unit test just to make sure this is working correctly."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['mc',\n",
       " 'short_answers',\n",
       " 'fill_blanks',\n",
       " 'sequencing',\n",
       " 'relationships',\n",
       " 'concepts',\n",
       " 'real_world_example',\n",
       " 'randomized_questions']"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list_all_self_study_prompt_keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Please design a 5 question quiz about the provided text.',\n",
       " 'Please design a 5 question short answer quiz about the provided text. The question types should be short answer. Expect the correct answers to be a few sentences long.',\n",
       " 'Create a 5 question fill in the blank quiz referencing parts of the provided text.\\nThe \"blank\" part of the question should appear as \"________\". The answers should reflect what word(s) should go in the blank an accurate statement.\\nAn example is as follows: \"The author of the book is ______.\" The question should be a statement.\\n',\n",
       " 'Create a 5 question questionnaire that will ask me to recall the steps or sequence of events\\nin the provided text.',\n",
       " 'Please design a 5 question quiz that asks me to draw or explain relationships\\nbetween important concepts or topics in the provided text.',\n",
       " ' Design a 5 question quiz that asks me about definitions or concepts of importance in the provided text.',\n",
       " 'Demonstrate how the provided context can be applied to solve a real world problem.\\nAsk me questions about how the demonstration you provided relates to solving a real world problem.',\n",
       " 'Generate a high-quality assessment consisting of 5 varied questions,\\neach of different types (open-ended, multiple choice, short answer, analogies, etc.)']"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list_all_self_study_prompts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['MC_QUIZ_DEFAULT',\n",
       " 'SHORT_ANSWER_DEFAULT',\n",
       " 'FILL_BLANK_DEFAULT',\n",
       " 'SEQUENCING_DEFAULT',\n",
       " 'RELATIONSHIP_DEFAULT',\n",
       " 'CONCEPTS_DEFAULT',\n",
       " 'REAL_WORLD_EXAMPLE_DEFAULT',\n",
       " 'RANDOMIZED_QUESTIONS_DEFAULT']"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list_default_self_prompt_varnames()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Variable Name</th>\n",
       "      <th>Prompt</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>mc</td>\n",
       "      <td>Please design a 5 question quiz about the provided text.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>short_answers</td>\n",
       "      <td>Please design a 5 question short answer quiz about the provided text. The question types should be short answer. Expect the correct answers to be a few sentences long.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>fill_blanks</td>\n",
       "      <td>Create a 5 question fill in the blank quiz referencing parts of the provided text.\\nThe \"blank\" part of the question should appear as \"________\". The answers should reflect what word(s) should go in the blank an accurate statement.\\nAn example is as follows: \"The author of the book is ______.\" The question should be a statement.\\n</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>sequencing</td>\n",
       "      <td>Create a 5 question questionnaire that will ask me to recall the steps or sequence of events\\nin the provided text.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>relationships</td>\n",
       "      <td>Please design a 5 question quiz that asks me to draw or explain relationships\\nbetween important concepts or topics in the provided text.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>concepts</td>\n",
       "      <td>Design a 5 question quiz that asks me about definitions or concepts of importance in the provided text.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>real_world_example</td>\n",
       "      <td>Demonstrate how the provided context can be applied to solve a real world problem.\\nAsk me questions about how the demonstration you provided relates to solving a real world problem.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>randomized_questions</td>\n",
       "      <td>Generate a high-quality assessment consisting of 5 varied questions,\\neach of different types (open-ended, multiple choice, short answer, analogies, etc.)</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Variable Name  \\\n",
       "0                    mc   \n",
       "1         short_answers   \n",
       "2           fill_blanks   \n",
       "3            sequencing   \n",
       "4         relationships   \n",
       "5              concepts   \n",
       "6    real_world_example   \n",
       "7  randomized_questions   \n",
       "\n",
       "                                                                                                                                                                                                                                                                                                                                         Prompt  \n",
       "0                                                                                                                                                                                                                                                                                      Please design a 5 question quiz about the provided text.  \n",
       "1                                                                                                                                                                       Please design a 5 question short answer quiz about the provided text. The question types should be short answer. Expect the correct answers to be a few sentences long.  \n",
       "2  Create a 5 question fill in the blank quiz referencing parts of the provided text.\\nThe \"blank\" part of the question should appear as \"________\". The answers should reflect what word(s) should go in the blank an accurate statement.\\nAn example is as follows: \"The author of the book is ______.\" The question should be a statement.\\n  \n",
       "3                                                                                                                                                                                                                           Create a 5 question questionnaire that will ask me to recall the steps or sequence of events\\nin the provided text.  \n",
       "4                                                                                                                                                                                                     Please design a 5 question quiz that asks me to draw or explain relationships\\nbetween important concepts or topics in the provided text.  \n",
       "5                                                                                                                                                                                                                                       Design a 5 question quiz that asks me about definitions or concepts of importance in the provided text.  \n",
       "6                                                                                                                                                        Demonstrate how the provided context can be applied to solve a real world problem.\\nAsk me questions about how the demonstration you provided relates to solving a real world problem.  \n",
       "7                                                                                                                                                                                    Generate a high-quality assessment consisting of 5 varied questions,\\neach of different types (open-ended, multiple choice, short answer, analogies, etc.)  "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "print_all_self_study_prompts()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "python3",
   "language": "python",
   "name": "python3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}