As of Summer 2011, Web-CAT has made major changes to the way instructors' files are stored on the server. The old web-based file manager is gone and has been replaced with Git repositories. This allows the entire history of an assignment's reference tests and other resources to be easily accessible, and for instructors to create branches and tags if needed.
The recommended way of accessing your files is now through a Git client; however, a WebDAV portal is provided as well for users who are not comfortable with Git. (There are a couple issues still remaining with the WebDAV portal, which are described below.)
Introduction
Web-CAT automatically creates personal Git repositories for all instructors, as well as a shared repository for each course. Web-CAT does not impose any organizational requirements on the contents of these repositories, so instructors who plan to use one of the shared repositories may want to collaborate with others who teach the same course in order to devise a reasonable organizational structure.
If you are an instructor who already has files in your personal file storage area on Web-CAT, don't worry; those files will be automatically migrated into your personal repository the first time that you access it.
Web-CAT exposes its Git repositories over HTTP, using Git's smart HTTP protocol. You can access the URLs for those repositories by logging into Web-CAT and going to your My Profile page under the Home tab. This page lists all of the repositories that you can currently access, and clicking on one of the URLs will take you to a web-based view of the repository (based loosely on Github), where you can view the repository's file tree, commit history, and branches/tags.
Advanced Users
For users who are already familiar with Git, simply run git clone with the URL of the repository that you wish to clone, then make sure that remote fetch/push are configured for that URL as well. Then you can use the repository as normal, and fetch/push any content from/to the server.
Using Web-CAT's Git support in Eclipse
Currently at Virginia Tech, most of our students and instructors of courses on Web-CAT use Eclipse as their development environment. For other Eclipse users, we provide the following step-by-step instructions to configure your IDE so that you can easily fetch/push sample solutions, reference tests, and other grading artifacts for your assignments.
If you are using another IDE or Git client, then you will need to find out how to adapt the instructions below to your needs.
Requirements
Make sure that you have the EGit plug-ins installed to add Git support to Eclipse. This project is located at http://eclipse.org/egit/. Follow the instructions there to download and install the plug-ins.
Once EGit is installed, you may wish to bring up the Git Repositories view so that you can easily browse the entire working tree of your repositories. Go to the Window / Show View / Other... menu and choose Git / Git Repositories. You can open any other Git views that you wish here as well.
Cloning Your Repository
In the Git Repositories view toolbar, you will see three icons with "GIT" at the bottom. The middle one is the button to clone an existing repository, so click it.
Paste the URL of the Web-CAT repository that you want to clone into the URI field. Under Authentication, enter your Web-CAT username and password. Then click Next.
The next page of the wizard asks you which branches you want to clone. You should at least have "master" selected; if you want to include any other branches, choose them as well. Then click Next.
The next page asks you where you want to store your local copy of the repository. This does not have to be inside your Eclipse workspace folder. Choose a location and click Finish.
You should see the repository appear in the Git Repositories view. Remote fetch and push will already be configured for you. If you have any other repositories that you wish to clone, repeat the instructions above.
Importing Existing Projects
Cloning the repository does not automatically add any Eclipse projects into your workspace. If a repository has existing Eclipse projects in it that you want to use, you need to import them. Importing them will not copy their entire file contents into your workspace, but rather create a project whose location is a directory in your Git repository's working tree.
Right-click on a repository in the Git Repositories view and choose Import Projects...
Make sure that Import existing projects is selected under "Wizard for project import". If you want to import all projects from the repository then make sure the root working directory of the repository is selected. (If you only want to import projects from one directory inside the repository, you can select that directory instead.) Then click Next.
The next page shows a list of all of the Eclipse projects that are currently in the repository, and they are checked by default. Uncheck any that you do not want to import, then click Finish.
After a moment, all of the projects that you selected will be imported into your workspace. You can now manipulate them using the Team menu in the context menu for each project, just as you would any other source-controlled project under Eclipse.
Sharing New Projects in a Repository
Eventually, you will probably want to create new projects and share them in a Web-CAT repository as well. EGit makes this easy as well.
- Create your new project as you would normally. The project type doesn't matter – it can be a general project, a Java project, an Android project, a C++ project, or something else.
Right-click on the project and choose Team / Share Project...
Make sure that Git is selected as the repository type and click Next.
On the next page, we want to share the project using one of the repositories that we have already cloned. So, selected the repository in the Repository drop-down list. The working directory will be automatically filled in for you based on this selection.
Under Path within repository, enter a relative path from the root of the repository's working directory where you want the project directory to be moved for sharing. This can be useful if you want to separate projects of different types (such as a directory for projects and one for labs). Essentially, the structure will be as follows:
If the repository's working directory is /home/joehokie/git/VT.joehokie, the path within the repository is programs, and the name of the project being shared is program1, then the project will be moved to /home/joehokie/git/VT.joehokie/programs/program1.
Click Finish once you are done. The project will be moved to the new location and you can now use the normal Team context menu items to manipulate it.
A Word About Git
For those users who are not totally familiar with Git, remember that it is a distributed source control system. Each user maintains his or her own local copy of the repository, and any commits that are made affect the local repository only. In order to update the repository on the server, you much "push" your local repository. Likewise, in order to get changes that other users have pushed, you must "fetch" them (or do a Team Synchronize).
WebDAV Access
We highly recommend that instructors adapt to using Git for their file storage on Web-CAT. The benefits far outweigh the additional learning curve involved: automatic versioning, the ability to view the entire history of the repository and easily revert to older versions of resources, tagging of the state of the repository at the end of a semester/course, and easily viewing the changes between versions of a file. Additionally, if you are teaching a course with multiple instructors, all of whom might be modifying resources in a shared course repository, Git handles the synchronization for you and ensures that conflicts do not occur unnoticed.
However, for those who want to use WebDAV instead of Git, we provide a WebDAV "portal" to the Git repositories on Web-CAT. Modifying a file via WebDAV acts as a commit on the repository, so changes made through WebDAV are recorded and revertible just like changes via Git.
To connect to your Web-CAT repositories via WebDAV, mount the WebDAV URL on the My Profile page using whatever WebDAV client or operating system support you have.
There are still some issues with the WebDAV support, however. It can be a bit slow at times, and some users on Mac OS X have reported that when using Finder, their uploads do not complete and have a file size of 0 bytes. We are currently working to fix the issue, but until it is resolved, you may want to consider using the Terminal to copy files into your WebDAV view of the repository.