Skip to content

Instantly share code, notes, and snippets.

View acbart's full-sized avatar

Austin Cory Bart acbart

View GitHub Profile
@acbart
acbart / mutable_data_examples.py
Created August 14, 2022 15:54
Mutable Data Code from CS1 Bakery Assignment
# Comment out each section's triple quotes to show or hide them!
"""
def double(number: int) -> int:
new_number = number * 2
return new_number
def double_mutate(number: int) -> int:
number = number * 2
return number
@acbart
acbart / vip_ideas.md
Last active October 9, 2024 08:48
Vague Project ideas for the Digital Education VIP F22

These are some vague ideas for projects I am working on or starting, and could use some interested students to engage with!

Apply at: https://vip.udel.edu/projects/Digital-Education

  1. Canvas extensions via Userscript, many ways we can do more here: https://github.com/UD-CIS-Teaching/more-canvas-tools/
  2. Extending, documenting, testing, building out the Pedal project (sophisticated autograding framework): https://pedal-edu.github.io/
  3. Game development library for CS1, meant to be truly novice friendly: https://designer-edu.github.io/
  4. Analyzing the huge quantity of autograding data from CISC108 that I've collected over the years and utterly failed to capitalize on correctly.
  5. Properly dockerizing BlockPy so that it's much easier for others to use
  6. Porting over the CT@VT curriculum to use BlockPy more extensively: https://ct-vt.github.io/

A.6.2. Code - Complex Formula: Write print statements that print the result of some complex formula bakery_intro_math_code_complex_formula

A.7.1. Code - Print Logic: Write print statements that print the result of basic logical comparisons bakery_intro_logic_code_print_logic

A.8.1. Code - Quick Calculation: Evaluate some simple math expressions bakery_intro_eval_code_quick_calc

B.1.1. Code - Print Variable: Write a program that assigns integer values, string values, and boolean values to a variable and then prints the value of the variables. Gives some as an example. bakery_intro_variables_code_print_variables

@acbart
acbart / middle_function.py
Created August 12, 2022 17:27
Middle Function Example
from bakery import assert_equal
def middle(text: str, length: int) -> str:
""" Determine the middle character of a string """
index = length // 2
letter = text[index]
return letter
assert_equal(middle("Hello", 5), "l")
assert_equal(middle("Frog", 4), "o")
@acbart
acbart / tracing_ifs_example_vehicles.py
Created August 12, 2022 16:07
Tracing Ifs Example Vehicles
travellers = 4
suitcases = 3
bookbags = 2
def choose_vehicle(travellers: int, bags: int) -> str:
space = bags // 2 + travellers
if space > 4:
return 'van'
elif space <= 1:
return 'bike'
@acbart
acbart / spread_submission.js
Last active July 21, 2022 21:27
Parses uploaded submissions on Canvas to determine group mates, and then resubmits on the students' behalf.
$.getMultiScripts=function(arr,path){function executeInOrder(scr,code,resolve){
scr==arr[0]?(arr.shift(),eval(code),resolve(),console.log("executed",scr)):
setTimeout(function(){executeInOrder(scr,code,resolve)},50)}
var _arr=$.map(arr,function(e){return new Promise(r=>{jQuery.ajax({
type:"GET",url:(path||"")+e,dataType:"text",success:function(c){
console.log("loaded ",e),executeInOrder(e,c,r)},cache:!0})})});
return _arr.push($.Deferred(function(e){$(e.resolve)})),
$.when.apply($,_arr)};
// Load ChartJS
@acbart
acbart / canvas_tools.py
Last active September 12, 2023 22:29
Canvas Utilities for Python
"""
This file has a bunch of useful helper functions that can make it a bit easier to access the Canvas API.
It's grown organically, so it is not always very easy to read.
There are Canvas libraries out there for Python! They might be better, I haven't tried them.
The first time you import this library, it will load a settings file (`settings.yaml`). If the file
does not exist, then it will be created with some of the expected fields. An example of what the file
might look like is below. You will need to be sure to update it with:
@acbart
acbart / gist:894c08b9ef636507d9e5363347fc332d
Last active March 12, 2022 17:36
0 credit courses at UD in F21
code title
454 ADMN561011 GRADUATE CONTRACT: GRADUATE ASSISTANT
455 ADMN561012 GRADUATE CONTRACT: RESEARCH ASSISTANT
456 ADMN561013 GRADUATE CONTRACT: TEACHING ASSISTANT
457 ADMN561014 GRADUATE CONTRACT: GRADUATE FELLOW
478 ADMN561015 GRADUATE CONTRACT: TUITION SCHOLAR
783 AFSC150010L Initial Military Training I
785 AFSC250010L Field Training Preparation I
813 AFSC350010L Intermediate Cadet Leader Training I
815 AFSC450010L Senior Cadet Leader Training I
@acbart
acbart / gist:7914e0e04cbf84044ddaeb8391625a87
Created March 12, 2022 17:35
0 credit UD courses in F21
['ADMN561011 GRADUATE CONTRACT: GRADUATE ASSISTANT'
'ADMN561012 GRADUATE CONTRACT: RESEARCH ASSISTANT'
'ADMN561013 GRADUATE CONTRACT: TEACHING ASSISTANT'
'ADMN561014 GRADUATE CONTRACT: GRADUATE FELLOW'
'ADMN561015 GRADUATE CONTRACT: TUITION SCHOLAR'
'AFSC150010L Initial Military Training I'
'AFSC250010L Field Training Preparation I'
'AFSC350010L Intermediate Cadet Leader Training I'
'AFSC450010L Senior Cadet Leader Training I' 'ART417002 BFA Exhibition'
'ART676010 Pedagogy' 'BHAN860010 Graduate Research Seminar'
@acbart
acbart / guizero_designer.py
Created March 4, 2022 11:52
Example of GUIZero and Designer working together
from guizero import *
from designer import *
# GuiZero stuff
app = App(title="Main window", width=200, height=200)
text_1 = Text(app, text="X", color="red", size=20)
# Designer stuff
frog = emoji("frog")
grow(frog, 5)