~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
1469 by Matt Giuca
Docs: Clarified the process of refreshing the sample data.
48
The script is executed with the following command from the IVLE source
49
directory::
1359 by Matt Giuca
Added a script ivle-loadsampledata.
50
51
    sudo ivle-loadsampledata examples/db/sample.sql
52
53
.. warning:: This script essentially destroys all contents in an existing IVLE
54
   installation. Be sure you wish to do this.
55
56
.. note:: The script may fail at the "dropping database" phase if Apache or
1469 by Matt Giuca
Docs: Clarified the process of refreshing the sample data.
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``).
1359 by Matt Giuca
Added a script ivle-loadsampledata.
59
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.
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.
63
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.
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>/``.
1439 by Matt Giuca
doc/man/sample: Little extra note about removing the jail backups.
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.
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.
71
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.
72
What is included
73
================
74
75
Subjects, semesters and offerings
76
---------------------------------
77
78
There are four semesters in the database: 2009 semesters 1 and 2, and 2010
79
semesters 1 and 2.
80
81
.. note:: We pretend that we are in 2009 semester 2 (even if that doesn't
82
   agree with the system clock). Therefore, 2009 semester 1 is a "past
83
   semester", 2009 semester 2 is the "current semester", and the 2010
84
   semesters are "future semesters."
85
86
There are four subjects in the database, with subject short names ivle-101,
87
ivle-102, ivle-201 and ivle-202.
88
89
The subjects have offerings for some of the semesters, as shown in this table:
90
91
+------+----------+-----------+
92
| Year | Semester | Subject   |
93
+======+==========+===========+
94
| 2009 | 1        | ivle-101  |
95
+------+----------+-----------+
96
| 2009 | 2        | ivle-102  |
97
+------+----------+-----------+
98
| 2010 | 1        | ivle-101  |
99
+------+----------+-----------+
100
| 2010 | 1        | ivle-201  |
101
+------+----------+-----------+
102
| 2010 | 2        | ivle-102  |
103
+------+----------+-----------+
104
| 2010 | 2        | ivle-202  |
105
+------+----------+-----------+
106
107
Users
108
-----
109
1383 by Matt Giuca
doc: Minor.
110
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.
111
is "password".
112
113
* admin/password: This user has administrative rights over the entire system.
114
* lecturer/password: This is a normal user, but is enrolled as a lecturer in
1480 by Matt Giuca
doc/dev/sample.rst: Refer to subjects by short name, not subj code.
115
  ivle-101 (2009 semester 1) and ivle-102 (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.
116
* tutor/password: This is a normal user, but is enrolled as a tutor in
1480 by Matt Giuca
doc/dev/sample.rst: Refer to subjects by short name, not subj code.
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.
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.
123
124
.. note:: For the first three users, the Subversion password is also
125
   "password". This means it is possible to access their SVN repository
126
   with a stand-alone SVN client with that password. This is somewhat
127
   unrealistic, as the SVN password in IVLE is usually a randomly-generated
128
   string, not related to the user's IVLE login password.
129
130
   When studentb logs in for the first time, his SVN repository is created,
131
   and given a random password.
132
1438 by Matt Giuca
doc/man/sample: Describe the new sample data we put in today (files, worksheets, exercises).
133
Files
134
-----
135
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.
139
1479 by Matt Giuca
doc/dev/sample.rst: Describe all of the new sample files.
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
145
  submission.
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.
1438 by Matt Giuca
doc/man/sample: Describe the new sample data we put in today (files, worksheets, exercises).
149
1381 by Matt Giuca
docs/sample data: Describe sample project sets, projects and groups.
150
Projects
151
--------
152
1486 by Matt Giuca
Sample database: Added a sample worksheet.
153
The subject ivle-102 (2009 semester 2) has two project sets and three
154
projects. This demonstrates the relationship between project sets and
155
projects.
1381 by Matt Giuca
docs/sample data: Describe sample project sets, projects and groups.
156
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.
159
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.
164
1491 by Matt Giuca
Sample data: Projects 1 and 2 now due in 3009, not 2009, so they won't appear closed when someone in the (not-too-distant) future tries to submit them. Updated corresponding documentation.
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.
167
1381 by Matt Giuca
docs/sample data: Describe sample project sets, projects and groups.
168
Finally, there is a single group for projects 2 and 3, which has the students
169
studenta and studentb enlisted.
170
1438 by Matt Giuca
doc/man/sample: Describe the new sample data we put in today (files, worksheets, exercises).
171
Exercises
172
---------
173
1618 by Matt Giuca
Updated sample data: Added a new exercise 'hello'. This is a gentler
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
1438 by Matt Giuca
doc/man/sample: Describe the new sample data we put in today (files, worksheets, exercises).
176
write a factorial function and tests its correctness.
177
1618 by Matt Giuca
Updated sample data: Added a new exercise 'hello'. This is a gentler
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.
182
1486 by Matt Giuca
Sample database: Added a sample worksheet.
183
Worksheets
184
----------
185
186
There is currently a single worksheet in the subject ivle-102 (2009 semester
1618 by Matt Giuca
Updated sample data: Added a new exercise 'hello'. This is a gentler
187
2). It embeds the exercises ``hello`` and ``factorial``.
1486 by Matt Giuca
Sample database: Added a sample worksheet.
188
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.
189
Updating the sample data
190
========================
191
192
For developers: If you need to update the sample data, follow this procedure.
193
194
Run the following command::
195
196
    pg_dump --schema=public --disable-triggers --data-only --column-inserts \
197
        --inserts --no-owner ivle > examples/db/sample.sql
198
199
Then check the diff. You may hand-edit the SQL file, but only for the purpose
200
of fixing up unsightly data -- it should be possible to reload from the script
201
and re-export with no diff.
1622 by Matt Giuca
doc/sample: Added instruction on exporting the SVN repo to a dump file.
202
203
If the contents of the Subversion repositories have changed, run this
204
command::
205
206
    svnadmin dump /var/lib/ivle/svn/repositories/<repo> > examples/userrepos/<dumpfile>