Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gredu_labs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
itminedu
gredu_labs
Commits
76b9f1aa
Commit
76b9f1aa
authored
Mar 09, 2016
by
Vassilis Kanellopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete survey for teachers
parent
c5933dbd
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
557 additions
and
107 deletions
+557
-107
config/settings/acl.global.php
config/settings/acl.global.php
+1
-0
data/db/er.png
data/db/er.png
+0
-0
data/db/schema.mysql.sql
data/db/schema.mysql.sql
+49
-7
module/schools/data/schema.mysql.sql
module/schools/data/schema.mysql.sql
+7
-7
module/tpe_survey/bootstrap.php
module/tpe_survey/bootstrap.php
+21
-2
module/tpe_survey/data/schema.mysql.sql
module/tpe_survey/data/schema.mysql.sql
+62
-0
module/tpe_survey/public/js/schools/tpe_survey.js
module/tpe_survey/public/js/schools/tpe_survey.js
+28
-1
module/tpe_survey/src/Action/SubmitTeachersCount.php
module/tpe_survey/src/Action/SubmitTeachersCount.php
+46
-0
module/tpe_survey/src/Action/SurveyForm.php
module/tpe_survey/src/Action/SurveyForm.php
+40
-4
module/tpe_survey/src/InputFilter/Survey.php
module/tpe_survey/src/InputFilter/Survey.php
+160
-0
module/tpe_survey/src/Middleware/SurveyFormDefaults.php
module/tpe_survey/src/Middleware/SurveyFormDefaults.php
+15
-4
module/tpe_survey/src/Service/SurveyService.php
module/tpe_survey/src/Service/SurveyService.php
+13
-1
module/tpe_survey/src/Service/SurveyServiceInterface.php
module/tpe_survey/src/Service/SurveyServiceInterface.php
+7
-0
module/tpe_survey/templates/schools/staff.twig
module/tpe_survey/templates/schools/staff.twig
+94
-80
module/tpe_survey/templates/tpe_survey/form.twig
module/tpe_survey/templates/tpe_survey/form.twig
+14
-1
No files found.
config/settings/acl.global.php
View file @
76b9f1aa
...
...
@@ -32,6 +32,7 @@ return [
[
'/application-form'
,
[
'school'
],
[
'get'
,
'post'
],
'GrEduLabs\ApplicationForm\Acl\Assertion\CanSubmit'
],
[
'/application-form/submit-success'
,
[
'school'
],
[
'get'
]],
[
'/tpe_survey'
,
[
'school'
],
[
'get'
,
'post'
]],
[
'/tpe_survey/total-teachers'
,
[
'school'
],
[
'post'
]],
],
],
],
...
...
data/db/er.png
View replaced file @
c5933dbd
View file @
76b9f1aa
191 KB
|
W:
|
H:
228 KB
|
W:
|
H:
2-up
Swipe
Onion skin
data/db/schema.mysql.sql
View file @
76b9f1aa
...
...
@@ -278,7 +278,7 @@ CREATE TABLE `lesson` (
`id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
`name`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
3
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
9
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
...
...
@@ -287,7 +287,7 @@ CREATE TABLE `lesson` (
LOCK
TABLES
`lesson`
WRITE
;
/*!40000 ALTER TABLE `lesson` DISABLE KEYS */
;
INSERT
INTO
`lesson`
VALUES
(
1
,
'ΠΛΗΡΟΦΟΡΙΚΗ'
),(
2
,
'ΦΥΣΙΚ
Η
'
);
INSERT
INTO
`lesson`
VALUES
(
1
,
'ΠΛΗΡΟΦΟΡΙΚΗ'
),(
2
,
'ΦΥΣΙΚ
ΩΝ ΕΠΙΣΤΗΜΩΝ'
),(
3
,
'ΤΕΧΝΟΛΟΓΙΑΣ'
),(
4
,
'ΦΙΛΟΛΟΓΙΚΑ'
),(
5
,
'ΑΙΣΘΗΤΙΚΗ ΑΓΩΓΗ'
),(
6
,
'ΕΘΝΙΚΑ Ή ΕΥΡΩΠΑΪΚΑ ΕΚΠΑΙΔΕΥΤΙΚΑ ΠΡΟΓΡΑΜΜΑΤΑ'
),(
7
,
'ΔΡΑΣΤΗΡΙΟΤΗΤΕΣ ΕΚΤΟΣ ΩΡΑΡΙΟΥ ΛΕΙΤΟΥΡΓΙΑΣ ΣΧΟΛΕΙΟΥ'
),(
8
,
'ΜΑΘΗΜΑΤΑ ΕΙΔΙΚΟΤΗΤΑΣ (ΕΠΑΛ)
'
);
/*!40000 ALTER TABLE `lesson` ENABLE KEYS */
;
UNLOCK
TABLES
;
...
...
@@ -345,6 +345,9 @@ UNLOCK TABLES;
-- Table structure for table `school`
--
DROP
TABLE
IF
EXISTS
`school`
;
/*!40101 SET @saved_cs_client = @@character_set_client */
;
/*!40101 SET character_set_client = utf8 */
;
DROP
TABLE
IF
EXISTS
`school`
;
/*!40101 SET @saved_cs_client = @@character_set_client */
;
/*!40101 SET character_set_client = utf8 */
;
...
...
@@ -352,7 +355,7 @@ CREATE TABLE `school` (
`id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
`name`
varchar
(
255
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`street_address`
varchar
(
255
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`postal_code`
int
(
11
)
unsigned
DEFAULT
NULL
,
`postal_code`
varchar
(
10
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`phone_number`
varchar
(
20
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`fax_number`
varchar
(
20
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`email`
varchar
(
255
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
...
...
@@ -364,16 +367,17 @@ CREATE TABLE `school` (
`created`
int
(
11
)
unsigned
NOT
NULL
,
`creator`
varchar
(
255
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`registry_no`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`teachers_count`
int
(
11
)
unsigned
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`registry_no_UNIQUE`
(
`registry_no`
),
KEY
`index_foreignkey_school_schooltype`
(
`schooltype_id`
),
KEY
`index_foreignkey_school_prefecture`
(
`prefecture_id`
),
KEY
`index_foreignkey_school_educationlevel`
(
`educationlevel_id`
),
KEY
`index_foreignkey_school_eduadmin`
(
`eduadmin_id`
),
CONSTRAINT
`c_fk_school_
schooltype_id`
FOREIGN
KEY
(
`schooltype_id`
)
REFERENCES
`schooltype`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
,
CONSTRAINT
`c_fk_school_
prefecture_id`
FOREIGN
KEY
(
`prefecture_id`
)
REFERENCES
`prefecture`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
,
CONSTRAINT
`c_fk_school_
educationlevel_id`
FOREIGN
KEY
(
`educationlevel_id`
)
REFERENCES
`educationlevel`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
,
CONSTRAINT
`c_fk_school_
eduadmin_id`
FOREIGN
KEY
(
`eduadmin_id`
)
REFERENCES
`eduadmin`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
CONSTRAINT
`c_fk_school_
eduadmin_id`
FOREIGN
KEY
(
`eduadmin_id`
)
REFERENCES
`eduadmin`
(
`id`
)
ON
UPDATE
CASCADE
,
CONSTRAINT
`c_fk_school_
educationlevel_id`
FOREIGN
KEY
(
`educationlevel_id`
)
REFERENCES
`educationlevel`
(
`id`
)
ON
UPDATE
CASCADE
,
CONSTRAINT
`c_fk_school_
prefecture_id`
FOREIGN
KEY
(
`prefecture_id`
)
REFERENCES
`prefecture`
(
`id`
)
ON
UPDATE
CASCADE
,
CONSTRAINT
`c_fk_school_
schooltype_id`
FOREIGN
KEY
(
`schooltype_id`
)
REFERENCES
`schooltype`
(
`id`
)
ON
UPDATE
CASCADE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
;
/*!40101 SET character_set_client = @saved_cs_client */
;
...
...
@@ -574,6 +578,44 @@ LOCK TABLES `software` WRITE;
/*!40000 ALTER TABLE `software` ENABLE KEYS */
;
UNLOCK
TABLES
;
--
-- Table structure for table `tpesurvey`
--
DROP
TABLE
IF
EXISTS
`tpesurvey`
;
/*!40101 SET @saved_cs_client = @@character_set_client */
;
/*!40101 SET character_set_client = utf8 */
;
CREATE
TABLE
`tpesurvey`
(
`id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
`teacher_id`
int
(
11
)
unsigned
NOT
NULL
,
`already_using_tpe`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`knowledge_level`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`assets_in_use`
text
COLLATE
utf8mb4_unicode_ci
,
`sw_web2`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`sw_packages`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`sw_digitalschool`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`sw_other`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`uc_eduprograms`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`uc_digitaldesign`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`uc_asyncedu`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`uc_other`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`extra_needs`
text
COLLATE
utf8mb4_unicode_ci
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`teacher_id_UNIQUE`
(
`teacher_id`
),
KEY
`index_foreignkey_tpesurvey_teacher`
(
`teacher_id`
),
CONSTRAINT
`c_fk_tpesurvey_teacher_id`
FOREIGN
KEY
(
`teacher_id`
)
REFERENCES
`teacher`
(
`id`
)
ON
UPDATE
CASCADE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
6
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Dumping data for table `tpesurvey`
--
LOCK
TABLES
`tpesurvey`
WRITE
;
/*!40000 ALTER TABLE `tpesurvey` DISABLE KEYS */
;
/*!40000 ALTER TABLE `tpesurvey` ENABLE KEYS */
;
UNLOCK
TABLES
;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */
;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */
;
...
...
module/schools/data/schema.mysql.sql
View file @
76b9f1aa
...
...
@@ -215,7 +215,7 @@ CREATE TABLE `lesson` (
`id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
`name`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
3
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
9
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
...
...
@@ -224,7 +224,7 @@ CREATE TABLE `lesson` (
LOCK
TABLES
`lesson`
WRITE
;
/*!40000 ALTER TABLE `lesson` DISABLE KEYS */
;
INSERT
INTO
`lesson`
VALUES
(
1
,
'ΠΛΗΡΟΦΟΡΙΚΗ'
),(
2
,
'ΦΥΣΙΚ
Η
'
);
INSERT
INTO
`lesson`
VALUES
(
1
,
'ΠΛΗΡΟΦΟΡΙΚΗ'
),(
2
,
'ΦΥΣΙΚ
ΩΝ ΕΠΙΣΤΗΜΩΝ'
),(
3
,
'ΤΕΧΝΟΛΟΓΙΑΣ'
),(
4
,
'ΦΙΛΟΛΟΓΙΚΑ'
),(
5
,
'ΑΙΣΘΗΤΙΚΗ ΑΓΩΓΗ'
),(
6
,
'ΕΘΝΙΚΑ Ή ΕΥΡΩΠΑΪΚΑ ΕΚΠΑΙΔΕΥΤΙΚΑ ΠΡΟΓΡΑΜΜΑΤΑ'
),(
7
,
'ΔΡΑΣΤΗΡΙΟΤΗΤΕΣ ΕΚΤΟΣ ΩΡΑΡΙΟΥ ΛΕΙΤΟΥΡΓΙΑΣ ΣΧΟΛΕΙΟΥ'
),(
8
,
'ΜΑΘΗΜΑΤΑ ΕΙΔΙΚΟΤΗΤΑΣ (ΕΠΑΛ)
'
);
/*!40000 ALTER TABLE `lesson` ENABLE KEYS */
;
UNLOCK
TABLES
;
...
...
@@ -289,7 +289,7 @@ CREATE TABLE `school` (
`id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
`name`
varchar
(
255
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`street_address`
varchar
(
255
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`postal_code`
int
(
11
)
unsigned
DEFAULT
NULL
,
`postal_code`
varchar
(
10
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`phone_number`
varchar
(
20
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`fax_number`
varchar
(
20
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`email`
varchar
(
255
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
...
...
@@ -307,10 +307,10 @@ CREATE TABLE `school` (
KEY
`index_foreignkey_school_prefecture`
(
`prefecture_id`
),
KEY
`index_foreignkey_school_educationlevel`
(
`educationlevel_id`
),
KEY
`index_foreignkey_school_eduadmin`
(
`eduadmin_id`
),
CONSTRAINT
`c_fk_school_
schooltype_id`
FOREIGN
KEY
(
`schooltype_id`
)
REFERENCES
`schooltype`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
,
CONSTRAINT
`c_fk_school_
prefecture_id`
FOREIGN
KEY
(
`prefecture_id`
)
REFERENCES
`prefecture`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
,
CONSTRAINT
`c_fk_school_
educationlevel_id`
FOREIGN
KEY
(
`educationlevel_id`
)
REFERENCES
`educationlevel`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
,
CONSTRAINT
`c_fk_school_
eduadmin_id`
FOREIGN
KEY
(
`eduadmin_id`
)
REFERENCES
`eduadmin`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
CONSTRAINT
`c_fk_school_
eduadmin_id`
FOREIGN
KEY
(
`eduadmin_id`
)
REFERENCES
`eduadmin`
(
`id`
)
ON
UPDATE
CASCADE
,
CONSTRAINT
`c_fk_school_
educationlevel_id`
FOREIGN
KEY
(
`educationlevel_id`
)
REFERENCES
`educationlevel`
(
`id`
)
ON
UPDATE
CASCADE
,
CONSTRAINT
`c_fk_school_
prefecture_id`
FOREIGN
KEY
(
`prefecture_id`
)
REFERENCES
`prefecture`
(
`id`
)
ON
UPDATE
CASCADE
,
CONSTRAINT
`c_fk_school_
schooltype_id`
FOREIGN
KEY
(
`schooltype_id`
)
REFERENCES
`schooltype`
(
`id`
)
ON
UPDATE
CASCADE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
;
/*!40101 SET character_set_client = @saved_cs_client */
;
...
...
module/tpe_survey/bootstrap.php
View file @
76b9f1aa
<?php
use
GrEduLabs\Schools\Middleware\FetchSchoolFromIdentity
;
use
GrEduLabs\Schools\Service\StaffServiceInterface
;
use
GrEduLabs\TpeSurvey\Action\SubmitTeachersCount
;
use
GrEduLabs\TpeSurvey\Action\SurveyForm
;
use
GrEduLabs\TpeSurvey\InputFilter\Survey
;
use
GrEduLabs\TpeSurvey\Middleware\SurveyFormDefaults
;
use
GrEduLabs\TpeSurvey\Service\SurveyService
;
use
GrEduLabs\TpeSurvey\Service\SurveyServiceInterface
;
...
...
@@ -35,7 +39,21 @@ return function (App $app) {
};
$c
[
SurveyForm
::
class
]
=
function
(
$c
)
{
return
new
SurveyForm
(
$c
->
get
(
SurveyServiceInterface
::
class
));
return
new
SurveyForm
(
$c
->
get
(
SurveyServiceInterface
::
class
),
$c
->
get
(
Survey
::
class
),
$c
->
get
(
StaffServiceInterface
::
class
)
);
};
$c
[
SubmitTeachersCount
::
class
]
=
function
(
$c
)
{
return
new
SubmitTeachersCount
(
$c
->
get
(
SurveyServiceInterface
::
class
)
);
};
$c
[
Survey
::
class
]
=
function
(
$c
)
{
return
new
Survey
();
};
});
...
...
@@ -44,7 +62,8 @@ return function (App $app) {
$app
->
group
(
'/tpe_survey'
,
function
()
{
$this
->
map
([
'GET'
,
'POST'
],
''
,
SurveyForm
::
class
)
->
setName
(
'tpe_survey'
);
});
$this
->
post
(
'/total-teachers'
,
SubmitTeachersCount
::
class
)
->
setName
(
'tpe_survey.total_teachers'
);
})
->
add
(
FetchSchoolFromIdentity
::
class
);
});
$events
(
'on'
,
'app.bootstrap'
,
function
(
App
$app
,
Container
$c
)
{
...
...
module/tpe_survey/data/schema.mysql.sql
0 → 100644
View file @
76b9f1aa
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */
;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */
;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */
;
/*!40101 SET NAMES utf8 */
;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */
;
/*!40103 SET TIME_ZONE='+00:00' */
;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */
;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */
;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */
;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */
;
--
-- Table structure for table `tpesurvey`
--
DROP
TABLE
IF
EXISTS
`tpesurvey`
;
/*!40101 SET @saved_cs_client = @@character_set_client */
;
/*!40101 SET character_set_client = utf8 */
;
CREATE
TABLE
`tpesurvey`
(
`id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
`teacher_id`
int
(
11
)
unsigned
NOT
NULL
,
`already_using_tpe`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`knowledge_level`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
,
`assets_in_use`
text
COLLATE
utf8mb4_unicode_ci
,
`sw_web2`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`sw_packages`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`sw_digitalschool`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`sw_other`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`uc_eduprograms`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`uc_digitaldesign`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`uc_asyncedu`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`uc_other`
varchar
(
191
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
,
`extra_needs`
text
COLLATE
utf8mb4_unicode_ci
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`teacher_id_UNIQUE`
(
`teacher_id`
),
KEY
`index_foreignkey_tpesurvey_teacher`
(
`teacher_id`
),
CONSTRAINT
`c_fk_tpesurvey_teacher_id`
FOREIGN
KEY
(
`teacher_id`
)
REFERENCES
`teacher`
(
`id`
)
ON
UPDATE
CASCADE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
6
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
;
/*!40101 SET character_set_client = @saved_cs_client */
;
--
-- Dumping data for table `tpesurvey`
--
LOCK
TABLES
`tpesurvey`
WRITE
;
/*!40000 ALTER TABLE `tpesurvey` DISABLE KEYS */
;
/*!40000 ALTER TABLE `tpesurvey` ENABLE KEYS */
;
UNLOCK
TABLES
;
ALTER
TABLE
`school`
ADD
COLUMN
`teachers_count`
INT
(
11
)
UNSIGNED
NULL
DEFAULT
NULL
AFTER
`registry_no`
;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */
;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */
;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */
;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */
;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */
;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */
;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */
;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */
;
module/tpe_survey/public/js/schools/tpe_survey.js
View file @
76b9f1aa
...
...
@@ -86,7 +86,14 @@
}).
done
(
function
(
response
)
{
that
.
hide
();
}).
fail
(
function
(
xhr
,
err
)
{
alert
(
'
Προέκυψε κάποιο σφάλμα
'
);
var
messages
;
if
(
422
===
xhr
.
status
)
{
messages
=
JSON
.
parse
(
xhr
.
responseText
).
messages
||
{};
utils
.
formMessages
.
render
(
form
,
messages
);
}
else
{
alert
(
'
Προέκυψε κάποιο σφάλμα
'
);
}
});
return
false
;
...
...
@@ -109,4 +116,24 @@
modal
.
render
();
});
$
(
'
#form-total-teachers
'
).
on
(
'
submit
'
,
function
(
evt
)
{
var
that
=
$
(
this
);
$
.
ajax
({
url
:
that
.
attr
(
'
action
'
),
type
:
'
post
'
,
dataType
:
'
json
'
,
data
:
utils
.
serializeObject
(
that
)
}).
fail
(
function
(
xhr
,
err
)
{
var
messages
;
if
(
422
===
xhr
.
status
)
{
messages
=
JSON
.
parse
(
xhr
.
responseText
).
messages
||
{};
utils
.
formMessages
.
render
(
that
,
messages
);
}
else
{
alert
(
'
Προέκυψε κάποιο σφάλμα
'
);
}
});
evt
.
preventDefault
();
});
}(
jQuery
,
_
,
window
.
EDULABS
.
utils
));
module/tpe_survey/src/Action/SubmitTeachersCount.php
0 → 100644
View file @
76b9f1aa
<?php
/**
* gredu_labs.
*
* @link https://github.com/eellak/gredu_labs for the canonical source repository
*
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/
namespace
GrEduLabs\TpeSurvey\Action
;
use
GrEduLabs\TpeSurvey\Service\SurveyServiceInterface
;
use
Slim\Http\Request
;
use
Slim\Http\Response
;
/**
* Description of SubmitTeachersCount
*
* @author kanellov
*/
class
SubmitTeachersCount
{
/**
*
* @var SurveyServiceInterface
*/
private
$service
;
public
function
__construct
(
SurveyServiceInterface
$service
)
{
$this
->
service
=
$service
;
}
public
function
__invoke
(
Request
$req
,
Response
$res
)
{
$school
=
$req
->
getAttribute
(
'school'
,
false
);
if
(
!
$school
)
{
return
$res
->
withStatus
(
403
,
'No school'
);
}
$this
->
service
->
setTotalTeachers
(
$school
->
id
,
(
int
)
$req
->
getParam
(
'total_teachers'
,
0
));
return
$res
->
withStatus
(
204
);
}
}
module/tpe_survey/src/Action/SurveyForm.php
View file @
76b9f1aa
...
...
@@ -11,6 +11,8 @@
namespace
GrEduLabs\TpeSurvey\Action
;
use
GrEduLabs\Schools\Service\StaffService
;
use
GrEduLabs\Schools\Service\StaffServiceInterface
;
use
GrEduLabs\TpeSurvey\Service\SurveyServiceInterface
;
use
Slim\Http\Request
;
use
Slim\Http\Response
;
...
...
@@ -23,16 +25,50 @@ class SurveyForm
*/
private
$service
;
public
function
__construct
(
SurveyServiceInterface
$service
)
{
$this
->
service
=
$service
;
/**
*
* @var callable
*/
private
$inputFilter
;
/**
*
* @var StaffService
*/
private
$staffService
;
public
function
__construct
(
SurveyServiceInterface
$service
,
callable
$inputFilter
,
StaffServiceInterface
$staffService
)
{
$this
->
service
=
$service
;
$this
->
inputFilter
=
$inputFilter
;
$this
->
staffService
=
$staffService
;
}
public
function
__invoke
(
Request
$req
,
Response
$res
)
{
$school
=
$req
->
getAttribute
(
'school'
,
false
);
if
(
!
$school
)
{
return
$res
->
withStatus
(
403
,
'No school'
);
}
$teacherId
=
$req
->
getParam
(
'teacher_id'
);
$teacher
=
$this
->
staffService
->
getTeacherById
(
$teacherId
);
if
(
$teacher
[
'school_id'
]
!==
$school
->
id
)
{
return
$res
->
withStatus
(
403
,
'No school'
);
}
if
(
$req
->
isPost
())
{
$this
->
service
->
saveAnswers
(
$teacherId
,
$req
->
getParams
());
$inputFilter
=
$this
->
inputFilter
;
$result
=
$inputFilter
(
$req
->
getParams
());
if
(
!
$result
[
'is_valid'
])
{
$res
=
$res
->
withStatus
(
422
);
$res
=
$res
->
withJson
(
$result
);
return
$res
;
}
$this
->
service
->
saveAnswers
(
$teacherId
,
$result
[
'values'
]);
}
$data
=
$this
->
service
->
getAnswers
(
$teacherId
);
$res
=
$res
->
withJson
(
$data
);
...
...
module/tpe_survey/src/InputFilter/Survey.php
0 → 100644
View file @
76b9f1aa
<?php
/**
* gredu_labs.
*
* @link https://github.com/eellak/gredu_labs for the canonical source repository
*
* @copyright Copyright (c) 2008-2015 Greek Free/Open Source Software Society (https://gfoss.ellak.gr/)
* @license GNU GPLv3 http://www.gnu.org/licenses/gpl-3.0-standalone.html
*/
namespace
GrEduLabs\TpeSurvey\InputFilter
;
use
GrEduLabs\Schools\InputFilter\InputFilterTrait
;
use
Zend\Filter
;
use
Zend\InputFilter\Input
;
use
Zend\InputFilter\InputFilter
;
use
Zend\Validator
;
class
Survey
{
use
InputFilterTrait
;
public
function
__construct
()
{
$id
=
new
Input
(
'id'
);
$id
->
setRequired
(
false
)
->
getValidatorChain
()
->
attach
(
new
Validator\Digits
());
$alreadyUsing_tpe
=
new
Input
(
'already_using_tpe'
);
$alreadyUsing_tpe
->
setRequired
(
true
)
->
getFilterChain
()
->
attach
(
new
Filter\StripTags
())
->
attach
(
new
Filter\StringTrim
());
$alreadyUsing_tpe
->
getValidatorChain
()
->
attach
(
new
Validator\NotEmpty
());
$knowledgeLevel
=
new
Input
(
'knowledge_level'
);
$knowledgeLevel
->
setRequired
(
true
)
->
getFilterChain
()
->
attach
(
new
Filter\StripTags
())
->
attach
(
new
Filter\StringTrim
());
$knowledgeLevel
->
getValidatorChain
()
->
attach
(
new
Validator\NotEmpty
());
$assetsInUse
=
new
Input
(
'assets_in_use'
);
$assetsInUse
->
setRequired
(
false
)
->
getFilterChain
()
->
attach
(
new
Filter\StripTags
())
->
attach
(
new
Filter\StringTrim
());
$swWeb2
=
new
Input
(
'sw_web2'
);
$swWeb2
->
setRequired
(
false
)
->
getFilterChain
()
->
attach
(
new
Filter\StripTags
())
->
attach
(
new
Filter\StringTrim
());
$swWeb2
->
getValidatorChain
()
->
attach
(
new
Validator\StringLength
([
'max'
=>
'191'
,
]));
$swPackages
=
new
Input
(
'sw_packages'
);
$swPackages
->
setRequired
(
false
)
->
getFilterChain
()
->
attach
(
new
Filter\StripTags
())
->
attach
(
new
Filter\StringTrim
());
$swPackages
->
getValidatorChain
()
->
attach
(
new
Validator\StringLength
([
'max'
=>
'191'
,
]));
$swDigitalschool
=
new
Input
(
'sw_digitalschool'
);
$swDigitalschool
->
setRequired
(
false
)
->
getFilterChain
()
->
attach
(
new
Filter\StripTags
())
->
attach
(
new
Filter\StringTrim
());
$swDigitalschool
->
getValidatorChain
()
->
attach
(
new
Validator\StringLength
([
'max'
=>
'191'
,
]));
$swOther
=
new
Input
(
'sw_other'
);
$swOther
->
setRequired
(
false
)
->
getFilterChain
()
->
attach
(
new
Filter\StripTags
())
->
attach
(
new
Filter\StringTrim
());
$swOther
->
getValidatorChain
()
->
attach
(
new
Validator\StringLength
([
'max'
=>
'191'
,
]));
$ucEduprograms
=
new
Input
(
'uc_eduprograms'
);
$ucEduprograms
->
setRequired
(
false
)
->
getFilterChain
()
->
attach
(
new
Filter\StripTags
())
->
attach
(
new
Filter\StringTrim
());
$ucEduprograms
->
getValidatorChain
()
->
attach
(
new
Validator\StringLength
([
'max'
=>
'191'
,
]));
$ucDigitaldesign
=
new
Input
(
'uc_digitaldesign'
);
$ucDigitaldesign
->
setRequired
(
false
)
->
getFilterChain
()
->
attach
(
new
Filter\StripTags
())
->
attach
(
new
Filter\StringTrim
());
$ucDigitaldesign
->
getValidatorChain
()
->
attach
(
new
Validator\StringLength
([
'max'
=>
'191'
,
]));
$ucAsyncedu
=
new
Input
(
'uc_asyncedu'
);
$ucAsyncedu
->
setRequired
(
false
)
->
getFilterChain
()
->
attach
(
new
Filter\StripTags
())
->
attach
(
new
Filter\StringTrim
());
$ucAsyncedu
->
getValidatorChain
()
->
attach
(
new
Validator\StringLength
([
'max'
=>
'191'
,
]));
$ucOther
=
new
Input
(
'uc_other'
);
$ucOther
->
setRequired
(
false
)
->
getFilterChain
()
->
attach
(
new
Filter\StripTags
())
->
attach
(
new
Filter\StringTrim
());
$ucOther
->
getValidatorChain
()
->
attach
(
new
Validator\StringLength
([
'max'
=>
'191'
,
]));
$extraNeeds
=
new
Input
(
'extra_needs'
);
$extraNeeds
->
setRequired
(
false
)
->
getFilterChain
()
->
attach
(
new
Filter\StripTags
())
->
attach
(
new
Filter\StringTrim
());
$extraNeeds
->
getValidatorChain
()
->
attach
(
new
Validator\StringLength
([
'max'
=>
'191'
,
]));
$this
->
inputFilter
=
new
InputFilter
();
$this
->
inputFilter
->
add
(
$id
)
->
add
(
$alreadyUsing_tpe
)
->
add
(
$knowledgeLevel
)
->
add
(
$assetsInUse
)
->
add
(
$swWeb2
)
->
add
(
$swPackages
)
->
add
(
$swDigitalschool
)
->
add
(
$swOther
)
->
add
(
$ucEduprograms
)
->
add
(
$ucDigitaldesign
)
->
add
(
$ucAsyncedu
)
->
add
(
$ucOther
)
->
add
(
$extraNeeds
);
}
}
module/tpe_survey/src/Middleware/SurveyFormDefaults.php
View file @
76b9f1aa
...
...
@@ -17,6 +17,16 @@ use Slim\Views\Twig;
class
SurveyFormDefaults
{
private
static
$alreadyUsingTpe
=
[
[
'value'
=>
'ΝΑΙ'
,
'label'
=>
'Ναι'
,
],
[
'value'
=>
'ΟΧΙ'
,
'label'
=>
'Όχι, αλλά θα χρησιμοποιούσε αν είχε τα κατάλληλα εργαλεία'
,
],
];
private
static
$knowledgeLevels
=
[
'ΜΕΤΡΙΑ'
,
'ΚΑΛΑ'
,
'ΠΟΛΥ ΚΑΛΑ'
,
'ΑΡΙΣΤΑ'
];
private
static
$assetsInUse
=
[
'Η/Υ'
,
'TABLET'
,
'ΔΣΔ (Διαδραστικό Σύστημα Διδασκαλίας)'
,
'ΒΙΝΤΕΟΠΡΟΒΟΛΕΑΣ'
,
'ΚΙΤ ΡΟΜΠΟΤΙΚΗΣ'
];
private
static
$softwareInUse
=
[
...
...
@@ -74,10 +84,11 @@ class SurveyFormDefaults
if
(
$req
->
isGet
())
{
$this
->
view
[
'tpe_survey'
]
=
[
'knowledge_levels'
=>
array_map
(
$map
,
self
::
$knowledgeLevels
),
'assets_in_use'
=>
array_map
(
$map
,
self
::
$assetsInUse
),
'software_in_use'
=>
self
::
$softwareInUse
,
'use_case'
=>
self
::
$useCase
,
'already_using_tpe'
=>
self
::
$alreadyUsingTpe
,
'knowledge_levels'
=>
array_map
(
$map
,
self
::
$knowledgeLevels
),
'assets_in_use'
=>
array_map
(
$map
,
self
::
$assetsInUse
),
'software_in_use'
=>
self
::
$softwareInUse
,
'use_case'
=>
self
::
$useCase
,
];
}
...
...
module/tpe_survey/src/Service/SurveyService.php
View file @
76b9f1aa
...
...
@@ -20,13 +20,16 @@ class SurveyService implements SurveyServiceInterface
$bean
=
R
::
findOne
(
'tpesurvey'
,
'teacher_id = ?'
,
[
$teacherId
]);