~azzar1/unity/add-show-desktop-key

1349 by Matt Giuca
Added sample data infrastructure, with a little bit of sample data. The sample data is in examples/db/sample.sql. Documentation in doc/man/sample.rst details the infrastructure for importing and exporting sample data.
1
.. IVLE - Informatics Virtual Learning Environment
2
   Copyright (C) 2007-2009 The University of Melbourne
3
4
.. This program is free software; you can redistribute it and/or modify
5
   it under the terms of the GNU General Public License as published by
6
   the Free Software Foundation; either version 2 of the License, or
7
   (at your option) any later version.
8
9
.. This program is distributed in the hope that it will be useful,
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
   GNU General Public License for more details.
13
14
.. You should have received a copy of the GNU General Public License
15
   along with this program; if not, write to the Free Software
16
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
1359 by Matt Giuca
Added a script ivle-loadsampledata.
18
.. _sample-data:
19
1349 by Matt Giuca
Added sample data infrastructure, with a little bit of sample data. The sample data is in examples/db/sample.sql. Documentation in doc/man/sample.rst details the infrastructure for importing and exporting sample data.
20
***********
21
Sample data
22
***********
23
24
IVLE comes with supplied sample data to give a quick overview of the system.
25
This sample data may be installed by an administrative script. It should not
26
be installed in a production environment.
27
28
The sample data consists of database entries, for populating sample subjects,
29
offerings, users, projects, groups and worksheets, as well as some sample
30
files in users' Subversion repositories.
31
32
Installing the sample data
33
==========================
34
35
The data is stored in an SQL dump file, in ``examples/db/sample.sql``.
36
1359 by Matt Giuca
Added a script ivle-loadsampledata.
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:
40
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.
47
48
The script is executed with the following command::
49
50
    sudo ivle-loadsampledata examples/db/sample.sql
51
52
.. warning:: This script essentially destroys all contents in an existing IVLE
53
   installation. Be sure you wish to do this.
54
55
.. note:: The script may fail at the "dropping database" phase if Apache or
56
   another process are using the database. It is best to stop Apache before
57
   executing the script.
58
59
   If the database exists, but is not properly initialised, then the script
60
   may fail. In this case, you should manually run ``ivle-mountallusers -u``,
61
   then drop the database, to ensure a clean build.
1349 by Matt Giuca
Added sample data infrastructure, with a little bit of sample data. The sample data is in examples/db/sample.sql. Documentation in doc/man/sample.rst details the infrastructure for importing and exporting sample data.
62
1362 by Matt Giuca
ivle-loadsampledata: Runs ivle-refreshfilesystem both before and after loading sample data into the database, so that existing sample users are moved out of the way. This is explained in the docs.
63
   If there are any existing users (including sample users from previous runs
64
   of the script), their files and subversion repos will be moved out of the
65
   way to a backup location, ``/var/lib/ivle/jails-removed-<date>/``.
66
1349 by Matt Giuca
Added sample data infrastructure, with a little bit of sample data. The sample data is in examples/db/sample.sql. Documentation in doc/man/sample.rst details the infrastructure for importing and exporting sample data.
67
What is included
68
================
69
70
Subjects, semesters and offerings
71
---------------------------------
72
73
There are four semesters in the database: 2009 semesters 1 and 2, and 2010
74
semesters 1 and 2.
75
76
.. note:: We pretend that we are in 2009 semester 2 (even if that doesn't
77
   agree with the system clock). Therefore, 2009 semester 1 is a "past
78
   semester", 2009 semester 2 is the "current semester", and the 2010
79
   semesters are "future semesters."
80
81
There are four subjects in the database, with subject short names ivle-101,
82
ivle-102, ivle-201 and ivle-202.
83
84
The subjects have offerings for some of the semesters, as shown in this table:
85
86
+------+----------+-----------+
87
| Year | Semester | Subject   |
88
+======+==========+===========+
89
| 2009 | 1        | ivle-101  |
90
+------+----------+-----------+
91
| 2009 | 2        | ivle-102  |
92
+------+----------+-----------+
93
| 2010 | 1        | ivle-101  |
94
+------+----------+-----------+
95
| 2010 | 1        | ivle-201  |
96
+------+----------+-----------+
97
| 2010 | 2        | ivle-102  |
98
+------+----------+-----------+
99
| 2010 | 2        | ivle-202  |
100
+------+----------+-----------+
101
102
Users
103
-----
104
1383 by Matt Giuca
doc: Minor.
105
There are five users (username/password). Note that in all cases, the password
1349 by Matt Giuca
Added sample data infrastructure, with a little bit of sample data. The sample data is in examples/db/sample.sql. Documentation in doc/man/sample.rst details the infrastructure for importing and exporting sample data.
106
is "password".
107
108
* admin/password: This user has administrative rights over the entire system.
109
* lecturer/password: This is a normal user, but is enrolled as a lecturer in
110
  100101 (2009 semester 1) and 100102 (2009 semester 2).
1380 by Matt Giuca
Sample data: Added a new user, Terry Tutor, enrolled as a tutor in one of the subject, to test tutor permissions as distinct from lecturer permissions.
111
* tutor/password: This is a normal user, but is enrolled as a tutor in
112
  100102 (2009 semester 2).
1349 by Matt Giuca
Added sample data infrastructure, with a little bit of sample data. The sample data is in examples/db/sample.sql. Documentation in doc/man/sample.rst details the infrastructure for importing and exporting sample data.
113
* studenta/password: This is a normal user, enrolled in 100101 (2009 semester
114
  1) and 100102 (2009 semester 2).
115
* studentb/password: This is a normal user, enrolled in 100102 (2009 semester
116
  2). This student has not yet accepted the Terms of Service, so does not have
117
  a jail created, etc.
118
119
.. note:: For the first three users, the Subversion password is also
120
   "password". This means it is possible to access their SVN repository
121
   with a stand-alone SVN client with that password. This is somewhat
122
   unrealistic, as the SVN password in IVLE is usually a randomly-generated
123
   string, not related to the user's IVLE login password.
124
125
   When studentb logs in for the first time, his SVN repository is created,
126
   and given a random password.
127
1381 by Matt Giuca
docs/sample data: Describe sample project sets, projects and groups.
128
Projects
129
--------
130
131
The subject 100102 has two project sets and three projects. This demonstrates
132
the relationship between project sets and projects.
133
134
The first project set is a solo project set (every student works by
135
themselves on all projects). It has one project in it.
136
137
The second project set is a group project set, for groups of 3. That means
138
students work in the *same* group of 3 for every project in the set. It has
139
two projects in it, demonstrating that the students get to keep their group
140
(including all of the group files) across the two projects in this set.
141
142
Finally, there is a single group for projects 2 and 3, which has the students
143
studenta and studentb enlisted.
144
1349 by Matt Giuca
Added sample data infrastructure, with a little bit of sample data. The sample data is in examples/db/sample.sql. Documentation in doc/man/sample.rst details the infrastructure for importing and exporting sample data.
145
Updating the sample data
146
========================
147
148
For developers: If you need to update the sample data, follow this procedure.
149
150
Run the following command::
151
152
    pg_dump --schema=public --disable-triggers --data-only --column-inserts \
153
        --inserts --no-owner ivle > examples/db/sample.sql
154
155
Then check the diff. You may hand-edit the SQL file, but only for the purpose
156
of fixing up unsightly data -- it should be possible to reload from the script
157
and re-export with no diff.