Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tcexam_uibk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
User expired
tcexam_uibk
Commits
49a3b1e0
Commit
49a3b1e0
authored
8 years ago
by
User expired
Browse files
Options
Downloads
Plain Diff
Merge branch 'revert-
623f3529
' into 'uibk'
Revert
623f3529
See merge request !73
parents
51d72a3a
ebb91d06
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
admin/code/tce_edit_answer.php
+1
-1
1 addition, 1 deletion
admin/code/tce_edit_answer.php
install/update/update_160915.sql
+106
-0
106 additions, 0 deletions
install/update/update_160915.sql
with
107 additions
and
1 deletion
admin/code/tce_edit_answer.php
+
1
−
1
View file @
49a3b1e0
...
...
@@ -291,7 +291,7 @@ switch($menu_mode) {
}
// enable or disable record
$sql
=
'UPDATE '
.
K_TABLE_ANSWERS
.
' SET
answer_enabled=\''
.
$answer_enabled
.
'\',
answer_enabled=\''
.
intval
(
$answer_enabled
)
.
'\',
answer_position='
.
F_zero_to_null
(
$answer_position
)
.
'
WHERE answer_id='
.
$answer_id
.
''
;
if
(
!
$r
=
F_db_query
(
$sql
,
$db
))
{
...
...
This diff is collapsed.
Click to expand it.
install/update/update_160915.sql
0 → 100644
+
106
−
0
View file @
49a3b1e0
-- modifying the schema to assign group to test
ALTER
TABLE
tce_user_groups
ADD
COLUMN
group_type
character
varying
(
5
)
DEFAULT
'T'
;
UPDATE
tce_user_groups
SET
group_type
=
'B'
WHERE
external_id
LIKE
'%owner%'
;
ALTER
TABLE
tce_tests
ADD
COLUMN
test_group_id
bigint
;
-- functions for administrative group
-- Function: get_admin_group(bigint, bigint)
CREATE
OR
REPLACE
FUNCTION
get_admin_group
(
itest_id
bigint
,
igroup_id
bigint
)
RETURNS
bigint
AS
$
BODY
$
DECLARE
xgroup_id
bigint
;
BEGIN
SELECT
group_id
FROM
tce_user_groups
WHERE
external_id
=
(
SELECT
LEFT
(
external_id
,
strpos
(
external_id
,
':'
)
-
1
)
FROM
tce_user_groups
WHERE
group_id
=
igroup_id
)
||
':owner'
AND
group_type
=
'B'
INTO
xgroup_id
;
IF
xgroup_id
IS
NULL
THEN
xgroup_id
=
igroup_id
;
END
IF
;
RETURN
xgroup_id
;
END
;
$
BODY
$
LANGUAGE
plpgsql
VOLATILE
SECURITY
DEFINER
;
ALTER
FUNCTION
get_admin_group
(
bigint
,
bigint
)
SET
search_path
=
tcexam
,
pg_temp
;
ALTER
FUNCTION
get_admin_group
(
bigint
,
bigint
)
OWNER
TO
tcexam
;
-- Function: set_admin_group(bigint, bigint)
CREATE
OR
REPLACE
FUNCTION
set_admin_group
(
itest_id
bigint
,
igroup_id
bigint
)
RETURNS
void
AS
$
BODY
$
BEGIN
IF
NOT
EXISTS
(
SELECT
*
FROM
tce_testgroups
WHERE
tstgrp_group_id
=
(
SELECT
*
FROM
get_admin_group
(
itest_id
,
igroup_id
))
AND
tstgrp_test_id
=
itest_id
)
THEN
INSERT
INTO
tce_testgroups
(
tstgrp_test_id
,
tstgrp_group_id
)
VALUES
(
itest_id
,
(
SELECT
*
FROM
get_admin_group
(
itest_id
,
igroup_id
)));
END
IF
;
END
;
$
BODY
$
LANGUAGE
plpgsql
VOLATILE
SECURITY
DEFINER
;
ALTER
FUNCTION
set_admin_group
(
bigint
,
bigint
)
SET
search_path
=
tcexam
,
pg_temp
;
ALTER
FUNCTION
set_admin_group
(
bigint
,
bigint
)
OWNER
TO
tcexam
;
CREATE
OR
REPLACE
FUNCTION
insert_tcexam_group
(
pgroupid
character
varying
,
pappointmentid
character
varying
,
pgroupname
character
varying
)
RETURNS
void
AS
$
BODY
$
DECLARE
externalid
character
varying
;
appointmentid
character
varying
;
groupname
character
varying
;
grouptype
character
varying
;
groupvo
xml
;
BEGIN
grouptype
=
'T'
;
externalid
=
CONCAT
(
pgroupid
,
':'
,
pappointmentid
);
IF
pappointmentid
=
'owner'
THEN
grouptype
=
'B'
;
pappointmentid
=
'Betreuergruppe'
;
END
IF
;
groupname
=
CONCAT
(
pgroupname
,
' - '
,
pappointmentid
);
IF
NOT
EXISTS
(
SELECT
group_id
FROM
tce_user_groups
WHERE
external_id
=
externalid
)
THEN
INSERT
INTO
tce_user_groups
(
group_name
,
external_id
,
group_type
)
VALUES
(
groupname
,
externalid
,
grouptype
);
END
IF
;
END
;
$
BODY
$
LANGUAGE
plpgsql
VOLATILE
SECURITY
DEFINER
-- Set a secure search_path: trusted schema(s), then 'pg_temp'.
SET
search_path
=
tcexam
,
pg_temp
;
ALTER
FUNCTION
insert_tcexam_group
(
character
varying
,
character
varying
,
character
varying
)
OWNER
TO
tcexam
;
CREATE
OR
REPLACE
FUNCTION
update_tcexam_group
(
pgroupid
character
varying
,
pappointmentid
character
varying
,
pgroupname
character
varying
)
RETURNS
void
AS
$
BODY
$
DECLARE
theKey
character
varying
;
BEGIN
theKey
=
pgroupid
||
':'
||
pappointmentid
;
IF
(
SELECT
group_name
FROM
tce_user_groups
WHERE
external_id
=
theKey
)
!=
pgroupname
THEN
UPDATE
tce_user_groups
set
group_name
=
CONCAT
(
pgroupname
,
' - '
,
pappointmentid
)
WHERE
external_id
=
theKey
;
END
IF
;
END
;
$
BODY
$
LANGUAGE
plpgsql
VOLATILE
SECURITY
DEFINER
-- Set a secure search_path: trusted schema(s), then 'pg_temp'.
SET
search_path
=
tcexam
,
pg_temp
;
ALTER
FUNCTION
update_tcexam_group
(
character
varying
,
character
varying
,
character
varying
)
OWNER
TO
tcexam
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment