@@ -16,6 +16,9 @@ function createInstructorToolsMenu(){
16
16
if ( lastvalue == 'Insert Data Entry Table...' ) {
17
17
get_table_dim ( ) ;
18
18
}
19
+ if ( lastvalue == 'Mark Cell as Instructions' ) {
20
+ indicate_cell_contains_instructions ( ) ;
21
+ }
19
22
if ( lastvalue == 'Protect Selected Cells' ) {
20
23
protect_selected_cells ( ) ;
21
24
}
@@ -57,6 +60,9 @@ function createInstructorToolsMenu(){
57
60
Instructor Tools</option>' ;
58
61
optiontxt += '<option title="Insert cell below selected and create a \
59
62
data entry table.">Insert Data Entry Table...</option>' ;
63
+ optiontxt += '<option title="Add light blue color bar to left of \
64
+ markdown cell. Used to indicate instructions.">Mark Cell as \
65
+ Instructions</option>' ;
60
66
optiontxt += '<option disabled>----</option>' ;
61
67
optiontxt += '<option title="Prevent editing of selected cells."> \
62
68
Protect Selected Cells</option>' ;
@@ -206,6 +212,18 @@ function insert_getnames_timestamp(){
206
212
protect_selected_cells ( ) ;
207
213
}
208
214
215
+ function indicate_cell_contains_instructions ( ) {
216
+ var text = '<div style="border-color:lightblue;border-style:solid; \
217
+ float:left;height:100%;margin-right:4px;"></div>\n\n' ;
218
+ JPSLUtils . insert_text_at_beginning_of_current_cell ( text ) ;
219
+ var currentcell = Jupyter . notebook . get_selected_cell ( ) ;
220
+ var cellindex = Jupyter . notebook . find_cell_index ( currentcell ) ;
221
+ Jupyter . notebook . to_code ( cellindex ) ;
222
+ Jupyter . notebook . to_markdown ( cellindex ) ;
223
+ Jupyter . notebook . focus_cell ( ) ;
224
+ Jupyter . notebook . get_selected_cell ( ) . execute ( ) ;
225
+ }
226
+
209
227
function insert_init_boilerplate ( ) {
210
228
var mkdstr = "### You must initialize the software each time you use \
211
229
this notebook.\n" ;
0 commit comments