Files of backup configuration (backup-files)
Overview
During solving of a task it is useful to make backup copies of the program source
code. Using one of the version control systems (e.g., CVS or SVN) you can store different
revisions of the program in a repository. Programming Taskbook contains special tool
named PTBackup system that commits automatically all revisions of the student's programs
to a CVS-repository and gives opportunity to browse all revisions which were committed.
To activate the PTBackup system the backup.dat file must exist in a student's working
directory. This file the following settings, which that we'll call a backup-configuration:
- A console CVS-client name that provides connection with CVS.
- A path to the CVS repository. This may be a complete path (including a network
path) or a repository name defined by means of CVS system.
- Authentication data (a login and a password) to access to a remote repository
(optional).
- An initial part of the path to the repository data (optional).
The backup.dat file with these settings can be created by the special PTBackupMaker
tool of the PTBackup system. After creation of the backup.dat file it is necessary
to copy it to the student's working directory. The PTBackupMaker tool not only creates
backup-files but allows to copy backup-file to a required working directory. It can also
test the backup-configuration being created. To deactivate the PTBackup system it is
necessary to remove the backup.dat file from the working directory, this action can be made
by PTBackupMaker tool as well.
Note that the teacher control center PT4TeachMini facilitates backup-files processing
for all students of a group (see "Backup-files" menu commands).
Before using the PTBackup system one should install a CVS system itself (e.g.,
CVSNT for Win32) and define a repository. The local repository can be created by means
of the CVS system; the remote repository also can be used.
Path to repository data
The PTBackup system uses a repository data path that consists of two parts: the
optional initial part (one or more subdirectory names separated by backslash character) and
the final part. The final part is determined automatically by a personal student information
(a name, a surname) that is stored in the results.dat file located in his/her working
directory.
This way of the path definition allows to use the same backup-configuration for all
students of a group: the initial part of the path determines the group directory in the
repository (for example, "Group2-2007") that contains directories corresponded
with each student of this group.
Some features of the PTBackup system
Before commiting files to the repository, the PTBackup system copies them into
an auxiliary subdirectory of the working directory. This backup data subdirectory is located
in a hidden PTBackup directory and has the same name as the corresponding directory in
the repository. If the backup data subdirectory is not found then it is created
automatically.
If file is commited to a repository successfully then the PTBackup system output
no messages. If some errors occur during data commiting then a
dialog box with error message appears. Each error message contains the error description
and the text "INFORM YOUR TEACHER ABOUT THIS ERROR". Besides error
messages the PTBackup system can output the following warnings: "It is likely that file
with the task solution was not saved before running the program. Maybe autosave mode is
off." and "File with the task solution is not found. It is likely that source file name differs
from the task name. Save your source file with the name of task being solved".
The PTBackup system does not commit program file to repository in the
following situations:
- Program running has led to the following message: "Acquaintance with the task".
- Program running has led to the following message: "Right solution. The test N".
- The program source code does not differ from the previous revision stored in the
backup data subdirectory.
While commiting the file to the repository, the program adds a header to the
source code (as a comment of the programming language being used). This header contains
the "PTBackup" text, a program name, a date and time of the program running, and a brief
description of results of the program running (this description coincides with the
information that is saved in the results.dat file). This information can be useful when
revisions of the program are being browsed with the PT4Results tool.
Browsing source code contained in a repository
If student's working directory contains the backup.dat file then the PT4Results tool
can display the student's program revisions stored in the repository. To display the window
with texts of program revisions on screen it is enough to click button or press F2 key (if
the backup.dat file is not found in the working directory then this button does
not appear).
At the top of the window a student name and a fully qualified path to his working
directory are displayed. The left-hand panel of the window contains list of files that are
contained in the student's repository. An amount of revisions of the file is shown after the
file name. Files are ordered by date of its last commiting to repository (the first file
has the earliest commit date).
After selection of a required file its last revision is displayed on the right-hand panel.
To browse other revisions it is enough to change the revision number that is displayed
below the file list on the left-hand panel. The arrow keys can be used for file and revision
selection: the "Up" and "Down" keys select files, the "Left" and "Right" keys select
revisions of the file being selected.
The file text is read-only but this text can be selected (by Ctrl+A hotkey) and copied to
Windows clipboard (by Ctrl+C hotkey). The popup menu with these commands is also
available.
|