examples/hello.tar
hello/ 0000777 0000000 0000000 00000000000 14565026530 007061 5 ustar hello/autograde-Makefile 0000777 0000000 0000000 00000000170 14525515512 012472 0 ustar all:
tar xvf autograde.tar
cp hello.c hello-handout
(cd hello-handout; ./driver.sh)
clean:
rm -rf *~ hello-handout
hello/autograde.tar 0000777 0000000 0000000 00000024000 14525515512 011542 0 ustar hello-handout/ 0000777 0001750 0001750 00000000000 13554224470 013247 5 ustar xtrkil xtrkil hello-handout/Makefile 0000666 0001750 0001750 00000000134 13540570326 014704 0 ustar xtrkil xtrkil # Student makefile for the Hello Lab
all:
gcc hello.c -o hello
clean:
rm -rf *~ hello
hello-handout/README 0000666 0001750 0001750 00000000707 13540570326 014132 0 ustar xtrkil xtrkil For this lab, you should write a tiny C program, called "hello.c",
that prints "hello, world" to stdout and then indicates success by
exiting with a status of zero.
To test your work:
linux> make clean; make; ./hello
To run the same autograder that Autolab will use when you submit:
linux> ./driver.sh
Files:
README This file
Makefile Compiles hello.c
driver.sh Autolab autograder
hello.c Empty C file that you will edit
hello-handout/driver.sh 0000777 0001750 0001750 00000001407 13540570326 015102 0 ustar xtrkil xtrkil #!/bin/bash
# driver.sh - The simplest autograder we could think of. It checks
# that students can write a C program that compiles, and then
# executes with an exit status of zero.
# Usage: ./driver.sh
# Compile the code
echo "Compiling hello.c"
(make clean; make)
status=$?
if [ ${status} -ne 0 ]; then
echo "Failure: Unable to compile hello.c (return status = ${status})"
echo "{\"scores\": {\"Correctness\": 0}}"
exit
fi
# Run the code
echo "Running ./hello"
./hello
status=$?
if [ ${status} -eq 0 ]; then
echo "Success: ./hello runs with an exit status of 0"
echo "{\"scores\": {\"Correctness\": 100}}"
else
echo "Failure: ./hello fails or returns nonzero exit status of ${status}"
echo "{\"scores\": {\"Correctness\": 0}}"
fi
exit
hello-handout/hello.c 0000666 0001750 0001750 00000000026 13540570326 014513 0 ustar xtrkil xtrkil /*
* Hello Lab
*/
hello/hello-handout/ 0000777 0000000 0000000 00000000000 14525515512 011623 5 ustar hello/hello-handout/driver.sh 0000777 0000000 0000000 00000001407 14525515512 013457 0 ustar #!/bin/bash
# driver.sh - The simplest autograder we could think of. It checks
# that students can write a C program that compiles, and then
# executes with an exit status of zero.
# Usage: ./driver.sh
# Compile the code
echo "Compiling hello.c"
(make clean; make)
status=$?
if [ ${status} -ne 0 ]; then
echo "Failure: Unable to compile hello.c (return status = ${status})"
echo "{\"scores\": {\"Correctness\": 0}}"
exit
fi
# Run the code
echo "Running ./hello"
./hello
status=$?
if [ ${status} -eq 0 ]; then
echo "Success: ./hello runs with an exit status of 0"
echo "{\"scores\": {\"Correctness\": 100}}"
else
echo "Failure: ./hello fails or returns nonzero exit status of ${status}"
echo "{\"scores\": {\"Correctness\": 0}}"
fi
exit
hello/hello-handout/hello.c 0000777 0000000 0000000 00000000026 14525515512 013073 0 ustar /*
* Hello Lab
*/
hello/hello-handout/Makefile 0000777 0000000 0000000 00000000134 14525515512 013264 0 ustar # Student makefile for the Hello Lab
all:
gcc hello.c -o hello
clean:
rm -rf *~ hello
hello/hello-handout/README 0000777 0000000 0000000 00000000707 14525515512 012512 0 ustar For this lab, you should write a tiny C program, called "hello.c",
that prints "hello, world" to stdout and then indicates success by
exiting with a status of zero.
To test your work:
linux> make clean; make; ./hello
To run the same autograder that Autolab will use when you submit:
linux> ./driver.sh
Files:
README This file
Makefile Compiles hello.c
driver.sh Autolab autograder
hello.c Empty C file that you will edit
hello/hello-handout.tar 0000777 0000000 0000000 00000024000 14525515512 012332 0 ustar hello-handout/ 0000777 0001750 0001750 00000000000 13554224470 013247 5 ustar xtrkil xtrkil hello-handout/Makefile 0000666 0001750 0001750 00000000134 13540570326 014704 0 ustar xtrkil xtrkil # Student makefile for the Hello Lab
all:
gcc hello.c -o hello
clean:
rm -rf *~ hello
hello-handout/README 0000666 0001750 0001750 00000000707 13540570326 014132 0 ustar xtrkil xtrkil For this lab, you should write a tiny C program, called "hello.c",
that prints "hello, world" to stdout and then indicates success by
exiting with a status of zero.
To test your work:
linux> make clean; make; ./hello
To run the same autograder that Autolab will use when you submit:
linux> ./driver.sh
Files:
README This file
Makefile Compiles hello.c
driver.sh Autolab autograder
hello.c Empty C file that you will edit
hello-handout/driver.sh 0000777 0001750 0001750 00000001407 13540570326 015102 0 ustar xtrkil xtrkil #!/bin/bash
# driver.sh - The simplest autograder we could think of. It checks
# that students can write a C program that compiles, and then
# executes with an exit status of zero.
# Usage: ./driver.sh
# Compile the code
echo "Compiling hello.c"
(make clean; make)
status=$?
if [ ${status} -ne 0 ]; then
echo "Failure: Unable to compile hello.c (return status = ${status})"
echo "{\"scores\": {\"Correctness\": 0}}"
exit
fi
# Run the code
echo "Running ./hello"
./hello
status=$?
if [ ${status} -eq 0 ]; then
echo "Success: ./hello runs with an exit status of 0"
echo "{\"scores\": {\"Correctness\": 100}}"
else
echo "Failure: ./hello fails or returns nonzero exit status of ${status}"
echo "{\"scores\": {\"Correctness\": 0}}"
fi
exit
hello-handout/hello.c 0000666 0001750 0001750 00000000026 13540570326 014513 0 ustar xtrkil xtrkil /*
* Hello Lab
*/
hello/hello.rb 0000777 0000000 0000000 00000000237 14525515512 010515 0 ustar require "AssessmentBase.rb"
module Hello
include AssessmentBase
def assessmentInitialize(course)
super("hello",course)
@problems = []
end
end
hello/hello.yml 0000777 0000000 0000000 00000000717 14565026530 010717 0 ustar ---
general:
name: hello
description: ''
display_name: Hello
handin_filename: hello.c
handin_directory: handin
max_grace_days: 0
handout: hello-handout.tar
writeup: writeup/hello.html
max_submissions: -1
disable_handins: false
max_size: 2
category_name: Lab
problems:
- name: Correctness
description: ''
max_score: 100.0
optional: false
autograder:
autograde_timeout: 180
autograde_image: autograding_image
release_score: true
hello/Makefile 0000777 0000000 0000000 00000002356 14525515512 010531 0 ustar #
# Makefile to manage the example Hello Lab
#
# Get the name of the lab directory
LAB = $(notdir $(PWD))
all: handout handout-tarfile
handout:
# Rebuild the handout directory that students download
(rm -rf $(LAB)-handout; mkdir $(LAB)-handout)
cp -p src/Makefile-handout $(LAB)-handout/Makefile
cp -p src/README-handout $(LAB)-handout/README
cp -p src/hello.c-handout $(LAB)-handout/hello.c
cp -p src/driver.sh $(LAB)-handout
handout-tarfile: handout
# Build *-handout.tar and autograde.tar
tar cvf $(LAB)-handout.tar $(LAB)-handout
cp -p $(LAB)-handout.tar autograde.tar
clean:
# Clean the entire lab directory tree. Note that you can run
# "make clean; make" at any time while the lab is live with no
# adverse effects.
rm -f *~ *.tar
(cd src; make clean)
(cd test-autograder; make clean)
rm -rf $(LAB)-handout
rm -f autograde.tar
#
# CAREFULL!!! This will delete all student records in the logfile and
# in the handin directory. Don't run this once the lab has started.
# Use it to clean the directory when you are starting a new version
# of the lab from scratch, or when you are debugging the lab prior
# to releasing it to the students.
#
cleanallfiles:
# Reset the lab from scratch.
make clean
rm -f log.txt
rm -rf handin/*
hello/README 0000777 0000000 0000000 00000002315 14525515512 007744 0 ustar This is an example of the simplest possible autograded lab, called "hello." It uses
the recommended file format that we've found helpful in the past.
To build the lab:
linux> make clean
linux> make
To test offline:
linux> cd test-autograder
linux> make clean
linux> make
# Basic files created by the lab author
Makefile Builds the lab from src/
README
autograde-Makefile Makefile that runs the autograder
src/ Contains all src files and solutions
test-autograder/ For testing autograder offline
writeup/ Lab writeup that students view from Autolab
# Files created by running make
hello-handout/ The directory that is handed out to students, created
using files from src/.
hello-handout.tar Archive of hello-handout directory
autograde.tar File that is copied to the autograding instance
(along with autograde-Makefile and student handin file)
# Files created and managed by Autolab
handin/ All students handin files
hello.rb Config file
hello.yml Database properties that persist from semester to semester
log.txt Log of autograded submissions
hello/src/ 0000777 0000000 0000000 00000000000 14525515512 007647 5 ustar hello/src/driver.sh 0000777 0000000 0000000 00000001407 14525515512 011503 0 ustar #!/bin/bash
# driver.sh - The simplest autograder we could think of. It checks
# that students can write a C program that compiles, and then
# executes with an exit status of zero.
# Usage: ./driver.sh
# Compile the code
echo "Compiling hello.c"
(make clean; make)
status=$?
if [ ${status} -ne 0 ]; then
echo "Failure: Unable to compile hello.c (return status = ${status})"
echo "{\"scores\": {\"Correctness\": 0}}"
exit
fi
# Run the code
echo "Running ./hello"
./hello
status=$?
if [ ${status} -eq 0 ]; then
echo "Success: ./hello runs with an exit status of 0"
echo "{\"scores\": {\"Correctness\": 100}}"
else
echo "Failure: ./hello fails or returns nonzero exit status of ${status}"
echo "{\"scores\": {\"Correctness\": 0}}"
fi
exit
hello/src/hello.c 0000777 0000000 0000000 00000000225 14525515512 011120 0 ustar /* Solution for the Hello Lab */
#include <stdio.h>
int main()
{
printf("Hello, world\n");
return 0; /* important to return zero here */
}
hello/src/hello.c-handout 0000777 0000000 0000000 00000000026 14525515512 012557 0 ustar /*
* Hello Lab
*/
hello/src/Makefile 0000777 0000000 0000000 00000000123 14525515512 011306 0 ustar # Makefile for the Hello Lab
all:
gcc hello.c -o hello
clean:
rm -rf *~ hello
hello/src/Makefile-handout 0000777 0000000 0000000 00000000134 14525515512 012750 0 ustar # Student makefile for the Hello Lab
all:
gcc hello.c -o hello
clean:
rm -rf *~ hello
hello/src/README 0000777 0000000 0000000 00000001036 14525515512 010532 0 ustar This directory contains all of the code files for the Hello Lab,
including the files that are handed out to students.
Files:
# Autograder and solution files
Makefile Makefile and ...
README ... README for this directory
driver.sh* Autograder
hello.c Solution hello.c file
# Files that are handed out to students
Makefile-handout Makefile and ...
README-handout ... README handed out to students
hello.c-handout Blank hello.c file handed out to students
hello/src/README-handout 0000777 0000000 0000000 00000000707 14525515512 012176 0 ustar For this lab, you should write a tiny C program, called "hello.c",
that prints "hello, world" to stdout and then indicates success by
exiting with a status of zero.
To test your work:
linux> make clean; make; ./hello
To run the same autograder that Autolab will use when you submit:
linux> ./driver.sh
Files:
README This file
Makefile Compiles hello.c
driver.sh Autolab autograder
hello.c Empty C file that you will edit
hello/test-autograder/ 0000777 0000000 0000000 00000000000 14525515512 012172 5 ustar hello/test-autograder/autograde.tar 0000777 0000000 0000000 00000024000 14525515512 014654 0 ustar hello-handout/ 0000775 0006626 0000144 00000000000 12753144127 012513 5 ustar droh users hello-handout/Makefile 0000664 0006626 0000144 00000000134 12750713202 014142 0 ustar droh users # Student makefile for the Hello Lab
all:
gcc hello.c -o hello
clean:
rm -rf *~ hello
hello-handout/README 0000664 0006626 0000144 00000000707 12750725045 013400 0 ustar droh users For this lab, you should write a tiny C program, called "hello.c",
that prints "hello, world" to stdout and then indicates success by
exiting with a status of zero.
To test your work:
linux> make clean; make; ./hello
To run the same autograder that Autolab will use when you submit:
linux> ./driver.sh
Files:
README This file
Makefile Compiles hello.c
driver.sh Autolab autograder
hello.c Empty C file that you will edit
hello-handout/hello.c 0000664 0006626 0000144 00000000026 12750712171 013755 0 ustar droh users /*
* Hello Lab
*/
hello-handout/driver.sh 0000700 0006626 0000144 00000001407 12750717566 014345 0 ustar droh users #!/bin/bash
# driver.sh - The simplest autograder we could think of. It checks
# that students can write a C program that compiles, and then
# executes with an exit status of zero.
# Usage: ./driver.sh
# Compile the code
echo "Compiling hello.c"
(make clean; make)
status=$?
if [ ${status} -ne 0 ]; then
echo "Failure: Unable to compile hello.c (return status = ${status})"
echo "{\"scores\": {\"Correctness\": 0}}"
exit
fi
# Run the code
echo "Running ./hello"
./hello
status=$?
if [ ${status} -eq 0 ]; then
echo "Success: ./hello runs with an exit status of 0"
echo "{\"scores\": {\"Correctness\": 100}}"
else
echo "Failure: ./hello fails or returns nonzero exit status of ${status}"
echo "{\"scores\": {\"Correctness\": 0}}"
fi
exit
hello/test-autograder/hello.c 0000777 0000000 0000000 00000000161 14525515512 013442 0 ustar /* Solution for the Hello Lab */
#include <stdio.h>
int main()
{
printf("Hello, world\n");
return 0;
}
hello/test-autograder/Makefile 0000777 0000000 0000000 00000000170 14525515512 013633 0 ustar all:
tar xvf autograde.tar
cp hello.c hello-handout
(cd hello-handout; ./driver.sh)
clean:
rm -rf *~ hello-handout
hello/writeup/ 0000777 0000000 0000000 00000000000 14525515512 010557 5 ustar hello/writeup/hello.html 0000777 0000000 0000000 00000000556 14525515512 012561 0 ustar <h2>Hello Lab</h2>
In this lab, you will write a C program, called <kbd>hello.c</kbd>, that prints "Hello, world" and
then exits with a status of zero (the conventional way to indicate a
successful termination).
<p>
Download the lab materials from Autolab using the "Download handout" link.
<p>
Submit your hello.c file to Autolab using the "Submit file" link.
hello/writeup/README 0000777 0000000 0000000 00000000131 14525515512 011435 0 ustar Contains the HTML writeup for the Hello Lab that students using the
"View writeup" link.