Skip to main content

A package for automated feedback in coding exercises.

Project description

Pydagogy

Pydagogy is a Python library for automated code checking in online courses.

Content developers create the tests with hints, solutions, and other messaging. Students import the tests and run them in their exercise code to get feedback.

Usage

Content developers create tests by subclassing pydagogy.tests.BaseTest, or using one of the built-in tests like ValueTest. There are assert functions available that automatically print out messages when tests fail. This way you can have multiple checks within a test without breaking execution.

For example, you could create a test that checks for string equality.

import pydagogy as pgy

class MyTest(pgy.tests.BaseTest):
    def check(self, value):
        expected = "example string"
        message =  "Sorry, your result doesn't look correct."
        if pgy.assert_true(value == expected, message):
            self.success

# Create the test and add feedback for students
test_p1 = MyTest()
test_p1.hint = "Example hint text"
test_p1.solution = "Example solution text"
test_p1.success = "Nicely done!"

This test is imported into the student exercise code.

from test_file import test_p1

# students do something to generate a string
out_string = some_func()

test_p1.check(out_string)

# Uncomment the line below to see a hint
# test_p1.hint

# Uncomment the line below to see the solution
# test_p1.solution

The check function will print out the success message ("Nicely done!" in this example), if the student's string is the same as the expected string. Otherwise, it will print out the fail messsage.

Students can look at the hint and solution if they want, uncommenting those lines will print out the text.

Dependencies

Python 3.6 because f-strings. Seriously, update to 3.6 just for f-strings. You'll thank me.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydagogy-0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydagogy-0.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file pydagogy-0.1.tar.gz.

File metadata

  • Download URL: pydagogy-0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.24.0 setuptools/51.3.3 requests-toolbelt/0.8.0 tqdm/4.51.0 CPython/3.6.12

File hashes

Hashes for pydagogy-0.1.tar.gz
Algorithm Hash digest
SHA256 bf1d7ae4a056532927ef7ac65e508dcc3f348587bfdff1ec1d49d6636658afe5
MD5 b3e94e2325ba6accc30c34cc6e7f8d3f
BLAKE2b-256 cbf8e0a1472c74495e308e83eeff0851c48f467a5b77e073adad82450b213539

See more details on using hashes here.

File details

Details for the file pydagogy-0.1-py3-none-any.whl.

File metadata

  • Download URL: pydagogy-0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.24.0 setuptools/51.3.3 requests-toolbelt/0.8.0 tqdm/4.51.0 CPython/3.6.12

File hashes

Hashes for pydagogy-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0598344ef556a2110a0233a0b7739611125d14bba50dfb9a5b91711220b2049
MD5 1cc76da49b2ae278515f476d62492411
BLAKE2b-256 30400b4a6ee075cc528abeb248b4319739bd09338b3c32cb726d8f0315c334ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page