Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "PreTeXt-Codespaces",

// This Docker image includes some LaTeX support, but is still not to large. Note that if you keep your codespace running, it will use up your GitHub free storage quota. Additional options are listed below.
// "image": "oscarlevin/pretext:small",
// If you need to generate more complicated assets (such as sageplots) or use additional fonts when building to PDF, comment out the above line and uncomment the following line.
"image": "oscarlevin/pretext:full",
// If you only intend to build for web and don't have any latex-image generated assets, you can use a smaller image:
// "image": "oscarlevin/pretext:lite",



// The following was the previous version of this file, which used the Codespaces base image. It is still available for reference, but is not recommended.
// "image": "mcr.microsoft.com/devcontainers/python:3",
// "features": {
// "ghcr.io/devcontainers/features/node:1": {},
// "ghcr.io/rocker-org/devcontainer-features/pandoc:1": {}
// },
// "forwardPorts": [
// 27377,
// 27378
// ],
// "portsAttributes": {
// "27378": {
// "label": "CodeChat",
// "onAutoForward": "openPreview",
// "requireLocalPort": true,
// "elevateIfNeeded": true,
// "protocol": "https"
// }
// },
// "onCreateCommand": "pip install pretext",
// // Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "sudo bash ./.devcontainer/postCreateCommand.sh",

// Configure tool-specific properties.
"customizations": {
"codespaces": {
"openFiles": [
"source/main.ptx"
]
},
"vscode": {
"settings": {
"editor.quickSuggestions": {
"other": "off"
},
"editor.snippetSuggestions": "top",
"xml.validation.enabled": false
},
"extensions": ["ms-vscode.live-server", "oscarlevin.pretext-tools"]
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
112 changes: 90 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,91 @@
__pycache__/
build_info
build
published
.idea
.idea/*
pavement.pyc
# for builds on Mac:
**/.DS_Store
.vscode
*~
*.bak
*.orig
\#*\#
sphinx-enki-info.txt
sphinx_settings.json
output.log
beta
# Boilerplate list of files in a PreTeXt project for git to ignore
# ensure this file is tracked
!.gitignore

# don't track unpublished builds
output
published
pdf
GenFigs
cli.log

# don't track assets generated from source
generated-assets

# don't track node packages
node_modules

# don't track error logs
.error_schema.log
cli.log

# don't track OS related files (windows/macos/linux)
.DS_Store
.DS_Store?
._*
.AppleDouble
.LSOverride
.Spotlight-V100
.Trashes
Icon
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
*.stackdump
*.lnk
*.cab
*.msi
*.msix
*.msm
*.msp
[Dd]esktop.ini
.directory
.fuse_hidden*
.Trash-*
.nfs*

# Don't include VSCode generated files
.vscode
*.code-workspace

# Don't inlucde SublimeText files
# Cache files for Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache

# Workspace files are user-specific
*.sublime-workspace

# Project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using Sublime Text
*.sublime-project

# SFTP configuration file
sftp-config.json
sftp-config-alt*.json

# Package control specific files
Package Control.last-run
Package Control.ca-list
Package Control.ca-bundle
Package Control.system-ca-bundle
Package Control.cache/
Package Control.ca-certs/
Package Control.merged-ca-bundle
Package Control.user-ca-bundle
oscrypto-ca-bundle.crt
bh_unicode_properties.cache

# Sublime-github package stores a github token in this file
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings


# Don't include Dropbox settings and caches
.dropbox
.dropbox.attr
.dropbox.cache

16 changes: 8 additions & 8 deletions pretext/ClassesBasics/UserDefinedClasses.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -166,33 +166,33 @@ print(x, y)
<statement>
<p>True True</p>
</statement>
<feedback>
<feedback><p>
Look closely at how the objects are instantiated.
</feedback>
</p></feedback>
</choice>
<choice>
<statement>
<p>True False</p>
</statement>
<feedback>
<feedback><p>
Look closely at how the objects are instantiated and the types of the objects.
</feedback>
</p></feedback>
</choice>
<choice correct="yes">
<statement>
<p>False True</p>
</statement>
<feedback>
<feedback><p>
Correct, the BMW object is not the Tesla object but they are of the same type.
</feedback>
</p></feedback>
</choice>
<choice>
<statement>
<p>False False</p>
</statement>
<feedback>
<feedback><p>
Look closer at types of the objects.
</feedback>
</p></feedback>
</choice>
</choices>
</exercise>
Expand Down
12 changes: 6 additions & 6 deletions pretext/Debugging/HowtoAvoidDebugging.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,25 @@ print(final_time)
<statement>
<p>Python is stupid and does not know how to add properly.</p>
</statement>
<feedback>
<feedback><p>
No, Python is probabaly not broken.
</feedback>
</p></feedback>
</choice>
<choice>
<statement>
<p>There is nothing wrong here.</p>
</statement>
<feedback>
<feedback><p>
No, try adding the two numbers together yourself, you will definitely get a different result.
</feedback>
</p></feedback>
</choice>
<choice correct="yes">
<statement>
<p>Python is doing string concatenation, not integer addition.</p>
</statement>
<feedback>
<feedback><p>
Yes! Remember that input returns a string. Now we will need to convert the string to an integer
</feedback>
</p></feedback>
</choice>
</choices>
</exercise>
Expand Down
12 changes: 6 additions & 6 deletions pretext/Debugging/KnowyourerrorMessages.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,25 @@ print(final_time_int)
<statement>
<p>You cannot use a variable on both the left and right hand sides of an assignment statement.</p>
</statement>
<feedback>
<feedback><p>
No, You can, as long as all the variables on the right hand side already have values.
</feedback>
</p></feedback>
</choice>
<choice correct="yes">
<statement>
<p>wait_time_int does not have a value so it cannot be used on the right hand side.</p>
</statement>
<feedback>
<feedback><p>
Yes. Variables must already have values in order to be used on the right hand side.
</feedback>
</p></feedback>
</choice>
<choice>
<statement>
<p>This is not really an error, Python is broken.</p>
</statement>
<feedback>
<feedback><p>
No, No, No!
</feedback>
</p></feedback>
</choice>
</choices>
</exercise>
Expand Down
16 changes: 8 additions & 8 deletions pretext/Dictionaries/Aliasingandcopying.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,33 @@ print(mydict["elephant"])
<statement>
<p>23</p>
</statement>
<feedback>
<feedback><p>
mydict and yourdict are both names for the same dictionary.
</feedback>
</p></feedback>
</choice>
<choice>
<statement>
<p>None</p>
</statement>
<feedback>
<feedback><p>
The dictionary is mutable so changes can be made to the keys and values.
</feedback>
</p></feedback>
</choice>
<choice correct="yes">
<statement>
<p>999</p>
</statement>
<feedback>
<feedback><p>
Yes, since yourdict is an alias for mydict, the value for the key elephant has been changed.
</feedback>
</p></feedback>
</choice>
<choice>
<statement>
<p>Error, there are two different keys named elephant.</p>
</statement>
<feedback>
<feedback><p>
There is only one dictionary with only one key named elephant. The dictionary has two different names, mydict and yourdict.
</feedback>
</p></feedback>
</choice>
</choices>
</exercise>
Expand Down
Loading