autolab/Autolab

View on GitHub
examples/hello.tar

Summary

Maintainability
Test Coverage
hello/0000777000000000000000000000000014565026530007061 5ustar  hello/autograde-Makefile0000777000000000000000000000017014525515512012472 0ustar  all:
    tar xvf autograde.tar
    cp hello.c hello-handout
    (cd hello-handout; ./driver.sh)

clean:
    rm -rf *~ hello-handout
hello/autograde.tar0000777000000000000000000002400014525515512011542 0ustar  hello-handout/0000777000175000017500000000000013554224470013247 5ustar  xtrkilxtrkilhello-handout/Makefile0000666000175000017500000000013413540570326014704 0ustar  xtrkilxtrkil# Student makefile for the Hello Lab
all: 
    gcc hello.c -o hello

clean:
    rm -rf *~ hello


hello-handout/README0000666000175000017500000000070713540570326014132 0ustar  xtrkilxtrkilFor 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.sh0000777000175000017500000000140713540570326015102 0ustar  xtrkilxtrkil#!/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.c0000666000175000017500000000002613540570326014513 0ustar  xtrkilxtrkil/* 
 * Hello Lab 
 */
hello/hello-handout/0000777000000000000000000000000014525515512011623 5ustar  hello/hello-handout/driver.sh0000777000000000000000000000140714525515512013457 0ustar  #!/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.c0000777000000000000000000000002614525515512013073 0ustar  /* 
 * Hello Lab 
 */
hello/hello-handout/Makefile0000777000000000000000000000013414525515512013264 0ustar  # Student makefile for the Hello Lab
all: 
    gcc hello.c -o hello

clean:
    rm -rf *~ hello


hello/hello-handout/README0000777000000000000000000000070714525515512012512 0ustar  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.tar0000777000000000000000000002400014525515512012332 0ustar  hello-handout/0000777000175000017500000000000013554224470013247 5ustar  xtrkilxtrkilhello-handout/Makefile0000666000175000017500000000013413540570326014704 0ustar  xtrkilxtrkil# Student makefile for the Hello Lab
all: 
    gcc hello.c -o hello

clean:
    rm -rf *~ hello


hello-handout/README0000666000175000017500000000070713540570326014132 0ustar  xtrkilxtrkilFor 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.sh0000777000175000017500000000140713540570326015102 0ustar  xtrkilxtrkil#!/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.c0000666000175000017500000000002613540570326014513 0ustar  xtrkilxtrkil/* 
 * Hello Lab 
 */
hello/hello.rb0000777000000000000000000000023714525515512010515 0ustar  require "AssessmentBase.rb"

module Hello
  include AssessmentBase

  def assessmentInitialize(course)
    super("hello",course)
    @problems = []
  end

end
hello/hello.yml0000777000000000000000000000071714565026530010717 0ustar  ---
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/Makefile0000777000000000000000000000235614525515512010531 0ustar  #
# 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/README0000777000000000000000000000231514525515512007744 0ustar  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/0000777000000000000000000000000014525515512007647 5ustar  hello/src/driver.sh0000777000000000000000000000140714525515512011503 0ustar  #!/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.c0000777000000000000000000000022514525515512011120 0ustar  /* 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-handout0000777000000000000000000000002614525515512012557 0ustar  /* 
 * Hello Lab 
 */
hello/src/Makefile0000777000000000000000000000012314525515512011306 0ustar  # Makefile for the Hello Lab
all: 
    gcc hello.c -o hello

clean:
    rm -rf *~ hello

hello/src/Makefile-handout0000777000000000000000000000013414525515512012750 0ustar  # Student makefile for the Hello Lab
all: 
    gcc hello.c -o hello

clean:
    rm -rf *~ hello


hello/src/README0000777000000000000000000000103614525515512010532 0ustar  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-handout0000777000000000000000000000070714525515512012176 0ustar  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/0000777000000000000000000000000014525515512012172 5ustar  hello/test-autograder/autograde.tar0000777000000000000000000002400014525515512014654 0ustar  hello-handout/0000775000662600001440000000000012753144127012513 5ustar  drohusershello-handout/Makefile0000664000662600001440000000013412750713202014142 0ustar  drohusers# Student makefile for the Hello Lab
all: 
    gcc hello.c -o hello

clean:
    rm -rf *~ hello


hello-handout/README0000664000662600001440000000070712750725045013400 0ustar  drohusersFor 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.c0000664000662600001440000000002612750712171013755 0ustar  drohusers/* 
 * Hello Lab 
 */
hello-handout/driver.sh0000700000662600001440000000140712750717566014345 0ustar  drohusers#!/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.c0000777000000000000000000000016114525515512013442 0ustar  /* Solution for the Hello Lab */
#include <stdio.h>

int main()
{
    printf("Hello, world\n");
    return 0;
}

hello/test-autograder/Makefile0000777000000000000000000000017014525515512013633 0ustar  all:
    tar xvf autograde.tar
    cp hello.c hello-handout
    (cd hello-handout; ./driver.sh)

clean:
    rm -rf *~ hello-handout
hello/writeup/0000777000000000000000000000000014525515512010557 5ustar  hello/writeup/hello.html0000777000000000000000000000055614525515512012561 0ustar  <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/README0000777000000000000000000000013114525515512011435 0ustar  Contains the HTML writeup for the Hello Lab that students using the
"View writeup" link.