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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
.. IVLE - Informatics Virtual Learning Environment
   Copyright (C) 2007-2009 The University of Melbourne

.. This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

.. This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

.. You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

.. _sample-data:

***********
Sample data
***********

IVLE comes with supplied sample data to give a quick overview of the system.
This sample data may be installed by an administrative script. It should not
be installed in a production environment.

The sample data consists of database entries, for populating sample subjects,
offerings, users, projects, groups and worksheets, as well as some sample
files in users' Subversion repositories.

Installing the sample data
==========================

The data is stored in an SQL dump file, in ``examples/db/sample.sql``.

You must import this data into a **fresh** IVLE database. If you already have
a working IVLE install, it will have to be erased. A script is provided
which performs the following tasks:

* Unmounts all users with accounts in the current database,
* Drops the IVLE database if it already exists (prompting first),
* Creates and initialises a new IVLE database, as per :ref:`database-setup`,
* Populates the database with the sample data,
* Creates data directories and subversion repositories for all users, backing
  up directories for any existing users.

The script is executed with the following command from the IVLE source
directory::

    sudo ivle-loadsampledata examples/db/sample.sql

.. warning:: This script essentially destroys all contents in an existing IVLE
   installation. Be sure you wish to do this.

.. note:: The script may fail at the "dropping database" phase if Apache or
   another process are using the database. It is best to *restart* (not stop)
   Apache before executing the script (``sudo /etc/init.d/apache2 restart``).

   If the database exists, but is not properly initialised, then the script
   may fail. In this case, you should manually run ``ivle-mountallusers -u``,
   then drop the database, to ensure a clean build.

   If there are any existing users (including sample users from previous runs
   of the script), their files and subversion repos will be moved out of the
   way to a backup location, ``/var/lib/ivle/jails-removed-<date>/``.
   If you run this script regularly, your ``/var/lib/ivle/`` will become full
   of these backups, so you may wish to remove them often. However, they are
   typically fairly small (a few hundred kilobytes each), because they only
   contain user content, not the full jail image.

What is included
================

Subjects, semesters and offerings
---------------------------------

There are four semesters in the database: 2009 semesters 1 and 2, and 2010
semesters 1 and 2.

.. note:: We pretend that we are in 2009 semester 2 (even if that doesn't
   agree with the system clock). Therefore, 2009 semester 1 is a "past
   semester", 2009 semester 2 is the "current semester", and the 2010
   semesters are "future semesters."

There are four subjects in the database, with subject short names ivle-101,
ivle-102, ivle-201 and ivle-202.

The subjects have offerings for some of the semesters, as shown in this table:

+------+----------+-----------+
| Year | Semester | Subject   |
+======+==========+===========+
| 2009 | 1        | ivle-101  |
+------+----------+-----------+
| 2009 | 2        | ivle-102  |
+------+----------+-----------+
| 2010 | 1        | ivle-101  |
+------+----------+-----------+
| 2010 | 1        | ivle-201  |
+------+----------+-----------+
| 2010 | 2        | ivle-102  |
+------+----------+-----------+
| 2010 | 2        | ivle-202  |
+------+----------+-----------+

Users
-----

There are five users (username/password). Note that in all cases, the password
is "password".

* admin/password: This user has administrative rights over the entire system.
* lecturer/password: This is a normal user, but is enrolled as a lecturer in
  ivle-101 (2009 semester 1) and ivle-102 (2009 semester 2).
* tutor/password: This is a normal user, but is enrolled as a tutor in
  ivle-102 (2009 semester 2).
* studenta/password: This is a normal user, enrolled in ivle-101 (2009
  semester 1) and ivle-102 (2009 semester 2).
* studentb/password: This is a normal user, enrolled in ivle-102 (2009
  semester 2). This student has not yet accepted the Terms of Service, so does
  not have a jail created, etc.

.. note:: For the first three users, the Subversion password is also
   "password". This means it is possible to access their SVN repository
   with a stand-alone SVN client with that password. This is somewhat
   unrealistic, as the SVN password in IVLE is usually a randomly-generated
   string, not related to the user's IVLE login password.

   When studentb logs in for the first time, his SVN repository is created,
   and given a random password.

Files
-----

The repository for user "studenta" has a few sample files. All of the
directories must be checked out (using the Checkout button) before the files
can be seen from the IVLE application.

* :file:`stuff/Welcome to IVLE.html`: A simple web page, which can be
  displayed with the "Serve" command.
* :file:`stuff/hello.py`: A simple Python script, which can be executed with
  the "Serve" command. This file has a few edits in its revision history.
* :file:`ivle-102/mywork/phase1.html`: A file for a student's project
  submission.
* :file:`group1/phase2.html`: A file for a group project submission. This
  contains edits by both studenta and studentb, and is also accessible if
  logged in as studentb.

Projects
--------

The subject ivle-102 (2009 semester 2) has two project sets and three
projects. This demonstrates the relationship between project sets and
projects.

The first project set is a solo project set (every student works by
themselves on all projects). It has one project in it.

The second project set is a group project set, for groups of 3. That means
students work in the *same* group of 3 for every project in the set. It has
two projects in it, demonstrating that the students get to keep their group
(including all of the group files) across the two projects in this set.

Projects 1 and 2 have their due date set in the year 3009, so they will always
be submittable. Project 3 was due in 2009, so it has already closed.

Finally, there is a single group for projects 2 and 3, which has the students
studenta and studentb enlisted.

Exercises
---------

There are two sample exercises, ``hello``, which prompts the user to write
a simple Hello world program, and ``factorial``, which prompts the user to
write a factorial function and tests its correctness.

Both exercises have realistic test suites, taking advantage of most of the
features of the IVLE exercise testing framework. For example, ``hello`` uses a
regular expression to test whether the user has got it almost right, and gives
them encouraging feedback.

Worksheets
----------

There is currently a single worksheet in the subject ivle-102 (2009 semester
2). It embeds the exercises ``hello`` and ``factorial``.

Updating the sample data
========================

For developers: If you need to update the sample data, follow this procedure.

Run the following command::

    pg_dump --schema=public --disable-triggers --data-only --column-inserts \
        --inserts --no-owner ivle > examples/db/sample.sql

Then check the diff. You may hand-edit the SQL file, but only for the purpose
of fixing up unsightly data -- it should be possible to reload from the script
and re-export with no diff.

If the contents of the Subversion repositories have changed, run this
command::

    svnadmin dump /var/lib/ivle/svn/repositories/<repo> > examples/userrepos/<dumpfile>