33
35
The data is stored in an SQL dump file, in ``examples/db/sample.sql``.
35
You must import this data into a **fresh** IVLE database. You can
36
re-initialise your database by running ``sudo -u postgres dropdb ivle``, and
37
then following the database setup instructions, in the section
38
:ref:`database-setup`.
40
The data may be imported by running the following command::
42
sudo -u postgres psql ivle < examples/db/sample.sql
45
.. warning:: Instructions on fixing up the user's repositories and file
37
You must import this data into a **fresh** IVLE database. If you already have
38
a working IVLE install, it will have to be erased. A script is provided
39
which performs the following tasks:
41
* Unmounts all users with accounts in the current database,
42
* Drops the IVLE database if it already exists (prompting first),
43
* Creates and initialises a new IVLE database, as per :ref:`database-setup`,
44
* Populates the database with the sample data,
45
* Creates data directories and subversion repositories for all users, backing
46
up directories for any existing users.
48
The script is executed with the following command from the IVLE source
51
sudo ivle-loadsampledata examples/db/sample.sql
53
.. warning:: This script essentially destroys all contents in an existing IVLE
54
installation. Be sure you wish to do this.
56
.. note:: The script may fail at the "dropping database" phase if Apache or
57
another process are using the database. It is best to *restart* (not stop)
58
Apache before executing the script (``sudo /etc/init.d/apache2 restart``).
60
If the database exists, but is not properly initialised, then the script
61
may fail. In this case, you should manually run ``ivle-mountallusers -u``,
62
then drop the database, to ensure a clean build.
64
If there are any existing users (including sample users from previous runs
65
of the script), their files and subversion repos will be moved out of the
66
way to a backup location, ``/var/lib/ivle/jails-removed-<date>/``.
67
If you run this script regularly, your ``/var/lib/ivle/`` will become full
68
of these backups, so you may wish to remove them often. However, they are
69
typically fairly small (a few hundred kilobytes each), because they only
70
contain user content, not the full jail image.
86
There are four users (username/password). Note that in all cases, the password
110
There are five users (username/password). Note that in all cases, the password
89
113
* admin/password: This user has administrative rights over the entire system.
90
114
* lecturer/password: This is a normal user, but is enrolled as a lecturer in
91
100101 (2009 semester 1) and 100102 (2009 semester 2).
92
* studenta/password: This is a normal user, enrolled in 100101 (2009 semester
93
1) and 100102 (2009 semester 2).
94
* studentb/password: This is a normal user, enrolled in 100102 (2009 semester
95
2). This student has not yet accepted the Terms of Service, so does not have
115
ivle-101 (2009 semester 1) and ivle-102 (2009 semester 2).
116
* tutor/password: This is a normal user, but is enrolled as a tutor in
117
ivle-102 (2009 semester 2).
118
* studenta/password: This is a normal user, enrolled in ivle-101 (2009
119
semester 1) and ivle-102 (2009 semester 2).
120
* studentb/password: This is a normal user, enrolled in ivle-102 (2009
121
semester 2). This student has not yet accepted the Terms of Service, so does
122
not have a jail created, etc.
98
124
.. note:: For the first three users, the Subversion password is also
99
125
"password". This means it is possible to access their SVN repository
104
130
When studentb logs in for the first time, his SVN repository is created,
105
131
and given a random password.
136
The repository for user "studenta" has a few sample files. All of the
137
directories must be checked out (using the Checkout button) before the files
138
can be seen from the IVLE application.
140
* :file:`stuff/Welcome to IVLE.html`: A simple web page, which can be
141
displayed with the "Serve" command.
142
* :file:`stuff/hello.py`: A simple Python script, which can be executed with
143
the "Serve" command. This file has a few edits in its revision history.
144
* :file:`ivle-102/mywork/phase1.html`: A file for a student's project
146
* :file:`group1/phase2.html`: A file for a group project submission. This
147
contains edits by both studenta and studentb, and is also accessible if
148
logged in as studentb.
153
The subject ivle-102 (2009 semester 2) has two project sets and three
154
projects. This demonstrates the relationship between project sets and
157
The first project set is a solo project set (every student works by
158
themselves on all projects). It has one project in it.
160
The second project set is a group project set, for groups of 3. That means
161
students work in the *same* group of 3 for every project in the set. It has
162
two projects in it, demonstrating that the students get to keep their group
163
(including all of the group files) across the two projects in this set.
165
Projects 1 and 2 have their due date set in the year 3009, so they will always
166
be submittable. Project 3 was due in 2009, so it has already closed.
168
Finally, there is a single group for projects 2 and 3, which has the students
169
studenta and studentb enlisted.
174
There are two sample exercises, ``hello``, which prompts the user to write
175
a simple Hello world program, and ``factorial``, which prompts the user to
176
write a factorial function and tests its correctness.
178
Both exercises have realistic test suites, taking advantage of most of the
179
features of the IVLE exercise testing framework. For example, ``hello`` uses a
180
regular expression to test whether the user has got it almost right, and gives
181
them encouraging feedback.
186
There is currently a single worksheet in the subject ivle-102 (2009 semester
187
2). It embeds the exercises ``hello`` and ``factorial``.
107
189
Updating the sample data
108
190
========================
117
199
Then check the diff. You may hand-edit the SQL file, but only for the purpose
118
200
of fixing up unsightly data -- it should be possible to reload from the script
119
201
and re-export with no diff.
203
If the contents of the Subversion repositories have changed, run this
206
svnadmin dump /var/lib/ivle/svn/repositories/<repo> > examples/userrepos/<dumpfile>