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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
|
<?php
# Lifter002: TODO
# Lifter007: TODO
# Lifter003: TODO
# Lifter010: TODO
/**
* Beschreibung
*
* @author Christian Bauer <alfredhitchcock@gmx.net>
* @copyright 2004 Stud.IP-Project
* @access public
* @package evaluation
* @modulegroup evaluation_modules
*
*/
// +---------------------------------------------------------------------------+
// This file is part of Stud.IP
// Copyright (C) 2001-2004 Stud.IP
// +---------------------------------------------------------------------------+
// 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// +---------------------------------------------------------------------------+
# PHP-LIB: open session ===================================================== #
/*page_open (array ("sess" => "Seminar_Session",
"auth" => "Seminar_Auth",
"perm" => "Seminar_Perm",
"user" => "Seminar_User"));
$auth->login_if ($auth->auth["uid"] == "nobody");
$perm->check ("autor");*/
# ============================================================== end: PHP-LIB #
# Include all required files ================================================ #
require_once 'lib/evaluation/evaluation.config.php';
require_once EVAL_LIB_EDIT;
require_once EVAL_FILE_EDIT_TREEVIEW;
# ====================================================== end: including files #
# define constancs ========================================================== #
/**
* @const NEW_EVALUATION_TITLE title of a new question block
* @access public
*/
define("NEW_EVALUATION_TITLE", _("Neue Evaluation"));
/**
* @const FIRST_ARRANGMENT_BLOCK_TITLE title of a new arrangment block
* @access public
*/
define("FIRST_ARRANGMENT_BLOCK_TITLE", _("Erster Gruppierungsblock"));
# ====================================================== end: define constancs #
$debug = "<pre class=\"steelgroup6\" style=\"font-size:10pt\">"
. "<pre class=\"steelgroup3\" style=\"font-size:10pt\">"
. "Welcome to BugReport 1.02 "
. "[Sharewareversion]"
. "</pre>";
# check the evalID ========================================================= #
global $user;
if (Request::submitted('newButton')) {
$debug .= "neue Eval!<br>";
// create the first group
$group = new EvaluationGroup();
$group->setTitle(FIRST_ARRANGMENT_BLOCK_TITLE, QUOTED);
$group->setText("");
if ($group->isError()) {
return MessageBox::error(_("Fehler beim Anlegen einer Gruppe"));
}
// create a new eval
$eval = new Evaluation ();
$rangeID = Request::option("rangeID");
if ($rangeID == $user->username) {
$rangeID = $user->id;
}
$eval->setAuthorID($user->id);
$eval->setTitle(NEW_EVALUATION_TITLE);
$eval->setAnonymous(YES);
$evalID = $eval->getObjectID();
$eval->addChild($group);
$eval->save();
if ($eval->isError()) {
return MessageBox::error(_("Fehler beim Anlegen einer Evaluation"));
}
$groupID = $group->getObjectID();
$evalID = $eval->getObjectID();
} elseif (Request::option("evalID") && (Request::option("evalID") != NULL)) {
$debug .= "isset _REQUTEST[evalID]!<br>";
$evalID = Request::option("evalID");
$eval = new Evaluation ($evalID, NULL, EVAL_LOAD_NO_CHILDREN);
if ($eval->isError()) {
PageLayout::postError(_("Es wurde eine ungültige Evaluations-ID übergeben."));
} elseif ($evalID == NULL) {
PageLayout::postError(_("Es wurde keine Evaluations-ID übergeben"));
}
} else {
PageLayout::postError(_("Es wurde keine Evaluations-ID übergeben"));
}
# ===================================================== END: check the evalID #
# check the itemID ========================================================= #
$itemID = Request::option('itemID');
if ($itemID) {
$_SESSION['itemID'] = $itemID;
} elseif (Request::submitted('newButton')) {
$_SESSION['itemID'] = "root";
}
# ===================================================== END: check the itemID #
# check the rangeID ======================================================== #
if (Request::option("rangeID")) {
$_SESSION['rangeID'] = Request::option("rangeID");
}
# ==================================================== END: check the rangeID #
# EVTAU: employees of the vote-team against urlhacking ====================== #
$eval = new Evaluation($evalID, NULL, EVAL_LOAD_NO_CHILDREN);
// someone has voted
if ($eval->hasVoted()) {
$error = MessageBox::error(
_("An dieser Evaluation hat bereits jemand teilgenommen. Sie darf nicht mehr verändert werden.")
);
}
// only the author or user with tutor perm in all evalRangeIDs should edit an eval
$authorID = $eval->getAuthorID();
if ($authorID != $user->id) {
$no_permisson = 0;
if (is_array($eval->getRangeIDs())) {
foreach ($eval->getRangeIDs() as $rangeID) {
$user_perm = EvaluationObjectDB::getRangePerm($rangeID, $user->id, YES);
// every range with a lower perm than Tutor
if ($user_perm < 7)
$no_permisson++;
}
if ($no_permisson > 0) {
if ($no_permisson == 1) {
$no_permisson_msg = _("Sie haben in einem Bereich, in welchem diese Evaluation hängt, nicht aussreichene Rechte, um diese Eval zu bearbeiten.");
} else {
$no_permisson_msg = sprintf(_("Sie haben in %s Bereichen, in denen diese Evaluation hängt, nicht aussreichene Rechte, um diese Eval zu bearbeiten."), $no_permisson);
}
$error_msgs[] = MessageBox::error($no_permisson_msg);
}
}
}
# ============================================ end: Collection post/get-vars #
# Print Error MSG and end Site ============================================= #
if ($error_msgs) {
$back_button = (" ")
. "<a href=\"" . URLHelper::getLink('admin_evaluation.php?page=overview&rangeID=' . Request::option('rangeID')) . "\">"
. _("Zur Evaluations-Verwaltung")
. "</a>";
if (is_array($error_msgs)) {
foreach ($error_msgs as $error_msg) {
$errors .= $error_msg . "<br>";
}
}
echo EvalEdit::createSite($errors . $back_button, " ");
include_once('lib/include/html_end.inc.php');
page_close();
exit ();
}
# ======================================== end: Print Error MSG and end Site #
/* Do first all actions for templates -------------------------------------- */
$templateSite = include(EVAL_FILE_TEMPLATE);
/* --------------------------------- end: do first all actions for templates */
# Creating the Tree ======================================================== #
$EditTree = new EvaluationTreeEditView($itemID, $evalID);
# Send messages to the tree ================================================ #
if (Request::submitted('newButton')) {
$EditTree->msg["root"] = "msg§"
. _("Erstellen Sie nun eine Evaluation.<br> Der erste Gruppierungsblock ist bereits angelegt worden. Wenn Sie ihn öffnen, können Sie dort weitere Gruppierungsblöcke oder Fragenblöcke anlegen.");
}
$editSite = $EditTree->showEvalTree($itemID, 1);
echo EvalEdit::createSite($editSite, $templateSite);
|