4 Revīzijas

Autors SHA1 Ziņojums Datums
  Gabriel Santiago Plaza 0184b6a732 Ultimos cambios 2 gadus atpakaļ
  Gabriel Santiago Plaza 8352391314 Unos bugs 2 gadus atpakaļ
  Gabriel Santiago Plaza edb944ffa8 Graficas 2 gadus atpakaļ
  Gabriel Santiago Plaza b335de089a la gallina 2 gadus atpakaļ
42 mainītis faili ar 3304 papildinājumiem un 288 dzēšanām
  1. 1
    1
      .gitignore
  2. 3
    10
      app/config/app.php
  3. 71
    0
      app/config/auth.php
  4. 89
    0
      app/config/cache.php
  5. 18
    0
      app/config/compile.php
  6. 124
    0
      app/config/mail.php
  7. 85
    0
      app/config/queue.php
  8. 59
    0
      app/config/remote.php
  9. 31
    0
      app/config/services.php
  10. 140
    0
      app/config/session.php
  11. 31
    0
      app/config/view.php
  12. 31
    0
      app/config/workbench.php
  13. 1
    4
      app/controllers/ActivitiesController.php
  14. 25
    30
      app/controllers/AgreementController.php
  15. 1
    1
      app/controllers/AnnualPlansController.php
  16. 3
    3
      app/controllers/AuthController.php
  17. 20
    4
      app/controllers/CoursesController.php
  18. 45
    3
      app/controllers/ProfessorsController.php
  19. 35
    2
      app/controllers/ProgramCoordinatorsController.php
  20. 72
    5
      app/controllers/ProgramsController.php
  21. 2
    0
      app/controllers/SchoolCoordinatorsController.php
  22. 544
    74
      app/controllers/SchoolsController.php
  23. 4
    4
      app/filters.php
  24. 46
    12
      app/models/Course.php
  25. 185
    0
      app/models/Program.php
  26. 296
    3
      app/models/School.php
  27. 203
    12
      app/views/local/managers/pCoords/overview.blade.php
  28. 1
    1
      app/views/local/managers/sCoords/_new_navigation.blade.php
  29. 26
    3
      app/views/local/managers/shared/grouped_course.blade.php
  30. 29
    3
      app/views/local/managers/shared/limited-course.blade.php
  31. 1
    3
      app/views/local/managers/shared/objectives.blade.php
  32. 49
    7
      app/views/local/managers/shared/print_course.blade.php
  33. 182
    7
      app/views/local/managers/shared/print_program.blade.php
  34. 366
    42
      app/views/local/managers/shared/print_school.blade.php
  35. 36
    4
      app/views/local/managers/shared/program.blade.php
  36. 47
    14
      app/views/local/managers/shared/program_student_result.blade.php
  37. 129
    6
      app/views/local/managers/shared/school.blade.php
  38. 23
    3
      app/views/local/professors/activity.blade.php
  39. 44
    6
      app/views/local/professors/compare_activities.blade.php
  40. 20
    2
      app/views/local/professors/course.blade.php
  41. 19
    3
      app/views/local/professors/overview.blade.php
  42. 167
    16
      app/views/local/professors/program.blade.php

+ 1
- 1
.gitignore Parādīt failu

@@ -11,7 +11,7 @@ app/config/packages/*
11 11
 app/config/testing/*
12 12
 app/config/database.php
13 13
 app/config/app.php
14
-app/config/*
14
+
15 15
 app/storage/annual_pdfs/*
16 16
 public/exports/*
17 17
 

+ 3
- 10
app/config/app.php Parādīt failu

@@ -15,8 +15,8 @@ return array(
15 15
 
16 16
 	//'debug' => $_ENV['APP_DEBUG'] ?: false,
17 17
 
18
-// 	'debug' => true,
19
-	'debug' => false,
18
+	'debug' => true,
19
+	//'debug' => false,
20 20
 	/*
21 21
 	|--------------------------------------------------------------------------
22 22
 	| Application URL
@@ -81,9 +81,6 @@ return array(
81 81
 	*/
82 82
 
83 83
 	// 'key' => 'YourSecretKey!!!',
84
-	// 	'key' => 'JozBz0yQBrZ5kEcPvgxch3RR3E3INSGs',
85
-	// 
86
-	// 	'cipher' => MCRYPT_RIJNDAEL_256,
87 84
 	'key' => '+H!WZJxd5qwb!EHYR8^MLsX@^X6Y?e@+',
88 85
 
89 86
 	'cipher' => MCRYPT_RIJNDAEL_128,
@@ -130,9 +127,7 @@ return array(
130 127
 		'Way\Generators\GeneratorsServiceProvider',
131 128
 		'Barryvdh\DomPDF\ServiceProvider',
132 129
 		// 'Cornford\Backup\Providers\BackupServiceProvider',
133
-		'Zizaco\Entrust\EntrustServiceProvider',
134
-		//To be able to use PDF
135
-		//'Thujohn\Pdf\PdfServiceProvider',
130
+		'Zizaco\Entrust\EntrustServiceProvider'
136 131
 
137 132
 	),
138 133
 
@@ -166,7 +161,6 @@ return array(
166 161
 		'Artisan'           => 'Illuminate\Support\Facades\Artisan',
167 162
 		'Auth'              => 'Illuminate\Support\Facades\Auth',
168 163
 		//'Backup'	        => 'Cornford\Backup\Facades\Backup',
169
-		'Filesystem'        => 'Illuminate\Filesystem\Filesystem',
170 164
 		'Blade'             => 'Illuminate\Support\Facades\Blade',
171 165
 		'Cache'             => 'Illuminate\Support\Facades\Cache',
172 166
 		'ClassLoader'       => 'Illuminate\Support\ClassLoader',
@@ -203,7 +197,6 @@ return array(
203 197
 		'Validator'         => 'Illuminate\Support\Facades\Validator',
204 198
 		'View'              => 'Illuminate\Support\Facades\View',
205 199
 		'PDF'				=> 'Barryvdh\DomPDF\Facade',
206
-		//'PDF' 				=> 'Thujohn\Pdf\PdfFacade',
207 200
 		'Entrust' => 'Zizaco\Entrust\EntrustFacade'
208 201
 
209 202
 

+ 71
- 0
app/config/auth.php Parādīt failu

@@ -0,0 +1,71 @@
1
+<?php
2
+
3
+return array(
4
+
5
+	/*
6
+	|--------------------------------------------------------------------------
7
+	| Default Authentication Driver
8
+	|--------------------------------------------------------------------------
9
+	|
10
+	| This option controls the authentication driver that will be utilized.
11
+	| This driver manages the retrieval and authentication of the users
12
+	| attempting to get access to protected areas of your application.
13
+	|
14
+	| Supported: "database", "eloquent"
15
+	|
16
+	*/
17
+
18
+	'driver' => 'eloquent',
19
+
20
+	/*
21
+	|--------------------------------------------------------------------------
22
+	| Authentication Model
23
+	|--------------------------------------------------------------------------
24
+	|
25
+	| When using the "Eloquent" authentication driver, we need to know which
26
+	| Eloquent model should be used to retrieve your users. Of course, it
27
+	| is often just the "User" model but you may use whatever you like.
28
+	|
29
+	*/
30
+
31
+	'model' => 'User',
32
+
33
+	/*
34
+	|--------------------------------------------------------------------------
35
+	| Authentication Table
36
+	|--------------------------------------------------------------------------
37
+	|
38
+	| When using the "Database" authentication driver, we need to know which
39
+	| table should be used to retrieve your users. We have chosen a basic
40
+	| default value but you may easily change it to any table you like.
41
+	|
42
+	*/
43
+
44
+	'table' => 'users',
45
+
46
+	/*
47
+	|--------------------------------------------------------------------------
48
+	| Password Reminder Settings
49
+	|--------------------------------------------------------------------------
50
+	|
51
+	| Here you may set the settings for password reminders, including a view
52
+	| that should be used as your password reminder e-mail. You will also
53
+	| be able to set the name of the table that holds the reset tokens.
54
+	|
55
+	| The "expire" time is the number of minutes that the reminder should be
56
+	| considered valid. This security feature keeps tokens short-lived so
57
+	| they have less time to be guessed. You may change this as needed.
58
+	|
59
+	*/
60
+
61
+	'reminder' => array(
62
+
63
+		'email' => 'emails.auth.reminder',
64
+
65
+		'table' => 'password_reminders',
66
+
67
+		'expire' => 60,
68
+
69
+	),
70
+
71
+);

+ 89
- 0
app/config/cache.php Parādīt failu

@@ -0,0 +1,89 @@
1
+<?php
2
+
3
+return array(
4
+
5
+	/*
6
+	|--------------------------------------------------------------------------
7
+	| Default Cache Driver
8
+	|--------------------------------------------------------------------------
9
+	|
10
+	| This option controls the default cache "driver" that will be used when
11
+	| using the Caching library. Of course, you may use other drivers any
12
+	| time you wish. This is the default when another is not specified.
13
+	|
14
+	| Supported: "file", "database", "apc", "memcached", "redis", "array"
15
+	|
16
+	*/
17
+
18
+	'driver' => 'file',
19
+
20
+	/*
21
+	|--------------------------------------------------------------------------
22
+	| File Cache Location
23
+	|--------------------------------------------------------------------------
24
+	|
25
+	| When using the "file" cache driver, we need a location where the cache
26
+	| files may be stored. A sensible default has been specified, but you
27
+	| are free to change it to any other place on disk that you desire.
28
+	|
29
+	*/
30
+
31
+	'path' => storage_path().'/cache',
32
+
33
+	/*
34
+	|--------------------------------------------------------------------------
35
+	| Database Cache Connection
36
+	|--------------------------------------------------------------------------
37
+	|
38
+	| When using the "database" cache driver you may specify the connection
39
+	| that should be used to store the cached items. When this option is
40
+	| null the default database connection will be utilized for cache.
41
+	|
42
+	*/
43
+
44
+	'connection' => null,
45
+
46
+	/*
47
+	|--------------------------------------------------------------------------
48
+	| Database Cache Table
49
+	|--------------------------------------------------------------------------
50
+	|
51
+	| When using the "database" cache driver we need to know the table that
52
+	| should be used to store the cached items. A default table name has
53
+	| been provided but you're free to change it however you deem fit.
54
+	|
55
+	*/
56
+
57
+	'table' => 'cache',
58
+
59
+	/*
60
+	|--------------------------------------------------------------------------
61
+	| Memcached Servers
62
+	|--------------------------------------------------------------------------
63
+	|
64
+	| Now you may specify an array of your Memcached servers that should be
65
+	| used when utilizing the Memcached cache driver. All of the servers
66
+	| should contain a value for "host", "port", and "weight" options.
67
+	|
68
+	*/
69
+
70
+	'memcached' => array(
71
+
72
+		array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),
73
+
74
+	),
75
+
76
+	/*
77
+	|--------------------------------------------------------------------------
78
+	| Cache Key Prefix
79
+	|--------------------------------------------------------------------------
80
+	|
81
+	| When utilizing a RAM based store such as APC or Memcached, there might
82
+	| be other applications utilizing the same cache. So, we'll specify a
83
+	| value to get prefixed to all our keys so we can avoid collisions.
84
+	|
85
+	*/
86
+
87
+	'prefix' => 'laravel',
88
+
89
+);

+ 18
- 0
app/config/compile.php Parādīt failu

@@ -0,0 +1,18 @@
1
+<?php
2
+
3
+return array(
4
+
5
+	/*
6
+	|--------------------------------------------------------------------------
7
+	| Additional Compiled Classes
8
+	|--------------------------------------------------------------------------
9
+	|
10
+	| Here you may specify additional classes to include in the compiled file
11
+	| generated by the `artisan optimize` command. These should be classes
12
+	| that are included on basically every request into the application.
13
+	|
14
+	*/
15
+
16
+
17
+
18
+);

+ 124
- 0
app/config/mail.php Parādīt failu

@@ -0,0 +1,124 @@
1
+<?php
2
+
3
+return array(
4
+
5
+	/*
6
+	|--------------------------------------------------------------------------
7
+	| Mail Driver
8
+	|--------------------------------------------------------------------------
9
+	|
10
+	| Laravel supports both SMTP and PHP's "mail" function as drivers for the
11
+	| sending of e-mail. You may specify which one you're using throughout
12
+	| your application here. By default, Laravel is setup for SMTP mail.
13
+	|
14
+	| Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "log"
15
+	|
16
+	*/
17
+
18
+	'driver' => 'smtp',
19
+
20
+	/*
21
+	|--------------------------------------------------------------------------
22
+	| SMTP Host Address
23
+	|--------------------------------------------------------------------------
24
+	|
25
+	| Here you may provide the host address of the SMTP server used by your
26
+	| applications. A default option is provided that is compatible with
27
+	| the Mailgun mail service which will provide reliable deliveries.
28
+	|
29
+	*/
30
+
31
+	'host' => 'smtp.gmail.com',
32
+
33
+	/*
34
+	|--------------------------------------------------------------------------
35
+	| SMTP Host Port
36
+	|--------------------------------------------------------------------------
37
+	|
38
+	| This is the SMTP port used by your application to deliver e-mails to
39
+	| users of the application. Like the host we have set this value to
40
+	| stay compatible with the Mailgun e-mail application by default.
41
+	|
42
+	*/
43
+
44
+	'port' => 465,
45
+
46
+	/*
47
+	|--------------------------------------------------------------------------
48
+	| Global "From" Address
49
+	|--------------------------------------------------------------------------
50
+	|
51
+	| You may wish for all e-mails sent by your application to be sent from
52
+	| the same address. Here, you may specify a name and address that is
53
+	| used globally for all e-mails that are sent by your application.
54
+	|
55
+	*/
56
+
57
+	'from' => array('address' => 'olas.rrp@upr.edu', 'name' => 'OLAS Mail'),
58
+
59
+	/*
60
+	|--------------------------------------------------------------------------
61
+	| E-Mail Encryption Protocol
62
+	|--------------------------------------------------------------------------
63
+	|
64
+	| Here you may specify the encryption protocol that should be used when
65
+	| the application send e-mail messages. A sensible default using the
66
+	| transport layer security protocol should provide great security.
67
+	|
68
+	*/
69
+
70
+	'encryption' => 'ssl',
71
+
72
+	/*
73
+	|--------------------------------------------------------------------------
74
+	| SMTP Server Username
75
+	|--------------------------------------------------------------------------
76
+	|
77
+	| If your SMTP server requires a username for authentication, you should
78
+	| set it here. This will get used to authenticate with your server on
79
+	| connection. You may also set the "password" value below this one.
80
+	|
81
+	*/
82
+
83
+	'username' => 'olas.rrp@upr.edu',
84
+
85
+	/*
86
+	|--------------------------------------------------------------------------
87
+	| SMTP Server Password
88
+	|--------------------------------------------------------------------------
89
+	|
90
+	| Here you may set the password required by your SMTP server to send out
91
+	| messages from your application. This will be given to the server on
92
+	| connection so that the application will be able to send messages.
93
+	|
94
+	*/
95
+
96
+	'password' => 'rectoria2015',
97
+
98
+	/*
99
+	|--------------------------------------------------------------------------
100
+	| Sendmail System Path
101
+	|--------------------------------------------------------------------------
102
+	|
103
+	| When using the "sendmail" driver to send e-mails, we will need to know
104
+	| the path to where Sendmail lives on this server. A default path has
105
+	| been provided here, which will work well on most of your systems.
106
+	|
107
+	*/
108
+
109
+	'sendmail' => '/usr/sbin/sendmail -bs',
110
+
111
+	/*
112
+	|--------------------------------------------------------------------------
113
+	| Mail "Pretend"
114
+	|--------------------------------------------------------------------------
115
+	|
116
+	| When this option is enabled, e-mail will not actually be sent over the
117
+	| web and will instead be written to your application's logs files so
118
+	| you may inspect the message. This is great for local development.
119
+	|
120
+	*/
121
+
122
+	'pretend' => false,
123
+
124
+);

+ 85
- 0
app/config/queue.php Parādīt failu

@@ -0,0 +1,85 @@
1
+<?php
2
+
3
+return array(
4
+
5
+	/*
6
+	|--------------------------------------------------------------------------
7
+	| Default Queue Driver
8
+	|--------------------------------------------------------------------------
9
+	|
10
+	| The Laravel queue API supports a variety of back-ends via an unified
11
+	| API, giving you convenient access to each back-end using the same
12
+	| syntax for each one. Here you may set the default queue driver.
13
+	|
14
+	| Supported: "sync", "beanstalkd", "sqs", "iron", "redis"
15
+	|
16
+	*/
17
+
18
+	'default' => 'sync',
19
+
20
+	/*
21
+	|--------------------------------------------------------------------------
22
+	| Queue Connections
23
+	|--------------------------------------------------------------------------
24
+	|
25
+	| Here you may configure the connection information for each server that
26
+	| is used by your application. A default configuration has been added
27
+	| for each back-end shipped with Laravel. You are free to add more.
28
+	|
29
+	*/
30
+
31
+	'connections' => array(
32
+
33
+		'sync' => array(
34
+			'driver' => 'sync',
35
+		),
36
+
37
+		'beanstalkd' => array(
38
+			'driver' => 'beanstalkd',
39
+			'host'   => 'localhost',
40
+			'queue'  => 'default',
41
+			'ttr'    => 60,
42
+		),
43
+
44
+		'sqs' => array(
45
+			'driver' => 'sqs',
46
+			'key'    => 'your-public-key',
47
+			'secret' => 'your-secret-key',
48
+			'queue'  => 'your-queue-url',
49
+			'region' => 'us-east-1',
50
+		),
51
+
52
+		'iron' => array(
53
+			'driver'  => 'iron',
54
+			'host'    => 'mq-aws-us-east-1.iron.io',
55
+			'token'   => 'your-token',
56
+			'project' => 'your-project-id',
57
+			'queue'   => 'your-queue-name',
58
+			'encrypt' => true,
59
+		),
60
+
61
+		'redis' => array(
62
+			'driver' => 'redis',
63
+			'queue'  => 'default',
64
+		),
65
+
66
+	),
67
+
68
+	/*
69
+	|--------------------------------------------------------------------------
70
+	| Failed Queue Jobs
71
+	|--------------------------------------------------------------------------
72
+	|
73
+	| These options configure the behavior of failed queue job logging so you
74
+	| can control which database and table are used to store the jobs that
75
+	| have failed. You may change them to any database / table you wish.
76
+	|
77
+	*/
78
+
79
+	'failed' => array(
80
+
81
+		'database' => 'mysql', 'table' => 'failed_jobs',
82
+
83
+	),
84
+
85
+);

+ 59
- 0
app/config/remote.php Parādīt failu

@@ -0,0 +1,59 @@
1
+<?php
2
+
3
+return array(
4
+
5
+	/*
6
+	|--------------------------------------------------------------------------
7
+	| Default Remote Connection Name
8
+	|--------------------------------------------------------------------------
9
+	|
10
+	| Here you may specify the default connection that will be used for SSH
11
+	| operations. This name should correspond to a connection name below
12
+	| in the server list. Each connection will be manually accessible.
13
+	|
14
+	*/
15
+
16
+	'default' => 'production',
17
+
18
+	/*
19
+	|--------------------------------------------------------------------------
20
+	| Remote Server Connections
21
+	|--------------------------------------------------------------------------
22
+	|
23
+	| These are the servers that will be accessible via the SSH task runner
24
+	| facilities of Laravel. This feature radically simplifies executing
25
+	| tasks on your servers, such as deploying out these applications.
26
+	|
27
+	*/
28
+
29
+	'connections' => array(
30
+
31
+		'production' => array(
32
+			'host'      => '',
33
+			'username'  => '',
34
+			'password'  => '',
35
+			'key'       => '',
36
+			'keyphrase' => '',
37
+			'root'      => '/var/www',
38
+		),
39
+
40
+	),
41
+
42
+	/*
43
+	|--------------------------------------------------------------------------
44
+	| Remote Server Groups
45
+	|--------------------------------------------------------------------------
46
+	|
47
+	| Here you may list connections under a single group name, which allows
48
+	| you to easily access all of the servers at once using a short name
49
+	| that is extremely easy to remember, such as "web" or "database".
50
+	|
51
+	*/
52
+
53
+	'groups' => array(
54
+
55
+		'web' => array('production')
56
+
57
+	),
58
+
59
+);

+ 31
- 0
app/config/services.php Parādīt failu

@@ -0,0 +1,31 @@
1
+<?php
2
+
3
+return array(
4
+
5
+	/*
6
+	|--------------------------------------------------------------------------
7
+	| Third Party Services
8
+	|--------------------------------------------------------------------------
9
+	|
10
+	| This file is for storing the credentials for third party services such
11
+	| as Stripe, Mailgun, Mandrill, and others. This file provides a sane
12
+	| default location for this type of information, allowing packages
13
+	| to have a conventional place to find your various credentials.
14
+	|
15
+	*/
16
+
17
+	'mailgun' => array(
18
+		'domain' => '',
19
+		'secret' => '',
20
+	),
21
+
22
+	'mandrill' => array(
23
+		'secret' => '',
24
+	),
25
+
26
+	'stripe' => array(
27
+		'model'  => 'User',
28
+		'secret' => '',
29
+	),
30
+
31
+);

+ 140
- 0
app/config/session.php Parādīt failu

@@ -0,0 +1,140 @@
1
+<?php
2
+
3
+return array(
4
+
5
+	/*
6
+	|--------------------------------------------------------------------------
7
+	| Default Session Driver
8
+	|--------------------------------------------------------------------------
9
+	|
10
+	| This option controls the default session "driver" that will be used on
11
+	| requests. By default, we will use the lightweight native driver but
12
+	| you may specify any of the other wonderful drivers provided here.
13
+	|
14
+	| Supported: "file", "cookie", "database", "apc",
15
+	|            "memcached", "redis", "array"
16
+	|
17
+	*/
18
+
19
+	'driver' => 'file',
20
+
21
+	/*
22
+	|--------------------------------------------------------------------------
23
+	| Session Lifetime
24
+	|--------------------------------------------------------------------------
25
+	|
26
+	| Here you may specify the number of minutes that you wish the session
27
+	| to be allowed to remain idle before it expires. If you want them
28
+	| to immediately expire on the browser closing, set that option.
29
+	|
30
+	*/
31
+
32
+	'lifetime' => 120,
33
+
34
+	'expire_on_close' => false,
35
+
36
+	/*
37
+	|--------------------------------------------------------------------------
38
+	| Session File Location
39
+	|--------------------------------------------------------------------------
40
+	|
41
+	| When using the native session driver, we need a location where session
42
+	| files may be stored. A default has been set for you but a different
43
+	| location may be specified. This is only needed for file sessions.
44
+	|
45
+	*/
46
+
47
+	'files' => storage_path().'/sessions',
48
+
49
+	/*
50
+	|--------------------------------------------------------------------------
51
+	| Session Database Connection
52
+	|--------------------------------------------------------------------------
53
+	|
54
+	| When using the "database" or "redis" session drivers, you may specify a
55
+	| connection that should be used to manage these sessions. This should
56
+	| correspond to a connection in your database configuration options.
57
+	|
58
+	*/
59
+
60
+	'connection' => null,
61
+
62
+	/*
63
+	|--------------------------------------------------------------------------
64
+	| Session Database Table
65
+	|--------------------------------------------------------------------------
66
+	|
67
+	| When using the "database" session driver, you may specify the table we
68
+	| should use to manage the sessions. Of course, a sensible default is
69
+	| provided for you; however, you are free to change this as needed.
70
+	|
71
+	*/
72
+
73
+	'table' => 'sessions',
74
+
75
+	/*
76
+	|--------------------------------------------------------------------------
77
+	| Session Sweeping Lottery
78
+	|--------------------------------------------------------------------------
79
+	|
80
+	| Some session drivers must manually sweep their storage location to get
81
+	| rid of old sessions from storage. Here are the chances that it will
82
+	| happen on a given request. By default, the odds are 2 out of 100.
83
+	|
84
+	*/
85
+
86
+	'lottery' => array(2, 100),
87
+
88
+	/*
89
+	|--------------------------------------------------------------------------
90
+	| Session Cookie Name
91
+	|--------------------------------------------------------------------------
92
+	|
93
+	| Here you may change the name of the cookie used to identify a session
94
+	| instance by ID. The name specified here will get used every time a
95
+	| new session cookie is created by the framework for every driver.
96
+	|
97
+	*/
98
+
99
+	'cookie' => 'olas_session',
100
+
101
+	/*
102
+	|--------------------------------------------------------------------------
103
+	| Session Cookie Path
104
+	|--------------------------------------------------------------------------
105
+	|
106
+	| The session cookie path determines the path for which the cookie will
107
+	| be regarded as available. Typically, this will be the root path of
108
+	| your application but you are free to change this when necessary.
109
+	|
110
+	*/
111
+
112
+	'path' => '/',
113
+
114
+	/*
115
+	|--------------------------------------------------------------------------
116
+	| Session Cookie Domain
117
+	|--------------------------------------------------------------------------
118
+	|
119
+	| Here you may change the domain of the cookie used to identify a session
120
+	| in your application. This will determine which domains the cookie is
121
+	| available to in your application. A sensible default has been set.
122
+	|
123
+	*/
124
+
125
+	'domain' => null,
126
+
127
+	/*
128
+	|--------------------------------------------------------------------------
129
+	| HTTPS Only Cookies
130
+	|--------------------------------------------------------------------------
131
+	|
132
+	| By setting this option to true, session cookies will only be sent back
133
+	| to the server if the browser has a HTTPS connection. This will keep
134
+	| the cookie from being sent to you if it can not be done securely.
135
+	|
136
+	*/
137
+
138
+	'secure' => false,
139
+
140
+);

+ 31
- 0
app/config/view.php Parādīt failu

@@ -0,0 +1,31 @@
1
+<?php
2
+
3
+return array(
4
+
5
+	/*
6
+	|--------------------------------------------------------------------------
7
+	| View Storage Paths
8
+	|--------------------------------------------------------------------------
9
+	|
10
+	| Most templating systems load templates from disk. Here you may specify
11
+	| an array of paths that should be checked for your views. Of course
12
+	| the usual Laravel view path has already been registered for you.
13
+	|
14
+	*/
15
+
16
+	'paths' => array(__DIR__.'/../views'),
17
+
18
+	/*
19
+	|--------------------------------------------------------------------------
20
+	| Pagination View
21
+	|--------------------------------------------------------------------------
22
+	|
23
+	| This view will be used to render the pagination link output, and can
24
+	| be easily customized here to show any view you like. A clean view
25
+	| compatible with Twitter's Bootstrap is given to you by default.
26
+	|
27
+	*/
28
+
29
+	'pagination' => 'pagination::slider-3',
30
+
31
+);

+ 31
- 0
app/config/workbench.php Parādīt failu

@@ -0,0 +1,31 @@
1
+<?php
2
+
3
+return array(
4
+
5
+	/*
6
+	|--------------------------------------------------------------------------
7
+	| Workbench Author Name
8
+	|--------------------------------------------------------------------------
9
+	|
10
+	| When you create new packages via the Artisan "workbench" command your
11
+	| name is needed to generate the composer.json file for your package.
12
+	| You may specify it now so it is used for all of your workbenches.
13
+	|
14
+	*/
15
+
16
+	'name' => '',
17
+
18
+	/*
19
+	|--------------------------------------------------------------------------
20
+	| Workbench Author E-Mail Address
21
+	|--------------------------------------------------------------------------
22
+	|
23
+	| Like the option above, your e-mail address is used when generating new
24
+	| workbench packages. The e-mail is placed in your composer.json file
25
+	| automatically after the package is created by the workbench tool.
26
+	|
27
+	*/
28
+
29
+	'email' => '',
30
+
31
+);

+ 1
- 4
app/controllers/ActivitiesController.php Parādīt failu

@@ -818,8 +818,7 @@ class ActivitiesController extends \BaseController
818 818
             ->addSelect('activity_criterion.activity_id', 'activity_criterion.weight', 'activity_criterion.id as activity_criterion_id')
819 819
             ->addSelect('rubric_criterion.rubric_id', 'rubric_criterion.id as rubric_criterion_id')
820 820
             ->get();
821
-        //Log::info("EN mi cuarto o o o");
822
-        //Log::info($rubric_criterion);
821
+
823 822
 
824 823
         foreach ($rubric_criterion as $index => $crit) {
825 824
             $crit->scales = DB::table('scales')
@@ -1003,8 +1002,6 @@ class ActivitiesController extends \BaseController
1003 1002
             ->select('activity_criterion.id', 'activity_criterion.criterion_id')
1004 1003
             ->addSelect('criteria.name')
1005 1004
             ->get();
1006
-        Log::info("AAAA");
1007
-        Log::info($results_2);
1008 1005
 
1009 1006
 
1010 1007
 

+ 25
- 30
app/controllers/AgreementController.php Parādīt failu

@@ -1,6 +1,7 @@
1 1
 <?php
2 2
 
3
-class AgreementController extends \BaseController {
3
+class AgreementController extends \BaseController
4
+{
4 5
 
5 6
 	/**
6 7
 	 * Display a listing of the resource.
@@ -10,9 +11,9 @@ class AgreementController extends \BaseController {
10 11
 	public function index()
11 12
 	{
12 13
 		//
13
-			$user = Auth::user();
14
+		$user = Auth::user();
14 15
 		$title = "Agreement";
15
-	return View::make('global.agreement',compact( 'title', 'user'));
16
+		return View::make('global.agreement', compact('title', 'user'));
16 17
 	}
17 18
 
18 19
 
@@ -23,33 +24,29 @@ class AgreementController extends \BaseController {
23 24
 	 */
24 25
 	public function agree()
25 26
 	{
26
-// 		var_dump(Input::get('submitbutton'));exit();
27
-		if(Input::get('submitbutton')=="Agree")
28
-		{
27
+		// 		var_dump(Input::get('submitbutton'));exit();
28
+		if (Input::get('submitbutton') == "Agree") {
29 29
 			switch (Auth::user()->role) {
30
-		case 1:
31
-			return Redirect::intended('administrator');
32
-			break;
33
-
34
-		case 2:
35
-			return Redirect::intended('school-coordinator');
36
-			break;
37
-
38
-		case 3:
39
-			return Redirect::intended('program-coordinator');
40
-			break;
41
-
42
-		case 4:
43
-			return Redirect::intended('professor');
44
-			break;
45
-		}
46
-		}
47
-		else
48
-		{
30
+				case 1:
31
+					return Redirect::intended('administrator');
32
+					break;
33
+
34
+				case 2:
35
+					return Redirect::intended('school/' . Auth::user()->school->id);
36
+					break;
37
+
38
+				case 3:
39
+					return Redirect::intended('program-coordinator');
40
+					break;
41
+
42
+				case 4:
43
+					return Redirect::intended('professor');
44
+					break;
45
+			}
46
+		} else {
49 47
 			return Redirect::intended('logout');
50
-
51 48
 		}
52
-	
49
+
53 50
 
54 51
 		//
55 52
 	}
@@ -112,6 +109,4 @@ class AgreementController extends \BaseController {
112 109
 	{
113 110
 		//
114 111
 	}
115
-
116
-
117
-}
112
+}

+ 1
- 1
app/controllers/AnnualPlansController.php Parādīt failu

@@ -1200,7 +1200,7 @@ class AnnualPlansController extends \BaseController
1200 1200
     */
1201 1201
     $annualPlan = AnnualPlan::findOrFail($queryToPath->annual_plan_id);
1202 1202
 
1203
-    Log::info("ERES TU?");
1203
+    // Log::info("ERES TU?");
1204 1204
 
1205 1205
     //return View::make('local.managers.shared.print_annual_report', compact('annualPlan'));
1206 1206
     $pdf = $pdf->loadView('local.managers.shared.print_annual_report', compact('annualPlan'))

+ 3
- 3
app/controllers/AuthController.php Parādīt failu

@@ -28,9 +28,9 @@ class AuthController extends \BaseController
28 28
 
29 29
 		if (!$validator->fails()) {
30 30
 			//			TODO: Remove this for production environment
31
-// 			if (App::environment('local', 'staging')) {
32
-// 				return $this->processLogin();
33
-// 			}
31
+			if (App::environment('local', 'staging')) {
32
+				return $this->processLogin();
33
+			}
34 34
 			try {
35 35
 				// User input
36 36
 				$username = str_replace('@upr.edu', '', Input::get('email'));

+ 20
- 4
app/controllers/CoursesController.php Parādīt failu

@@ -589,6 +589,7 @@ CoursesController extends \BaseController
589 589
         $grouped_courses = Course::where('code', $code)
590 590
             ->where('number', $number)
591 591
             ->where('semester_id', $semester->id)
592
+            ->select("courses.*", DB::raw("1 as grouped"))
592 593
             ->groupBy(array('code', 'number'))->get();
593 594
 
594 595
         //         Log::info($grouped_courses[0]->id);
@@ -600,15 +601,19 @@ CoursesController extends \BaseController
600 601
             ->first();
601 602
 
602 603
         $outcomes = Outcome::active_by_semesters(array($semester), $level->is_graduate);
604
+        $outcomeCount = count((array)$outcomes);
605
+
606
+
607
+        foreach ($outcomes as $outcome) {
608
+            $outcomes_attempted[$outcome->id] = 0;
609
+            $outcomes_achieved[$outcome->id] = 0;
610
+        }
603 611
 
604 612
 
605 613
         //         $outcomes = Outcome::orderBy('name', 'asc')->get();
606
-        $outcomeCount = Outcome::all()->count();
614
+
607 615
 
608 616
         foreach ($grouped_courses as $index => $grouped_course) {
609
-            // Blank outcomes for one course
610
-            $outcomes_achieved = array_fill(1, $outcomeCount, 0);
611
-            $outcomes_attempted = array_fill(1, $outcomeCount, 0);
612 617
 
613 618
             // Find sections for this course
614 619
             $sections = Course::where('code', $grouped_course->code)
@@ -616,6 +621,15 @@ CoursesController extends \BaseController
616 621
                 ->where('semester_id', $grouped_course->semester_id)
617 622
                 ->get();
618 623
 
624
+
625
+            $results = $grouped_course->student_report_for_outcome;
626
+            // Log::info($results);
627
+            foreach ($outcomes as $outcome) {
628
+                $outcomes_attempted[$outcome->id] += isset($results[$outcome->id]) ? $results[$outcome->id]['calculations']['student_attempted'] : 0;
629
+                $outcomes_achieved[$outcome->id] +=  isset($results[$outcome->id]) ? $results[$outcome->id]['calculations']['student_achieved'] : 0;
630
+            }
631
+            /*
632
+
619 633
             // For each of the sections, add the attempted and achieved criteria per outcome
620 634
             foreach ($sections as &$section) {
621 635
                 if ($section->outcomes_ach()) {
@@ -644,6 +658,8 @@ CoursesController extends \BaseController
644 658
                 //                 }
645 659
             }
646 660
         }
661
+        */
662
+        }
647 663
 
648 664
         $section_ids = Course::where('code', $code)
649 665
             ->where('number', $number)

+ 45
- 3
app/controllers/ProfessorsController.php Parādīt failu

@@ -33,6 +33,8 @@ class ProfessorsController extends \BaseController
33 33
 
34 34
 
35 35
 
36
+
37
+
36 38
         foreach ($grouped_courses as $index => $grouped_course) {
37 39
             // Blank outcomes for one course
38 40
 
@@ -42,6 +44,11 @@ class ProfessorsController extends \BaseController
42 44
             $outcomes_achieved = [];
43 45
             $outcomes_attempted = [];
44 46
 
47
+            foreach ($outcomes as $outcome) {
48
+                $outcomes_achieved[$outcome->id] = 0;
49
+                $outcomes_attempted[$outcome->id] = 0;
50
+            }
51
+
45 52
             // Find sections belonging to user with identifier of one course
46 53
             $sections = Course::with('program')
47 54
                 ->where('user_id', Auth::user()->id)
@@ -51,9 +58,17 @@ class ProfessorsController extends \BaseController
51 58
                 ->where('semester_id', $grouped_course->semester_id)
52 59
                 ->get();
53 60
 
61
+            $results = $grouped_course->student_report_for_outcome;
62
+            Log::info($results);
63
+            foreach ($outcomes as $outcome) {
64
+                $outcomes_attempted[$outcome->id] += isset($results[$outcome->id]) ? $results[$outcome->id]['calculations']['student_attempted'] : 0;
65
+                $outcomes_achieved[$outcome->id] +=  isset($results[$outcome->id]) ? $results[$outcome->id]['calculations']['student_achieved'] : 0;
66
+            }
67
+
54 68
             // 			        Log::info($sections);
55 69
 
56 70
             // For each of the professor's course sections, add the attempted and achieved criteria per outcome
71
+            /*
57 72
             foreach ($sections as $section) {
58 73
 
59 74
                 $section_outcomes_achieved = $section->outcomes_ach();
@@ -85,7 +100,7 @@ class ProfessorsController extends \BaseController
85 100
                         //$outcomes_attempted[$outcome_id] += $section_outcomes_attempted[$outcome_id];
86 101
                     }
87 102
                 }
88
-            }
103
+            }*/
89 104
 
90 105
             $grouped_outcomes_achieved_results[] = $outcomes_achieved;
91 106
             $grouped_outcomes_attempted_results[] = $outcomes_attempted;
@@ -113,8 +128,20 @@ class ProfessorsController extends \BaseController
113 128
         $outcomeCount = count($outcomes);
114 129
         $outcomes_achieved = [];
115 130
         $outcomes_attempted = [];
131
+        $program_outcomes_achieved = [];
132
+        $program_outcomes_attempted = [];
116 133
 
117
-        Log::info($program_courses);
134
+        //Log::info($program_courses);
135
+
136
+        foreach ($outcomes as $outcome) {
137
+            $outcomes_achieved[$outcome->id] = 0;
138
+            $outcomes_attempted[$outcome->id] = 0;
139
+            $program_outcomes_achieved[$outcome->id] = 0;
140
+            $program_outcomes_attempted[$outcome->id] = 0;
141
+        }
142
+
143
+        $program_outcomes_attempted = $program->program_students_per_outcome['program_info']['outcomes_attempted_combined'];
144
+        $program_outcomes_achieved = $program->program_students_per_outcome['program_info']['outcomes_achieved_combined'];
118 145
 
119 146
         /*
120 147
         foreach ($program_courses as $course) {
@@ -151,6 +178,21 @@ class ProfessorsController extends \BaseController
151 178
                     $outcomes_attempted[$outcome] += $outcome_score['calculations']['student_attempted'];
152 179
                 else $outcomes_attempted[$outcome] = $outcome_score['calculations']['student_attempted'];
153 180
             }
181
+            /*
182
+            $course->with_program_report = 1;
183
+
184
+            $stu_ach = $course->student_report_for_outcome;
185
+
186
+
187
+            foreach ($stu_ach as $outcome => $outcome_score) {
188
+                if (array_key_exists($outcome, $program_outcomes_achieved))
189
+                    $program_outcomes_achieved[$outcome] += $outcome_score['calculations']['student_achieved'];
190
+                else $program_outcomes_achieved[$outcome] = $outcome_score['calculations']['student_achieved'];
191
+
192
+                if (array_key_exists($outcome, $program_outcomes_attempted))
193
+                    $program_outcomes_attempted[$outcome] += $outcome_score['calculations']['student_attempted'];
194
+                else $program_outcomes_attempted[$outcome] = $outcome_score['calculations']['student_attempted'];
195
+            }*/
154 196
         }
155 197
 
156 198
 
@@ -167,7 +209,7 @@ class ProfessorsController extends \BaseController
167 209
             ->where('program_id', $program->id)
168 210
             ->get();
169 211
 
170
-        return View::make('local.professors.program', compact('title', 'outcomes', 'outcomes_attempted', 'outcomes_achieved', 'scoords', 'pcoords'));
212
+        return View::make('local.professors.program', compact('title', 'outcomes', 'program_outcomes_achieved', 'program_outcomes_attempted', 'outcomes_attempted', 'program', 'outcomes_achieved', 'scoords', 'pcoords'));
171 213
     }
172 214
 
173 215
 

+ 35
- 2
app/controllers/ProgramCoordinatorsController.php Parādīt failu

@@ -14,7 +14,7 @@ class ProgramCoordinatorsController extends \BaseController
14 14
         return Redirect::to('administrator');
15 15
         break;
16 16
       case 2:
17
-        return Redirect::to('school-coordinator');
17
+        return Redirect::to('school/' . Auth::user()->school->id);
18 18
         break;
19 19
     }
20 20
     //Log::info(Auth::user()->programs);
@@ -76,8 +76,23 @@ class ProgramCoordinatorsController extends \BaseController
76 76
 
77 77
       $program_array['outcomes_achieved'] = [];
78 78
       $program_array['outcomes_attempted'] = [];
79
+
80
+      $program_array['program_outcomes_achieved'] = [];
81
+      $program_array['program_outcomes_attempted'] = [];
79 82
       //Log::info($program_array);
80 83
 
84
+      foreach ($outcomes as $outcome) {
85
+        $program_array['outcomes_achieved'][$outcome->id] = 0;
86
+        $program_array['outcomes_attempted'][$outcome->id] = 0;
87
+        $program_array['program_outcomes_achieved'][$outcome->id] = 0;
88
+        $program_array['program_outcomes_attempted'][$outcome->id] = 0;
89
+      }
90
+
91
+      $program_array['program_outcomes_achieved']  = $program->program_students_per_outcome['program_info']['outcomes_achieved_combined'];
92
+      $program_array['program_outcomes_attempted'] = $program->program_students_per_outcome['program_info']['outcomes_attempted_combined'];
93
+
94
+
95
+
81 96
       $program_array['program_courses'] = $program->courses;
82 97
 
83 98
 
@@ -95,6 +110,20 @@ class ProgramCoordinatorsController extends \BaseController
95 110
             if (array_key_exists($outcome_id, $program_array['outcomes_achieved']))  $program_array['outcomes_achieved'][$outcome_id] += $student_report[$outcome_id]['calculations']['student_achieved'];
96 111
             else $program_array['outcomes_achieved'][$outcome_id] = $student_report[$outcome_id]['calculations']['student_achieved'];
97 112
           }
113
+          /*
114
+
115
+          $course->with_program_report = 1;
116
+
117
+          $program_student_report = $course->student_report_for_outcome;
118
+
119
+          foreach ($program_student_report as $outcome_id => $score) {
120
+            if (array_key_exists($outcome_id, $program_array['program_outcomes_attempted']))  $program_array['program_outcomes_attempted'][$outcome_id] += $program_student_report[$outcome_id]['calculations']['student_attempted'];
121
+            else $program_array['program_outcomes_attempted'][$outcome_id] = $program_student_report[$outcome_id]['calculations']['student_attempted'];
122
+
123
+            if (array_key_exists($outcome_id, $program_array['program_outcomes_achieved']))  $program_array['program_outcomes_achieved'][$outcome_id] += $program_student_report[$outcome_id]['calculations']['student_achieved'];
124
+            else $program_array['program_outcomes_achieved'][$outcome_id] = $program_student_report[$outcome_id]['calculations']['student_achieved'];
125
+          } */
126
+
98 127
 
99 128
 
100 129
           $program_array['assessed_courses_count'] += 1;
@@ -102,6 +131,8 @@ class ProgramCoordinatorsController extends \BaseController
102 131
       }
103 132
 
104 133
 
134
+
135
+
105 136
       /*foreach ($programs as $program) {
106 137
       //Log::info($program);
107 138
       $program_array = array();
@@ -189,7 +220,9 @@ class ProgramCoordinatorsController extends \BaseController
189 220
         ->orderBy('number')
190 221
         ->orderBy('semester_id')
191 222
         ->get();
192
-      //Log::info($program_array);
223
+
224
+
225
+      $program_array['linea_de_graph'] = $program->expected_outcome_target;
193 226
       $programs_array[] = $program_array;
194 227
 
195 228
 

+ 72
- 5
app/controllers/ProgramsController.php Parādīt failu

@@ -11,8 +11,8 @@ class ProgramsController extends \BaseController
11 11
   {
12 12
 
13 13
     $program = Program::find($id);
14
-    Log::info(debug_backtrace()[1]['function']);
15
-    Log::info($program);
14
+    //Log::info(debug_backtrace()[1]['function']);
15
+    // Log::info($program);
16 16
     $title = $program->school->name . ': ' . $program->name;
17 17
     $program_courses = $program->courses;
18 18
     //     $outcomes = Outcome::orderBy('name', 'asc')->get();
@@ -54,10 +54,35 @@ class ProgramsController extends \BaseController
54 54
       })
55 55
       ->count();
56 56
 
57
+
58
+    $outcomes_attempted = [];
59
+    $outcomes_achieved = [];
60
+
61
+    $program_info = $program->program_students_per_outcome;
62
+
63
+    $outcomes_attempted = $program_info['program_info']['outcomes_attempted_combined'];
64
+    $outcomes_achieved = $program_info['program_info']['outcomes_achieved_combined'];
65
+    /*
57 66
     foreach ($outcomes as $outcome) {
58
-      $outcomes_attempted[$outcome->id] = $program->attempted_outcome($outcome->id, $selected_semesters);
59
-      if ($outcomes_attempted[$outcome->id]) $outcomes_achieved[$outcome->id] = $program->achieved_outcome($outcome->id, $selected_semesters);
67
+      $outcomes_attempted[$outcome->id] = 0;
68
+      $outcomes_achieved[$outcome->id] = 0;
69
+    }
70
+
71
+
72
+    //foreach ($outcomes as $outcome) {
73
+    //  $outcomes_attempted[$outcome->id] = $program->attempted_outcome($outcome->id, $selected_semesters);
74
+    //  if ($outcomes_attempted[$outcome->id]) $outcomes_achieved[$outcome->id] = $program->achieved_outcome($outcome->id, $selected_semesters);
75
+    //}
76
+
77
+    foreach ($program->courses as $course) {
78
+      $results = $course->student_report_for_outcome;
79
+      //Log::info($results);
80
+      foreach ($outcomes as $outcome) {
81
+        $outcomes_attempted[$outcome->id] += isset($results[$outcome->id]) ? $results[$outcome->id]['calculations']['student_attempted'] : 0;
82
+        $outcomes_achieved[$outcome->id] +=  isset($results[$outcome->id]) ? $results[$outcome->id]['calculations']['student_achieved'] : 0;
83
+      }
60 84
     }
85
+    */
61 86
 
62 87
     foreach ($outcomes as $outcome) {
63 88
       $assessed_courses[$outcome->id] = DB::table('activity_criterion')
@@ -668,15 +693,56 @@ class ProgramsController extends \BaseController
668 693
     $outcomes_achieved = [];
669 694
     $outcomes_attempted = [];
670 695
 
696
+    $program_outcomes_attempted = [];
697
+    $program_outcomes_achieved = [];
698
+
671 699
     // 	Log::info($program_courses);
672 700
     foreach ($outcomes as $outcome) {
673 701
       $outcomes_attempted[$outcome->id] = 0;
674 702
       $outcomes_achieved[$outcome->id] = 0;
703
+      $program_outcomes_attempted[$outcome->id] = 0;
704
+      $program_outcomes_achieved[$outcome->id] = 0;
675 705
     }
676 706
 
677 707
     $assessed_courses_count = 0;
708
+
709
+    $program_outcomes_attempted = $program->program_students_per_outcomes['program_info']['outcomes_attempted_combined'];
710
+    $program_outcomes_achieved = $program->program_students_per_outcomes['program_info']['outcomes_achieved_combined'];
711
+
712
+
678 713
     foreach ($program_courses as $course) {
679 714
 
715
+
716
+      $student_report = $course->student_report_for_outcome;
717
+
718
+      if ($student_report) {
719
+
720
+        foreach ($student_report as $outcome_id => $score) {
721
+          if (array_key_exists($outcome_id, $outcomes_attempted))  $outcomes_attempted[$outcome_id] += $student_report[$outcome_id]['calculations']['student_attempted'];
722
+          else $outcomes_attempted[$outcome_id] = $student_report[$outcome_id]['calculations']['student_attempted'];
723
+
724
+          if (array_key_exists($outcome_id, $outcomes_achieved))  $outcomes_achieved[$outcome_id] += $student_report[$outcome_id]['calculations']['student_achieved'];
725
+          else $outcomes_achieved[$outcome_id] = $student_report[$outcome_id]['calculations']['student_achieved'];
726
+        }
727
+      }
728
+      /*
729
+      $course->with_program_report = 1;
730
+      $student_report = $course->student_report_for_outcome;
731
+
732
+      if ($student_report) {
733
+
734
+        foreach ($student_report as $outcome_id => $score) {
735
+          if (array_key_exists($outcome_id, $program_outcomes_attempted))  $program_outcomes_attempted[$outcome_id] += $student_report[$outcome_id]['calculations']['student_attempted'];
736
+          else $program_outcomes_attempted[$outcome_id] = $student_report[$outcome_id]['calculations']['student_attempted'];
737
+
738
+          if (array_key_exists($outcome_id, $program_outcomes_achieved))  $program_outcomes_achieved[$outcome_id] += $student_report[$outcome_id]['calculations']['student_achieved'];
739
+          else $program_outcomes_achieved[$outcome_id] = $student_report[$outcome_id]['calculations']['student_achieved'];
740
+        }
741
+      }
742
+
743
+*/
744
+
745
+      /*
680 746
       if ($course->outcomes_att()) {
681 747
         $course_outcomes_attempted = $course->outcomes_att();
682 748
         foreach ($course_outcomes_attempted as $outcome => $score) {
@@ -696,6 +762,7 @@ class ProgramsController extends \BaseController
696 762
           else $outcomes_achieved[$outcome] = $score;
697 763
         }
698 764
       }
765
+      */
699 766
     }
700 767
 
701 768
 
@@ -848,7 +915,7 @@ class ProgramsController extends \BaseController
848 915
     $programs_contact[] = $users;
849 916
 
850 917
 
851
-    return View::make('local.managers.shared.print_program', compact('title', 'program', 'outcomes', 'outcomes_attempted', 'outcomes_achieved', 'schools', 'program_courses', 'assessed_courses_count', 'grouped_courses'));
918
+    return View::make('local.managers.shared.print_program', compact('title', 'program_outcomes_achieved', 'program_outcomes_attempted', 'program', 'outcomes', 'outcomes_attempted', 'outcomes_achieved', 'schools', 'program_courses', 'assessed_courses_count', 'grouped_courses'));
852 919
   }
853 920
 
854 921
 

+ 2
- 0
app/controllers/SchoolCoordinatorsController.php Parādīt failu

@@ -400,6 +400,8 @@ class SchoolCoordinatorsController extends \BaseController
400 400
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
401 401
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
402 402
         }
403
+
404
+
403 405
         if ($school->id == 13) {
404 406
             //             return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
405 407
             return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes_grad', 'outcomes_undergrad', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs'));

+ 544
- 74
app/controllers/SchoolsController.php Parādīt failu

@@ -1,5 +1,7 @@
1 1
 <?php
2 2
 
3
+use PhpOffice\PhpWord\Element\Object;
4
+
3 5
 class SchoolsController extends \BaseController
4 6
 {
5 7
 
@@ -38,10 +40,10 @@ class SchoolsController extends \BaseController
38 40
         $outcomes_grad = Outcome::active_by_semesters($semesters, 1);
39 41
         $outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
40 42
 
41
-        $undergrad_stu_outcome_attempted = [];
42
-        $grad_stu_outcome_attempted = [];
43
-        $undergrad_stu_outcome_achieved = [];
44
-        $grad_stu_outcome_achieved = [];
43
+        //$undergrad_stu_outcome_attempted = [];
44
+        //$grad_stu_outcome_attempted = [];
45
+        //$undergrad_stu_outcome_achieved = [];
46
+        //$grad_stu_outcome_achieved = [];
45 47
 
46 48
         $attemptedUndergradProgramsPerOutcome = [];
47 49
         $achievedUndergradProgramsPerOutcome = [];
@@ -49,19 +51,20 @@ class SchoolsController extends \BaseController
49 51
         $achievedGradProgramsPerOutcome = [];
50 52
 
51 53
         foreach ($outcomes_undergrad as $outcome) {
52
-            $undergrad_stu_outcome_attempted[$outcome->id] = 0;
53
-            $undergrad_stu_outcome_achieved[$outcome->id] = 0;
54
+            //$undergrad_stu_outcome_attempted[$outcome->id] = 0;
55
+            //$undergrad_stu_outcome_achieved[$outcome->id] = 0;
54 56
             $attemptedUndergradProgramsPerOutcome[$outcome->id] = [];
55 57
             $achievedUndergradProgramsPerOutcome[$outcome->id] = [];
56 58
         }
57 59
 
58 60
         foreach ($outcomes_grad as $outcome) {
59
-            $grad_stu_outcome_attempted[$outcome->id] = 0;
60
-            $grad_stu_outcome_achieved[$outcome->id] = 0;
61
+            //$grad_stu_outcome_attempted[$outcome->id] = 0;
62
+            //$grad_stu_outcome_achieved[$outcome->id] = 0;
61 63
             $attemptedGradProgramsPerOutcome[$outcome->id] = [];
62 64
             $achievedGradProgramsPerOutcome[$outcome->id] = [];
63 65
         }
64 66
 
67
+
65 68
         /**
66 69
          * List of grouped courses (grouped sections)
67 70
          */
@@ -101,7 +104,7 @@ class SchoolsController extends \BaseController
101 104
             ->orderBy('name', 'ASC')
102 105
             ->lists('id');
103 106
 
104
-
107
+        /*
105 108
         $undergraduate_student_query = DB::table("courses")
106 109
             ->join('activities', 'activities.course_id', '=', 'courses.id')
107 110
             ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
@@ -125,7 +128,7 @@ class SchoolsController extends \BaseController
125 128
             ->get();
126 129
 
127 130
 
128
-        Log::info($undergraduate_student_query);
131
+        //Log::info($undergraduate_student_query);
129 132
 
130 133
         $grad_student_query = DB::table("courses")
131 134
             ->join('activities', 'activities.course_id', '=', 'courses.id')
@@ -148,75 +151,19 @@ class SchoolsController extends \BaseController
148 151
             ->addSelect('outcome_id')
149 152
             ->groupBy(array('students.id', 'outcome_id'))
150 153
             ->get();
151
-
154
+*/
152 155
         //school
153 156
 
154 157
 
155 158
 
156
-        /*
157
-            student x, crit achieved, crit attempted, outcome 1
158
-            student x, crit achieved, crit attempted, outcome 2
159
-            student x, crit achieved, crit attempted, outcome 3
160
-            student x, crit achieved, crit attempted, outcome 4
161
-            student y, crit achieved, crit attempted, outcome 1
162
-            student y, crit achieved, crit attempted, outcome 2
163
-            student y, crit achieved, crit attempted, outcome 3
164
-            ....
165
-            
166
-
167
-            */
168
-
169
-        $grad_outcomes_attempted = [];
170
-        $grad_outcomes_achieved = [];
171
-        $undergrad_outcomes_attempted = [];
172
-        $undergrad_outcomes_achieved = [];
173
-
174
-        foreach ($outcomes_grad as $outcome) {
175
-            $grad_outcomes_attempted[$outcome->id] = 0;
176
-            $grad_outcomes_achieved[$outcome->id] = 0;
177
-        }
178
-
179
-        foreach ($outcomes_undergrad as $outcome) {
180
-            $undergrad_outcomes_attempted[$outcome->id] = 0;
181
-            $undergrad_outcomes_achieved[$outcome->id] = 0;
182
-        }
183
-
184
-        foreach ($grad_student_query as $result) {
185
-            if ($result->criteria_attempted != 0) {
186
-                if (!isset($grad_outcomes_attempted[$result->outcome_id]))
187
-                    continue;
188
-
189
-                $grad_outcomes_attempted[$result->outcome_id]++;
190
-
191
-                $percent = $result->criteria_achieved / $result->criteria_attempted * 100;
192
-
193
-                if ($percent >= 66.66) {
194
-
195
-
196
-                    $grad_outcomes_achieved[$result->outcome_id]++;
197
-                }
198
-            }
199
-        }
200
-
201
-
202
-
203 159
 
204
-        foreach ($undergraduate_student_query as $result) {
205
-            if ($result->criteria_attempted != 0) {
206
-                if (!isset($undergrad_outcomes_attempted[$result->outcome_id]))
207
-                    continue;
208 160
 
209
-                $undergrad_outcomes_attempted[$result->outcome_id]++;
210
-
211
-                $percent = $result->criteria_achieved / $result->criteria_attempted * 100;
161
+        $school_info = $school->school_students_per_outcome;
162
+        $grad_outcomes_attempted = $school_info['graduate_info']['outcomes_attempted_combined'];
163
+        $grad_outcomes_achieved = $school_info['graduate_info']['outcomes_achieved_combined'];
212 164
 
213
-                if ($percent >= 66.66) {
214
-
215
-
216
-                    $undergrad_outcomes_achieved[$result->outcome_id]++;
217
-                }
218
-            }
219
-        }
165
+        $undergrad_outcomes_attempted = $school_info['undergraduate_info']['outcomes_attempted_combined'];
166
+        $undergrad_outcomes_achieved = $school_info['undergraduate_info']['outcomes_achieved_combined'];
220 167
 
221 168
         $grad_grouped_courses = Course::
222 169
             //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
@@ -302,6 +249,7 @@ class SchoolsController extends \BaseController
302 249
         //asi que lo que esta haciendo es, prog 1, y coge los dominios y estudiantes que evaluason
303 250
 
304 251
 
252
+
305 253
         $undergrad_prog_attempted =  DB::table("courses")
306 254
             ->join('activities', 'activities.course_id', '=', 'courses.id')
307 255
             ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
@@ -468,12 +416,79 @@ class SchoolsController extends \BaseController
468 416
                 $query->whereIn('semester_id', Session::get('semesters_ids'));
469 417
             }))->where('is_graduate', 1)->where('school_id', $school->id)->orderBy('name', 'asc')->get();
470 418
         }*/
419
+
420
+
421
+        //La linea negra de proposed.
422
+
423
+        //
424
+        $linea_undergrad = DB::table('target_outcomes_program')
425
+            ->join('programs', 'programs.id', '=', 'target_outcomes_program.program_id')
426
+            ->join('semesters', 'semesters.id', '=', 'target_outcomes_program.semester_id')
427
+            ->whereIn('program_id', $undergrad_programs_list)
428
+            ->whereIn("semester_id", Session::get('semesters_ids'))
429
+            ->select("target_outcomes_program.*", 'programs.name as program_name', 'semesters.name as semester_name')
430
+            ->addSelect(DB::raw("count(target_outcomes_program.semester_id) as count_semester_id"))
431
+            ->groupBy("expected_target")
432
+            ->orderBy("expected_target", "DESC")
433
+            ->first();
434
+        if (!isset($linea_undergrad)) {
435
+            $default_undergrad = 70;
436
+        } elseif ($linea_undergrad->count_semester_id > 1) {
437
+
438
+            $default_undergrad = null;
439
+
440
+            $linea_undergrad = DB::table('target_outcomes_program')
441
+                ->join('programs', 'programs.id', '=', 'target_outcomes_program.program_id')
442
+                ->join('semesters', 'semesters.id', '=', 'target_outcomes_program.semester_id')
443
+                ->whereIn('program_id', $undergrad_programs_list)
444
+                ->where('expected_target', $linea_undergrad->expected_target)
445
+                ->whereIn("semester_id", Session::get('semesters_ids'))
446
+                ->select("target_outcomes_program.*", 'programs.name as program_name', 'semesters.name as semester_name')
447
+                //->addSelect("count(semester_id) as count_semester_id")
448
+                //->groupBy("expected_target")
449
+                ->orderBy("semester_id", "DESC")
450
+                ->first();
451
+        }
452
+
453
+        $linea_grad = DB::table('target_outcomes_program')
454
+            ->join('programs', 'programs.id', '=', 'target_outcomes_program.program_id')
455
+            ->join('semesters', 'semesters.id', '=', 'target_outcomes_program.semester_id')
456
+            ->whereIn('program_id', $grad_programs_list)
457
+            ->whereIn("semester_id", Session::get('semesters_ids'))
458
+            ->select("target_outcomes_program.*", 'programs.name as program_name', 'semesters.name as semester_name')
459
+            ->addSelect(DB::raw("count(target_outcomes_program.semester_id) as count_semester_id"))
460
+            ->groupBy("expected_target")
461
+            ->orderBy("expected_target", "DESC")
462
+            ->first();
463
+        Log::info($linea_grad);
464
+        if (!isset($linea_grad)) {
465
+            $default_grad = 70;
466
+        } elseif ($linea_grad->count_semester_id > 1) {
467
+
468
+            $default_grad = null;
469
+
470
+            $linea_grad = DB::table('target_outcomes_program')
471
+                ->join('programs', 'programs.id', '=', 'target_outcomes_program.program_id')
472
+                ->join('semesters', 'semesters.id', '=', 'target_outcomes_program.semester_id')
473
+                ->whereIn('program_id', $grad_programs_list)
474
+                ->where('expected_target', $linea_grad->expected_target)
475
+                ->whereIn("semester_id", Session::get('semesters_ids'))
476
+                ->select("target_outcomes_program.*", 'programs.name as program_name', 'semesters.name as semester_name')
477
+                ->orderBy("semester_id", "DESC")
478
+                ->first();
479
+        }
480
+
481
+        Log::info($default_grad);
482
+
483
+
484
+
485
+
471 486
         if ($school->id == 13) {
472 487
             //             return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
473
-            return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes_grad', 'outcomes_undergrad', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs'));
488
+            return View::make('local.managers.shared.school-uhs', compact('title', 'default_undergrad', 'default_grad', 'linea_undergrad', 'linea_grad', 'outcomes_grad', 'outcomes_undergrad', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs'));
474 489
         } else {
475 490
             //             return View::make('local.managers.shared.school', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
476
-            return View::make('local.managers.shared.school', compact('title', 'outcomes_grad', 'outcomes_undergrad', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs'));
491
+            return View::make('local.managers.shared.school', compact('title',  'default_undergrad', 'default_grad', 'linea_undergrad', 'linea_grad', 'outcomes_grad', 'outcomes_undergrad', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs'));
477 492
         }
478 493
     }
479 494
 
@@ -502,6 +517,9 @@ class SchoolsController extends \BaseController
502 517
             $programs_name[$program->id] = $program->name;
503 518
         }
504 519
 
520
+        $school->school_students_per_outcome;
521
+
522
+
505 523
         $grouped_courses = Course::
506 524
             //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
507 525
             select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
@@ -1025,6 +1043,39 @@ class SchoolsController extends \BaseController
1025 1043
         $outcomes = Outcome::orderBy('name', 'asc')->get();
1026 1044
         $outcomeCount = Outcome::all()->count();
1027 1045
 
1046
+        $semesters = Semester::whereIn('id', Session::get('semesters_ids'))->get();
1047
+
1048
+
1049
+        $outcomes_grad = Outcome::active_by_semesters($semesters, 1);
1050
+        $outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
1051
+
1052
+        $undergrad_stu_outcome_attempted = [];
1053
+        $grad_stu_outcome_attempted = [];
1054
+        $undergrad_stu_outcome_achieved = [];
1055
+        $grad_stu_outcome_achieved = [];
1056
+
1057
+        $attemptedUndergradProgramsPerOutcome = [];
1058
+        $achievedUndergradProgramsPerOutcome = [];
1059
+        $attemptedGradProgramsPerOutcome = [];
1060
+        $achievedGradProgramsPerOutcome = [];
1061
+
1062
+        foreach ($outcomes_undergrad as $outcome) {
1063
+            $undergrad_stu_outcome_attempted[$outcome->id] = 0;
1064
+            $undergrad_stu_outcome_achieved[$outcome->id] = 0;
1065
+            $attemptedUndergradProgramsPerOutcome[$outcome->id] = [];
1066
+            $achievedUndergradProgramsPerOutcome[$outcome->id] = [];
1067
+        }
1068
+
1069
+        foreach ($outcomes_grad as $outcome) {
1070
+            $grad_stu_outcome_attempted[$outcome->id] = 0;
1071
+            $grad_stu_outcome_achieved[$outcome->id] = 0;
1072
+            $attemptedGradProgramsPerOutcome[$outcome->id] = [];
1073
+            $achievedGradProgramsPerOutcome[$outcome->id] = [];
1074
+        }
1075
+
1076
+
1077
+
1078
+
1028 1079
 
1029 1080
 
1030 1081
 
@@ -1034,6 +1085,425 @@ class SchoolsController extends \BaseController
1034 1085
 
1035 1086
         $program_ids = $school->programs->lists('id');
1036 1087
 
1088
+
1089
+        $undergrad_programs = DB::table('programs')
1090
+            ->select('id', 'name', 'school_id', 'is_graduate')
1091
+            ->where('is_graduate', '=', 0)
1092
+            ->where('school_id', '=', $id)
1093
+            ->orderBy('name', 'ASC')
1094
+            ->get();
1095
+
1096
+
1097
+
1098
+        $grad_programs = DB::table('programs')
1099
+            ->select('id', 'name', 'school_id', 'is_graduate')
1100
+            ->where('is_graduate', '=', 1)
1101
+            ->where('school_id', '=', $id)
1102
+            ->orderBy('name', 'ASC')
1103
+            ->get();
1104
+
1105
+
1106
+        //quiero ver si monto el query tm aqui
1107
+
1108
+        $undergrad_programs_list = DB::table('programs')
1109
+            ->select('id', 'name', 'school_id', 'is_graduate')
1110
+            ->where('is_graduate', '=', 0)
1111
+            ->where('school_id', '=', $id)
1112
+            ->orderBy('name', 'ASC')
1113
+            ->lists('id');
1114
+
1115
+        $grad_programs_list = DB::table('programs')
1116
+            ->select('id', 'name', 'school_id', 'is_graduate')
1117
+            ->where('is_graduate', '=', 1)
1118
+            ->where('school_id', '=', $id)
1119
+            ->orderBy('name', 'ASC')
1120
+            ->lists('id');
1121
+
1122
+        /*
1123
+
1124
+        $undergraduate_student_query = DB::table("courses")
1125
+            ->join('activities', 'activities.course_id', '=', 'courses.id')
1126
+            ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
1127
+            ->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
1128
+            ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
1129
+            ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
1130
+            ->join('criterion_objective_outcome as cobo', 'cobo.criterion_id', '=', 'activity_criterion.criterion_id')
1131
+            ->join('program_criterion_objective_outcome as poco', function ($q) {
1132
+                $q->on('courses.program_id', '=', 'poco.program_id')
1133
+                    ->on('cobo.id', '=', 'poco.cri_obj_out_id');
1134
+            })
1135
+            ->join('students', 'students.id', '=', 'assessments.student_id')
1136
+            ->whereIn('poco.program_id',  $undergrad_programs_list)
1137
+            ->whereIn("courses.semester_id", Session::get('semesters_ids'))
1138
+            ->whereIn('courses.program_id',  $undergrad_programs_list)
1139
+            ->select('students.number as student_id')
1140
+            ->addSelect(DB::raw('count(assessments.activity_criterion_id) as criteria_attempted'))
1141
+            ->addSelect(DB::raw('count(case when assessments.score>=rubrics.expected_points then 1 else NULL end) as criteria_achieved'))
1142
+            ->addSelect('outcome_id')
1143
+            ->groupBy(array('students.id', 'outcome_id'))
1144
+            ->get();
1145
+
1146
+
1147
+        //Log::info($undergraduate_student_query);
1148
+
1149
+        $grad_student_query = DB::table("courses")
1150
+            ->join('activities', 'activities.course_id', '=', 'courses.id')
1151
+            ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
1152
+            ->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
1153
+            ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
1154
+            ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
1155
+            ->join('criterion_objective_outcome as cobo', 'cobo.criterion_id', '=', 'activity_criterion.criterion_id')
1156
+            ->join('program_criterion_objective_outcome as poco', function ($q) {
1157
+                $q->on('courses.program_id', '=', 'poco.program_id')
1158
+                    ->on('cobo.id', '=', 'poco.cri_obj_out_id');
1159
+            })
1160
+            ->join('students', 'students.id', '=', 'assessments.student_id')
1161
+            ->whereIn('poco.program_id',  $grad_programs_list)
1162
+            ->whereIn("courses.semester_id", Session::get('semesters_ids'))
1163
+            ->whereIn('courses.program_id',  $grad_programs_list)
1164
+            ->select('students.number as student_id')
1165
+            ->addSelect(DB::raw('count(assessments.activity_criterion_id) as criteria_attempted'))
1166
+            ->addSelect(DB::raw('count(case when assessments.score>=rubrics.expected_points then 1 else NULL end) as criteria_achieved'))
1167
+            ->addSelect('outcome_id')
1168
+            ->groupBy(array('students.id', 'outcome_id'))
1169
+            ->get();
1170
+
1171
+            */
1172
+
1173
+        //school
1174
+
1175
+
1176
+
1177
+        /*
1178
+            student x, crit achieved, crit attempted, outcome 1
1179
+            student x, crit achieved, crit attempted, outcome 2
1180
+            student x, crit achieved, crit attempted, outcome 3
1181
+            student x, crit achieved, crit attempted, outcome 4
1182
+            student y, crit achieved, crit attempted, outcome 1
1183
+            student y, crit achieved, crit attempted, outcome 2
1184
+            student y, crit achieved, crit attempted, outcome 3
1185
+            ....
1186
+            
1187
+
1188
+            */
1189
+        $grad_outcomes_attempted = [];
1190
+        $grad_outcomes_achieved = [];
1191
+        $undergrad_outcomes_attempted = [];
1192
+        $undergrad_outcomes_achieved = [];
1193
+
1194
+
1195
+        $school_info = $school->school_students_per_outcome;
1196
+        $grad_outcomes_attempted = $school_info['graduate_info']['outcomes_attempted_combined'];
1197
+        $grad_outcomes_achieved = $school_info['graduate_info']['outcomes_achieved_combined'];
1198
+
1199
+        $undergrad_outcomes_attempted = $school_info['undergraduate_info']['outcomes_attempted_combined'];
1200
+        $undergrad_outcomes_achieved = $school_info['undergraduate_info']['outcomes_achieved_combined'];
1201
+
1202
+
1203
+
1204
+
1205
+
1206
+        /*
1207
+
1208
+
1209
+        $grad_outcomes_attempted = [];
1210
+        $grad_outcomes_achieved = [];
1211
+        $undergrad_outcomes_attempted = [];
1212
+        $undergrad_outcomes_achieved = [];
1213
+
1214
+        foreach ($outcomes_grad as $outcome) {
1215
+            $grad_outcomes_attempted[$outcome->id] = 0;
1216
+            $grad_outcomes_achieved[$outcome->id] = 0;
1217
+        }
1218
+
1219
+        foreach ($outcomes_undergrad as $outcome) {
1220
+            $undergrad_outcomes_attempted[$outcome->id] = 0;
1221
+            $undergrad_outcomes_achieved[$outcome->id] = 0;
1222
+        }
1223
+
1224
+        foreach ($grad_student_query as $result) {
1225
+            if ($result->criteria_attempted != 0) {
1226
+                if (!isset($grad_outcomes_attempted[$result->outcome_id]))
1227
+                    continue;
1228
+
1229
+                $grad_outcomes_attempted[$result->outcome_id]++;
1230
+
1231
+                $percent = $result->criteria_achieved / $result->criteria_attempted * 100;
1232
+
1233
+                if ($percent >= 66.66) {
1234
+
1235
+
1236
+                    $grad_outcomes_achieved[$result->outcome_id]++;
1237
+                }
1238
+            }
1239
+        }
1240
+
1241
+
1242
+
1243
+
1244
+        foreach ($undergraduate_student_query as $result) {
1245
+            if ($result->criteria_attempted != 0) {
1246
+                if (!isset($undergrad_outcomes_attempted[$result->outcome_id]))
1247
+                    continue;
1248
+
1249
+                $undergrad_outcomes_attempted[$result->outcome_id]++;
1250
+
1251
+                $percent = $result->criteria_achieved / $result->criteria_attempted * 100;
1252
+
1253
+                if ($percent >= 66.66) {
1254
+
1255
+
1256
+                    $undergrad_outcomes_achieved[$result->outcome_id]++;
1257
+                }
1258
+            }
1259
+        }*/
1260
+
1261
+        $grad_grouped_courses = Course::
1262
+            //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
1263
+            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
1264
+            ->with('semester')
1265
+            ->with('program')
1266
+            ->whereIn('courses.program_id', $program_ids)
1267
+            ->whereIn('courses.semester_id', Session::get('semesters_ids'))
1268
+            ->leftJoin('programs', 'courses.program_id', '=', 'programs.id')
1269
+            ->where('programs.is_graduate', '=', 1)
1270
+            ->groupBy(array('courses.code', 'courses.number', 'courses.semester_id'))
1271
+            ->orderBy('courses.code')
1272
+            ->orderBy('courses.number')
1273
+            ->orderBy('courses.semester_id')
1274
+            ->get();
1275
+
1276
+        $undergrad_grouped_courses = Course::
1277
+            //             select(DB::raw('courses.name, courses.code, courses.number, max(courses.outcomes_attempted) as outcomes_attempted, courses.semester_id, courses.program_id'))
1278
+            select(DB::raw('courses.name, courses.code, courses.number, courses.semester_id, courses.program_id'))
1279
+            ->with('semester')
1280
+            ->with('program')
1281
+            ->whereIn('courses.program_id', $program_ids)
1282
+            ->whereIn('courses.semester_id', Session::get('semesters_ids'))
1283
+            ->leftJoin('programs', 'courses.program_id', '=', 'programs.id')
1284
+            ->where('programs.is_graduate', '=', 0)
1285
+            ->groupBy(array('courses.code', 'courses.number', 'courses.semester_id'))
1286
+            ->orderBy('courses.code')
1287
+            ->orderBy('courses.number')
1288
+            ->orderBy('courses.semester_id')
1289
+            ->get();
1290
+
1291
+        foreach ($undergrad_grouped_courses as $key => $courses) {
1292
+            $undergrad_grouped_courses[$key]->outcomes_attempted = NULL;
1293
+            $coursesT = Course::where('courses.code', $courses->code)->where('courses.number', $courses->number)->where('courses.semester_id', $courses->semester_id)->get();
1294
+            foreach ($coursesT as $course) {
1295
+                if ($course->isAssessed()) {
1296
+                    $undergrad_grouped_courses[$key]->outcomes_attempted = true;
1297
+                }
1298
+            }
1299
+        }
1300
+
1301
+        foreach ($grad_grouped_courses as $key => $courses) {
1302
+            $grad_grouped_courses[$key]->outcomes_attempted = NULL;
1303
+            $coursesT = Course::where('courses.code', $courses->code)->where('courses.number', $courses->number)->where('courses.semester_id', $courses->semester_id)->get();
1304
+            foreach ($coursesT as $course) {
1305
+                if ($course->isAssessed()) {
1306
+                    $grad_grouped_courses[$key]->outcomes_attempted = true;
1307
+                }
1308
+            }
1309
+        }
1310
+
1311
+        // Fetch programs with participation
1312
+        $participating_programs = $this->participatingPrograms($school);
1313
+
1314
+        /**
1315
+         * Calculate how many sections are doing assessment
1316
+         */
1317
+
1318
+        $undergrad_assessed_sections_count = 0;
1319
+        $undergrad_school_sections_count = 0;
1320
+
1321
+        $grad_assessed_sections_count = 0;
1322
+        $grad_school_sections_count = 0;
1323
+
1324
+        foreach ($school->programs as $program) {
1325
+            foreach ($program->courses as $course) {
1326
+
1327
+                if (!$course->program->is_graduate) {
1328
+                    $undergrad_school_sections_count += 1;
1329
+                    if ($course->isAssessed()) $undergrad_assessed_sections_count += 1;
1330
+                } else {
1331
+                    $grad_school_sections_count += 1;
1332
+                    if ($course->isAssessed()) $grad_assessed_sections_count += 1;
1333
+                }
1334
+            }
1335
+        }
1336
+
1337
+
1338
+        //como resuelvo programsAttempted y eso
1339
+
1340
+
1341
+        //El query es el mismo de students, lo unico que dividido con programas,
1342
+        //asi que lo que esta haciendo es, prog 1, y coge los dominios y estudiantes que evaluason
1343
+
1344
+
1345
+        $undergrad_prog_attempted =  DB::table("courses")
1346
+            ->join('activities', 'activities.course_id', '=', 'courses.id')
1347
+            ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
1348
+            ->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
1349
+            ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
1350
+            ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
1351
+            ->join('criterion_objective_outcome as cobo', 'cobo.criterion_id', '=', 'activity_criterion.criterion_id')
1352
+            ->join('program_criterion_objective_outcome as poco', function ($q) {
1353
+                $q->on('courses.program_id', '=', 'poco.program_id')
1354
+                    ->on('cobo.id', '=', 'poco.cri_obj_out_id');
1355
+            })
1356
+            ->join('students', 'students.id', '=', 'assessments.student_id')
1357
+            ->whereIn("courses.semester_id", Session::get('semesters_ids'))
1358
+            ->whereIn('poco.program_id',  $undergrad_programs_list)
1359
+
1360
+            ->whereIn('courses.program_id',  $undergrad_programs_list)
1361
+            ->select('students.number as student_id')
1362
+            ->addSelect(DB::raw('count(assessments.activity_criterion_id) as criteria_attempted'))
1363
+            ->addSelect(DB::raw('count(case when assessments.score>=rubrics.expected_points then 1 else NULL end) as criteria_achieved'))
1364
+            ->addSelect('outcome_id')
1365
+            ->addSelect("courses.program_id")
1366
+            ->groupBy(array('students.id', 'outcome_id', 'program_id'))
1367
+            ->get();
1368
+
1369
+        $grad_prog_attempted =  DB::table("courses")
1370
+            ->join('activities', 'activities.course_id', '=', 'courses.id')
1371
+            ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
1372
+            ->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
1373
+            ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
1374
+            ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
1375
+            ->join('criterion_objective_outcome as cobo', 'cobo.criterion_id', '=', 'activity_criterion.criterion_id')
1376
+            ->join('program_criterion_objective_outcome as poco', function ($q) {
1377
+                $q->on('courses.program_id', '=', 'poco.program_id')
1378
+                    ->on('cobo.id', '=', 'poco.cri_obj_out_id');
1379
+            })
1380
+            ->join('students', 'students.id', '=', 'assessments.student_id')
1381
+            ->whereIn("courses.semester_id", Session::get('semesters_ids'))
1382
+            ->whereIn('poco.program_id',  $grad_programs_list)
1383
+
1384
+            ->whereIn('courses.program_id',  $grad_programs_list)
1385
+            ->select('students.number as student_id')
1386
+            ->addSelect(DB::raw('count(assessments.activity_criterion_id) as criteria_attempted'))
1387
+            ->addSelect(DB::raw('count(case when assessments.score>=rubrics.expected_points then 1 else NULL end) as criteria_achieved'))
1388
+            ->addSelect('outcome_id')
1389
+            ->addSelect("courses.program_id")
1390
+            ->groupBy(array('students.id', 'outcome_id', 'program_id'))
1391
+            ->get();
1392
+
1393
+        //este arreglo va a tener attempted[outcome->id][program->id]
1394
+
1395
+        //so la cardinalidad de attempted[outcome->id] dice cuantos programas intentaron, achieved[outcome->id], va 
1396
+        //a decir cuantos pasaron y attempted[outcome->id][program->id] la suma de estudiantes que intentaron
1397
+        // 
1398
+
1399
+
1400
+        foreach ($undergrad_prog_attempted as $row) {
1401
+            $program_id = $row->program_id;
1402
+            $outcome_id = $row->outcome_id;
1403
+            if (!isset($attemptedUndergradProgramsPerOutcome[$outcome_id][$program_id]))
1404
+                $attemptedUndergradProgramsPerOutcome[$outcome_id][$program_id] = 0;
1405
+
1406
+
1407
+            $attemptedUndergradProgramsPerOutcome[$outcome_id][$program_id]++;
1408
+
1409
+            $criteria_attempted_by_stu = $row->criteria_attempted;
1410
+            $criteria_achieved_by_stu = $row->criteria_achieved;
1411
+            if ($criteria_attempted_by_stu != 0 && $criteria_achieved_by_stu / $criteria_attempted_by_stu * 100 >= 66.67) {
1412
+
1413
+                if (!isset($achievedUndergradProgramsPerOutcome[$outcome_id][$program_id]))
1414
+                    $achievedUndergradProgramsPerOutcome[$outcome_id][$program_id] = 0;
1415
+                $achievedUndergradProgramsPerOutcome[$outcome_id][$program_id]++;
1416
+            }
1417
+        }
1418
+
1419
+        foreach ($grad_prog_attempted as $row) {
1420
+            $program_id = $row->program_id;
1421
+            $outcome_id = $row->outcome_id;
1422
+            if (!isset($attemptedGradProgramsPerOutcome[$outcome_id][$program_id]))
1423
+                $attemptedGradProgramsPerOutcome[$outcome_id][$program_id] = 0;
1424
+
1425
+
1426
+            $attemptedGradProgramsPerOutcome[$outcome_id][$program_id]++;
1427
+
1428
+            $criteria_attempted_by_stu = $row->criteria_attempted;
1429
+            $criteria_achieved_by_stu = $row->criteria_achieved;
1430
+            if ($criteria_attempted_by_stu != 0 && $criteria_achieved_by_stu / $criteria_attempted_by_stu * 100 >= 66.67) {
1431
+                if (!isset($achievedGradProgramsPerOutcome[$outcome_id][$program_id]))
1432
+                    $achievedGradProgramsPerOutcome[$outcome_id][$program_id] = 0;
1433
+                $achievedGradProgramsPerOutcome[$outcome_id][$program_id]++;
1434
+            }
1435
+        }
1436
+        //La linea negra de proposed.
1437
+
1438
+        //
1439
+        $linea_undergrad = DB::table('target_outcomes_program')
1440
+            ->join('programs', 'programs.id', '=', 'target_outcomes_program.program_id')
1441
+            ->join('semesters', 'semesters.id', '=', 'target_outcomes_program.semester_id')
1442
+            ->whereIn('program_id', $undergrad_programs_list)
1443
+            ->whereIn("semester_id", Session::get('semesters_ids'))
1444
+            ->select("target_outcomes_program.*", 'programs.name as program_name', 'semesters.name as semester_name')
1445
+            ->addSelect(DB::raw("count(target_outcomes_program.semester_id) as count_semester_id"))
1446
+            ->groupBy("expected_target")
1447
+            ->orderBy("expected_target", "DESC")
1448
+            ->first();
1449
+        if (!isset($linea_undergrad)) {
1450
+            $default_undergrad = 70;
1451
+        } elseif ($linea_undergrad->count_semester_id > 1) {
1452
+
1453
+            $default_undergrad = null;
1454
+
1455
+            $linea_undergrad = DB::table('target_outcomes_program')
1456
+                ->join('programs', 'programs.id', '=', 'target_outcomes_program.program_id')
1457
+                ->join('semesters', 'semesters.id', '=', 'target_outcomes_program.semester_id')
1458
+                ->whereIn('program_id', $undergrad_programs_list)
1459
+                ->where('expected_target', $linea_undergrad->expected_target)
1460
+                ->whereIn("semester_id", Session::get('semesters_ids'))
1461
+                ->select("target_outcomes_program.*", 'programs.name as program_name', 'semesters.name as semester_name')
1462
+                //->addSelect("count(semester_id) as count_semester_id")
1463
+                //->groupBy("expected_target")
1464
+                ->orderBy("semester_id", "DESC")
1465
+                ->first();
1466
+        }
1467
+
1468
+        $linea_grad = DB::table('target_outcomes_program')
1469
+            ->join('programs', 'programs.id', '=', 'target_outcomes_program.program_id')
1470
+            ->join('semesters', 'semesters.id', '=', 'target_outcomes_program.semester_id')
1471
+            ->whereIn('program_id', $grad_programs_list)
1472
+            ->whereIn("semester_id", Session::get('semesters_ids'))
1473
+            ->select("target_outcomes_program.*", 'programs.name as program_name', 'semesters.name as semester_name')
1474
+            ->addSelect(DB::raw("count(target_outcomes_program.semester_id) as count_semester_id"))
1475
+            ->groupBy("expected_target")
1476
+            ->orderBy("expected_target", "DESC")
1477
+            ->first();
1478
+        if (!isset($linea_grad)) {
1479
+            $default_grad = 70;
1480
+        } elseif ($linea_grad->count_semester_id > 1) {
1481
+
1482
+            $default_grad = null;
1483
+
1484
+            $linea_grad = DB::table('target_outcomes_program')
1485
+                ->join('programs', 'programs.id', '=', 'target_outcomes_program.program_id')
1486
+                ->join('semesters', 'semesters.id', '=', 'target_outcomes_program.semester_id')
1487
+                ->whereIn('program_id', $grad_programs_list)
1488
+                ->where('expected_target', $linea_grad->expected_target)
1489
+                ->whereIn("semester_id", Session::get('semesters_ids'))
1490
+                ->select("target_outcomes_program.*", 'programs.name as program_name', 'semesters.name as semester_name')
1491
+                ->orderBy("semester_id", "DESC")
1492
+                ->first();
1493
+        }
1494
+
1495
+
1496
+
1497
+
1498
+        if ($school->id == 13) {
1499
+            //             return View::make('local.managers.shared.school-uhs', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
1500
+            return View::make('local.managers.shared.print_school', compact('title', 'default_undergrad', 'default_grad', 'linea_undergrad', 'linea_grad', 'outcomes_grad', 'outcomes_undergrad', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs'));
1501
+        } else {
1502
+            //             return View::make('local.managers.shared.school', compact('title', 'outcomes', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs', 'participating_undergrad_programs', 'participating_grad_programs'));
1503
+            return View::make('local.managers.shared.print_school', compact('title',  'default_undergrad', 'default_grad', 'linea_undergrad', 'linea_grad', 'outcomes_grad', 'outcomes_undergrad', 'undergrad_programs', 'grad_programs', 'undergrad_outcomes_attempted', 'grad_outcomes_attempted', 'undergrad_outcomes_achieved', 'grad_outcomes_achieved', 'schools', 'school', 'undergrad_assessed_sections_count', 'grad_assessed_sections_count', 'undergrad_school_sections_count', 'grad_school_sections_count', 'achievedUndergradProgramsPerOutcome', 'achievedGradProgramsPerOutcome', 'attemptedUndergradProgramsPerOutcome', 'attemptedGradProgramsPerOutcome', 'grad_grouped_courses', 'undergrad_grouped_courses', 'participating_programs'));
1504
+        }
1505
+
1506
+
1037 1507
         $grouped_courses = Course::
1038 1508
             //             select(DB::raw('name, code, number, max(outcomes_attempted) as outcomes_attempted, semester_id, program_id'))
1039 1509
             select(DB::raw('name, code, number, semester_id, program_id'))

+ 4
- 4
app/filters.php Parādīt failu

@@ -77,7 +77,7 @@ Route::filter('guest', function () {
77 77
 				break;
78 78
 
79 79
 			case 2:
80
-				return Redirect::to('school-coordinator');
80
+				return Redirect::to('school/' . Auth::user()->school->id);
81 81
 				break;
82 82
 
83 83
 			case 3:
@@ -105,7 +105,7 @@ Route::filter('admin', function () {
105 105
 	if (Auth::user()->role != 1) {
106 106
 		switch (Auth::user()->role) {
107 107
 			case 2:
108
-				return Redirect::to('school-coordinator');
108
+				return Redirect::to('school/' . Auth::user()->school->id);
109 109
 				break;
110 110
 
111 111
 			case 3:
@@ -181,7 +181,7 @@ Route::filter('prof', function () {
181 181
 				break;
182 182
 
183 183
 			case 2:
184
-				return Redirect::to('school-coordinator');
184
+				return Redirect::to('school/' . Auth::user()->school->id);
185 185
 				break;
186 186
 
187 187
 			case 3:
@@ -207,4 +207,4 @@ Route::filter('csrf', function () {
207 207
 	if (Session::token() !== $token) {
208 208
 		throw new Illuminate\Session\TokenMismatchException;
209 209
 	}
210
-});
210
+});

+ 46
- 12
app/models/Course.php Parādīt failu

@@ -479,6 +479,8 @@ class Course extends Eloquent
479 479
   {
480 480
     return $this->getStudentReportForOutcome($this);
481 481
   }
482
+
483
+
482 484
   //user id is for groupped professor sections. so el query es  code, number, semester y user_id
483 485
   public static function getStudentReportForOutcome($course_code = null, $user_id = null)
484 486
   {
@@ -535,6 +537,29 @@ class Course extends Eloquent
535 537
 
536 538
       // Log::info(array($course_code));
537 539
 
540
+
541
+      //ESTA ES LA TABLA QUERY PPOR STUDENT
542
+
543
+      $table_per_student =  DB::table('assessments')
544
+        ->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
545
+        ->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
546
+        ->join('courses', 'courses.id', '=', 'activities.course_id')
547
+        ->join('students', 'students.id', '=', 'assessments.student_id')
548
+        ->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
549
+        ->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
550
+        ->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
551
+        ->join('semesters', 'semesters.id', '=', 'courses.semester_id')
552
+        ->whereIn('students.program_id', $program_ids)
553
+        ->where('semester_id', $course_code->semester_id)
554
+        ->where('semesters.is_visible', '=', 1)
555
+        ->where('activities.draft', 0)
556
+        ->where('activities.diagnostic', 0)
557
+
558
+        ->select('student_id', 'students.program_id', 'semesters.code', 'outcome_id', 'criterion_objective_outcome.criterion_id', 'score', 'expected_points')
559
+        ->distinct()
560
+        ->get();
561
+
562
+
538 563
       //Table
539 564
       /* Student  criterion_attempted criterion passed
540 565
       *     1             2                   1
@@ -563,7 +588,9 @@ class Course extends Eloquent
563 588
         ->where('activities.diagnostic', 0);
564 589
 
565 590
 
566
-      // si typ_semester_course esta prendido, then significa que es de los estudiantes del programa
591
+      // si typ_semester_course esta prendido
592
+      // o, si with_program_report está prendido
593
+      //, then significa que es de los estudiantes del programa
567 594
       //
568 595
 
569 596
       if (isset($course_code->typ_semester_course_id)) {
@@ -571,17 +598,17 @@ class Course extends Eloquent
571 598
           ->whereIn('program_student_semester.program_id', $program_ids)
572 599
           ->where('program_student_semester.semester_id', $course_code->semester_id);
573 600
       }
601
+      if (isset($course_code->with_program_report)) {
602
+        $table_per_student = $table_per_student->join('program_student_semester', 'program_student_semester.student_id', '=', 'course_student.student_id')
603
+          ->whereIn('program_student_semester.program_id', $program_ids)
604
+          ->where('program_student_semester.semester_id', $course_code->semester_id);
605
+      }
574 606
       //si entra aqui, no especifica dominio, y hay que join todos los dominios
575
-      else {
576
-        $table_per_student = $table_per_student->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id');
577
-        //->join('program_criterion_objective_outcome', 'program_criterion_objective_outcome.cri_obj_out_id', '=', 'criterion_objective_outcome.id')
578
-        //->whereIn('program_criterion_objective_outcome.program_id', $program_ids);
579
-
580
-        /*
581
-        Entonces que tendrías aqui?, estudiantes por dominio?
607
+      if (!isset($course_code->typ_semester_course_id)) {
582 608
 
583
-        */
609
+        $table_per_student = $table_per_student->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id');
584 610
       }
611
+
585 612
       //si estan grouped
586 613
       if (isset($course_code->grouped)) {
587 614
         $table_per_student = $table_per_student->where('courses.semester_id', $course_code->semester_id)
@@ -615,14 +642,21 @@ class Course extends Eloquent
615 642
         $table_per_student = $table_per_student->addSelect('outcome_id')
616 643
           ->groupBy(array('students.id', 'outcome_id'));
617 644
 
618
-        // Log::info($table_per_student->toSql());
619
-        //Log::info($criteria_id);
620
-        //Log::info("Amiga ponle a br");
645
+        Log::info($table_per_student->toSql());
646
+        Log::info($criteria_id);
647
+        Log::info($course_code->id);
648
+        Log::info($program_ids);
649
+        Log::info($course_code->semester_id);
650
+        Log::info("Amiga ponle a br");
621 651
 
622 652
         $query = $table_per_student->get();
623 653
 
624 654
 
625 655
 
656
+
657
+
658
+
659
+
626 660
         //Aqui queremos crear un arreglo que sea
627 661
         /*
628 662
           students = {

+ 185
- 0
app/models/Program.php Parādīt failu

@@ -37,6 +37,152 @@ class Program extends Eloquent
37 37
 		return $this->hasMany('Student');
38 38
 	}
39 39
 
40
+	public function getProgramStudentsPerOutcomeAttribute()
41
+	{ {
42
+
43
+			$semesters = Semester::whereIn('id', Session::get('semesters_ids'))->get();
44
+
45
+			//if ($this->is_graduate == 1) {
46
+			//	$outcomes = Outcome::active_by_semesters($semesters, 1);
47
+			//} else {
48
+			//	$outcomes = Outcome::active_by_semesters($semesters, 0);
49
+			//}
50
+
51
+			$outcomes = Outcome::orderBy('name', 'asc')->get();
52
+
53
+			$outcome_ids = DB::table("outcomes")
54
+				->whereNotNull('new_outcome_id')
55
+				->get();
56
+
57
+			$combined_outcomes = [];
58
+			foreach ($outcome_ids as $outcome) {
59
+				$combined_outcomes[$outcome->id] = $outcome->new_outcome_id;
60
+			}
61
+
62
+			$array_to_send = [];
63
+
64
+
65
+
66
+			$students =
67
+				DB::table('assessments')
68
+				->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
69
+				->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
70
+				->join('courses', 'courses.id', '=', 'activities.course_id')
71
+				->join('students', 'students.id', '=', 'assessments.student_id')
72
+				->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
73
+				->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
74
+				->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
75
+				->join('semesters', 'semesters.id', '=', 'courses.semester_id')
76
+				->where('students.program_id', $this->id)
77
+				->whereIn('semester_id', Session::get('semesters_ids'))
78
+				->where('semesters.is_visible', '=', 1)
79
+				->select('student_id', 'students.program_id', 'semesters.code', 'outcome_id', 'criterion_objective_outcome.criterion_id', 'score', 'expected_points')
80
+				->addSelect(DB::raw("count(activity_criterion.criterion_id) as criteria_attempted"))
81
+				->addSelect(DB::raw("count(CASE WHEN score>= expected_points then 1 else null END) as criteria_achieved"))
82
+
83
+				->groupBy('students.id', 'outcome_id')
84
+				->get();
85
+
86
+
87
+
88
+
89
+			$array_to_send['program_info'] = [];
90
+
91
+			$array_to_send['program_info']['outcomes_attempted'] = [];
92
+			$out_att = [];
93
+			$out_ach = [];
94
+
95
+			foreach ($outcomes as $outcome) {
96
+				$out_att[$outcome->id] = 0;
97
+				$out_ach[$outcome->id] = 0;
98
+			}
99
+
100
+
101
+			//las filas son , estudiante, outcome que intentó, criterios_attempted, criterion_achieved, 
102
+			foreach ($students as $result) {
103
+				$crit_att = $result->criteria_attempted;
104
+				$crit_ach = $result->criteria_achieved;
105
+
106
+
107
+				$out_att[$result->outcome_id] += 1;
108
+
109
+				if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
110
+					$out_ach[$result->outcome_id] += 1;
111
+				}
112
+			}
113
+
114
+
115
+			$array_to_send['program_info']['outcomes_attempted_uncombined'] = $out_att;
116
+			$array_to_send['program_info']['outcomes_achieved_uncombined'] = $out_ach;
117
+
118
+
119
+			$the_processed_table = [];
120
+			foreach ($students as $result) {
121
+				$student_id = $result->student_id;
122
+				$outcome_id = $result->outcome_id;
123
+				if (isset($combined_outcomes[$outcome_id]))
124
+					$outcome_id = $combined_outcomes[$outcome_id];
125
+
126
+
127
+
128
+				if (!isset($the_processed_table[$student_id])) {
129
+					$the_processed_table[$student_id] = [];
130
+				}
131
+
132
+
133
+				//si en esta tabla, el estudiante no está pareado con este dominio, entonces registra
134
+				// los criterios, achieved y attempted
135
+				if (!isset($the_processed_table[$student_id][$outcome_id])) {
136
+					$the_processed_table[$student_id][$outcome_id] = array(
137
+						"criteria_attempted" => $result->criteria_attempted,
138
+						"criteria_achieved" => $result->criteria_achieved
139
+					);
140
+				}
141
+				//si este estudiante está pareado a este dominio, significa que ahora estoy en los
142
+				//deprecated outcomes.
143
+				else {
144
+					$the_processed_table[$student_id][$outcome_id]['criteria_attempted'] += $result->criteria_attempted;
145
+					$the_processed_table[$student_id][$outcome_id]['criteria_achieved'] += $result->criteria_achieved;
146
+				}
147
+			}
148
+			//Log::info("ESTOY LOCO POR TI");
149
+			//Log::info($the_processed_table);
150
+
151
+			$out_att = [];
152
+			$out_ach = [];
153
+
154
+			foreach ($outcomes as $outcome) {
155
+				$out_att[$outcome->id] = 0;
156
+				$out_ach[$outcome->id] = 0;
157
+			}
158
+
159
+			foreach ($the_processed_table as $student_id => $outcome_ids) {
160
+				//Log::info("AQUI");
161
+				//Log::info($outcome_ids);
162
+				foreach ($outcome_ids as $outcome_id => $crit_information) {
163
+					Log::info($crit_information);
164
+					$crit_att = $crit_information['criteria_attempted'];
165
+					$crit_ach = $crit_information['criteria_achieved'];
166
+
167
+
168
+					$out_att[$outcome_id] += 1;
169
+
170
+					if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
171
+						$out_ach[$outcome_id] += 1;
172
+					}
173
+				}
174
+			}
175
+
176
+			$array_to_send['program_info']['outcomes_attempted_combined'] = $out_att;
177
+			$array_to_send['program_info']['outcomes_achieved_combined'] = $out_ach;
178
+
179
+
180
+
181
+
182
+			return $array_to_send;
183
+		}
184
+	}
185
+
40 186
 	public function getCriteriaAttribute()
41 187
 	{
42 188
 
@@ -300,6 +446,45 @@ class Program extends Eloquent
300 446
 		return $conteo;
301 447
 	}
302 448
 
449
+	//get linea outcome
450
+
451
+	public function getExpectedOutcomeTargetAttribute()
452
+	{
453
+
454
+		//
455
+		$linea_undergrad = DB::table('target_outcomes_program')
456
+			->join('programs', 'programs.id', '=', 'target_outcomes_program.program_id')
457
+			->join('semesters', 'semesters.id', '=', 'target_outcomes_program.semester_id')
458
+			->where('program_id', $this->id)
459
+			->whereIn("semester_id", Session::get('semesters_ids'))
460
+			->select("target_outcomes_program.*", 'programs.name as program_name', 'semesters.name as semester_name')
461
+			->addSelect(DB::raw("count(target_outcomes_program.semester_id) as count_semester_id"))
462
+			->groupBy("expected_target")
463
+			->orderBy("expected_target", "DESC")
464
+			->first();
465
+
466
+
467
+		if (!isset($linea_undergrad)) {
468
+			$linea_undergrad = null;
469
+		} elseif ($linea_undergrad->count_semester_id > 1) {
470
+
471
+
472
+
473
+			$linea_undergrad = DB::table('target_outcomes_program')
474
+				->join('programs', 'programs.id', '=', 'target_outcomes_program.program_id')
475
+				->join('semesters', 'semesters.id', '=', 'target_outcomes_program.semester_id')
476
+				->where('program_id', $this->id)
477
+				->where('expected_target', $linea_undergrad->expected_target)
478
+				->whereIn("semester_id", Session::get('semesters_ids'))
479
+				->select("target_outcomes_program.*", 'programs.name as program_name', 'semesters.name as semester_name')
480
+				//->addSelect("count(semester_id) as count_semester_id")
481
+				//->groupBy("expected_target")
482
+				->orderBy("semester_id", "DESC")
483
+				->first();
484
+		}
485
+		return $linea_undergrad;
486
+	}
487
+
303 488
 	public function achieved_outcome($outcome_id, $semesters)
304 489
 	{
305 490
 		$semesters_array = [];

+ 296
- 3
app/models/School.php Parādīt failu

@@ -14,12 +14,305 @@ class School extends Eloquent
14 14
 
15 15
 	public function courses()
16 16
 	{
17
-	    return $this->hasManyThrough('Course', 'Program')->orderBy('name', 'asc');
17
+		return $this->hasManyThrough('Course', 'Program')->orderBy('name', 'asc');
18 18
 	}
19 19
 
20 20
 	public function templates()
21 21
 	{
22
-	    return $this->hasMany('Template')->orderBy('name', 'asc');
22
+		return $this->hasMany('Template')->orderBy('name', 'asc');
23 23
 	}
24 24
 
25
-}
25
+	public function getUndergraduateProgramsAttribute()
26
+	{
27
+
28
+		return $this->hasMany("Program")->where('is_graduate', 0)->orderBy("name", 'asc');
29
+	}
30
+	public function getGraduateProgramsAttribute()
31
+	{
32
+
33
+		return $this->hasMany("Program")->where('is_graduate', 1)->orderBy("name", 'asc');
34
+	}
35
+
36
+	//Esto envia
37
+
38
+	/*
39
+[
40
+	undergraduate_info:[
41
+		outcomes_attempted_uncombined:{
42
+			outcome_1: count(students),
43
+
44
+		}
45
+		outcomes_attempted_combined:{
46
+
47
+		}
48
+		outcomes_achieved_uncombined:{
49
+
50
+		}
51
+		outcomes_achieved_combined:{
52
+			
53
+		}
54
+	],
55
+	graduate_info:[
56
+
57
+	]
58
+]
59
+
60
+*/
61
+
62
+	public function getSchoolStudentsPerOutcomeAttribute()
63
+	{
64
+
65
+		$semesters = Semester::whereIn('id', Session::get('semesters_ids'))->get();
66
+
67
+		$outcomes_grad = Outcome::active_by_semesters($semesters, 1);
68
+		$outcomes_undergrad = Outcome::active_by_semesters($semesters, 0);
69
+
70
+		$outcomes = Outcome::orderBy('name', 'asc')->get();
71
+		$array_to_send = [];
72
+
73
+
74
+
75
+		$undergraduate_students =
76
+			DB::table('assessments')
77
+			->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
78
+			->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
79
+			->join('courses', 'courses.id', '=', 'activities.course_id')
80
+			->join('students', 'students.id', '=', 'assessments.student_id')
81
+			->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
82
+			->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
83
+			->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
84
+			->join('semesters', 'semesters.id', '=', 'courses.semester_id')
85
+			->whereIn('students.program_id', $this->undergraduate_programs->lists('id'))
86
+			->whereIn('semester_id', Session::get('semesters_ids'))
87
+			->where('semesters.is_visible', '=', 1)
88
+			->select('student_id', 'students.program_id', 'semesters.code', 'outcome_id', 'criterion_objective_outcome.criterion_id', 'score', 'expected_points')
89
+			->addSelect(DB::raw("count(activity_criterion.criterion_id) as criteria_attempted"))
90
+			->addSelect(DB::raw("count(CASE WHEN score>= expected_points then 1 else null END) as criteria_achieved"))
91
+
92
+			->groupBy('students.id', 'outcome_id')
93
+			->get();
94
+
95
+		//$array_to_send["undergraduate_students"] = $undergraduate_students;
96
+
97
+		$graduate_students = DB::table('assessments')
98
+			->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
99
+			->join('activities', 'activities.id', '=', 'activity_criterion.activity_id')
100
+			->join('courses', 'courses.id', '=', 'activities.course_id')
101
+			->join('students', 'students.id', '=', 'assessments.student_id')
102
+			->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
103
+			->join('rubric_activity', 'rubric_activity.activity_id', '=', 'activities.id')
104
+			->join('rubrics', 'rubrics.id', '=', 'rubric_activity.rubric_id')
105
+			->join('semesters', 'semesters.id', '=', 'courses.semester_id')
106
+			->whereIn('students.program_id', $this->graduate_programs->lists('id'))
107
+			->whereIn('semester_id', Session::get('semesters_ids'))
108
+			->where('semesters.is_visible', '=', 1)
109
+			->select('student_id', 'students.program_id', 'semesters.code', 'outcome_id', 'criterion_objective_outcome.criterion_id', 'score', 'expected_points')
110
+			->addSelect(DB::raw("count(activity_criterion.criterion_id) as criteria_attempted"))
111
+			->addSelect(DB::raw("count(CASE WHEN score>= expected_points then 1 else null END) as criteria_achieved"))
112
+
113
+			->groupBy('students.id', 'outcome_id')
114
+			->get();
115
+
116
+		//$array_to_send["graduate_students"] = $graduate_students;
117
+
118
+		//Log::info(count($graduate_students));
119
+		//Log::info(count($undergraduate_students));
120
+
121
+		$outcome_ids = DB::table("outcomes")
122
+			->whereNotNull('new_outcome_id')
123
+			->get();
124
+
125
+		$combined_outcomes = [];
126
+		foreach ($outcome_ids as $outcome) {
127
+			$combined_outcomes[$outcome->id] = $outcome->new_outcome_id;
128
+		}
129
+
130
+		//Necesito undergraduateCombined, undergraduateUncombined, 
131
+		//lo mismo pa graduate 
132
+
133
+		$array_to_send['undergraduate_info'] = [];
134
+		$array_to_send['graduate_info'] = [];
135
+
136
+		$array_to_send['undergraduate_info']['outcomes_attempted_uncombined'] = [];
137
+		$array_to_send['undergraduate_info']['outcomes_achieved_uncombined'] = [];
138
+		$array_to_send['graduate_info']['outcomes_attempted_uncombined']  = [];
139
+		$array_to_send['graduate_info']['outcomes_achieved_uncombined'] = [];
140
+
141
+		$under_out_att = [];
142
+		$under_out_ach = [];
143
+
144
+		foreach ($outcomes as $outcome) {
145
+			$under_out_att[$outcome->id] = 0;
146
+			$under_out_ach[$outcome->id] = 0;
147
+		}
148
+
149
+
150
+		//las filas son , estudiante, outcome que intentó, criterios_attempted, criterion_achieved, 
151
+		foreach ($undergraduate_students as $result) {
152
+			$crit_att = $result->criteria_attempted;
153
+			$crit_ach = $result->criteria_achieved;
154
+
155
+
156
+			$under_out_att[$result->outcome_id] += 1;
157
+
158
+			if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
159
+				$under_out_ach[$result->outcome_id] += 1;
160
+			}
161
+		}
162
+
163
+		$grad_out_att = [];
164
+		$grad_out_ach = [];
165
+
166
+		foreach ($outcomes as $outcome) {
167
+			$grad_out_att[$outcome->id] = 0;
168
+			$grad_out_ach[$outcome->id] = 0;
169
+		}
170
+
171
+
172
+		//las filas son , estudiante, outcome que intentó, criterios_attempted, criterion_achieved, 
173
+		foreach ($graduate_students as $result) {
174
+			$crit_att = $result->criteria_attempted;
175
+			$crit_ach = $result->criteria_achieved;
176
+
177
+
178
+			$grad_out_att[$result->outcome_id] += 1;
179
+
180
+			if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
181
+				$grad_out_ach[$result->outcome_id] += 1;
182
+			}
183
+		}
184
+
185
+		$array_to_send['undergraduate_info']['outcomes_attempted_uncombined'] = $under_out_att;
186
+		$array_to_send['undergraduate_info']['outcomes_achieved_uncombined'] = $under_out_ach;
187
+		$array_to_send['graduate_info']['outcomes_attempted_uncombined'] = $grad_out_att;
188
+		$array_to_send['graduate_info']['outcomes_achieved_uncombined'] = $grad_out_ach;
189
+
190
+
191
+
192
+		$array_to_send['undergraduate_info']['outcomes_attempted_combined'] = [];
193
+		$array_to_send['undergraduate_info']['outcomes_achieved_combined'] = [];
194
+		$array_to_send['graduate_info']['outcomes_attempted_combined']  = [];
195
+		$array_to_send['graduate_info']['outcomes_achieved_combined'] = [];
196
+
197
+		$under_out_att = [];
198
+		$under_out_ach = [];
199
+
200
+		foreach ($outcomes as $outcome) {
201
+			$under_out_att[$outcome->id] = 0;
202
+			$under_out_ach[$outcome->id] = 0;
203
+		}
204
+
205
+		//preprocess para combined_students
206
+
207
+		$the_processed_table = [];
208
+		foreach ($undergraduate_students as $result) {
209
+			$student_id = $result->student_id;
210
+			$outcome_id = $result->outcome_id;
211
+			if (isset($combined_outcomes[$outcome_id]))
212
+				$outcome_id = $combined_outcomes[$outcome_id];
213
+
214
+
215
+
216
+			if (!isset($the_processed_table[$student_id])) {
217
+				$the_processed_table[$student_id] = [];
218
+			}
219
+
220
+
221
+			//si en esta tabla, el estudiante no está pareado con este dominio, entonces registra
222
+			// los criterios, achieved y attempted
223
+			if (!isset($the_processed_table[$student_id][$outcome_id])) {
224
+				$the_processed_table[$student_id][$outcome_id] = array(
225
+					"criteria_attempted" => $result->criteria_attempted,
226
+					"criteria_achieved" => $result->criteria_achieved
227
+				);
228
+			}
229
+			//si este estudiante está pareado a este dominio, significa que ahora estoy en los
230
+			//deprecated outcomes.
231
+			else {
232
+				$the_processed_table[$student_id][$outcome_id]['criteria_attempted'] += $result->criteria_attempted;
233
+				$the_processed_table[$student_id][$outcome_id]['criteria_achieved'] += $result->criteria_achieved;
234
+			}
235
+		}
236
+
237
+
238
+		foreach ($the_processed_table as $student_id => $outcome_ids) {
239
+			foreach ($outcome_ids as $outcome_id => $crit_information) {
240
+				$crit_att = $crit_information['criteria_attempted'];
241
+				$crit_ach = $crit_information['criteria_achieved'];
242
+
243
+
244
+				$under_out_att[$outcome_id] += 1;
245
+
246
+				if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
247
+					$under_out_ach[$outcome_id] += 1;
248
+				}
249
+			}
250
+		}
251
+
252
+		$array_to_send['undergraduate_info']['outcomes_attempted_combined'] = $under_out_att;
253
+		$array_to_send['undergraduate_info']['outcomes_achieved_combined'] = $under_out_ach;
254
+
255
+
256
+		$grad_out_att = [];
257
+		$grad_out_ach = [];
258
+
259
+		foreach ($outcomes as $outcome) {
260
+			$grad_out_att[$outcome->id] = 0;
261
+			$grad_out_ach[$outcome->id] = 0;
262
+		}
263
+
264
+		//preprocess para combined_students
265
+
266
+		$the_processed_table = [];
267
+		foreach ($graduate_students as $result) {
268
+			$student_id = $result->student_id;
269
+			$outcome_id = $result->outcome_id;
270
+			if (isset($combined_outcomes[$outcome_id]))
271
+				$outcome_id = $combined_outcomes[$outcome_id];
272
+
273
+
274
+
275
+			if (!isset($the_processed_table[$student_id])) {
276
+				$the_processed_table[$student_id] = [];
277
+			}
278
+
279
+
280
+			//si en esta tabla, el estudiante no está pareado con este dominio, entonces registra
281
+			// los criterios, achieved y attempted
282
+			if (!isset($the_processed_table[$student_id][$outcome_id])) {
283
+				$the_processed_table[$student_id][$outcome_id] = array(
284
+					"criteria_attempted" => $result->criteria_attempted,
285
+					"criteria_achieved" => $result->criteria_achieved
286
+				);
287
+			}
288
+			//si este estudiante está pareado a este dominio, significa que ahora estoy en los
289
+			//deprecated outcomes.
290
+			else {
291
+				$the_processed_table[$student_id][$outcome_id]['criteria_attempted'] += $result->criteria_attempted;
292
+				$the_processed_table[$student_id][$outcome_id]['criteria_achieved'] += $result->criteria_achieved;
293
+			}
294
+		}
295
+
296
+
297
+
298
+
299
+		foreach ($the_processed_table as $student_id => $outcome_ids) {
300
+			foreach ($outcome_ids as $out_id => $crit_information) {
301
+				$crit_att = $crit_information['criteria_attempted'];
302
+				$crit_ach = $crit_information['criteria_achieved'];
303
+
304
+
305
+				$grad_out_att[$out_id] += 1;
306
+
307
+				if ($crit_att != 0 && ($crit_ach / $crit_att) * 100 >= 66.67) {
308
+					$grad_out_ach[$out_id] += 1;
309
+				}
310
+			}
311
+		}
312
+
313
+		$array_to_send['graduate_info']['outcomes_attempted_combined'] = $grad_out_att;
314
+		$array_to_send['graduate_info']['outcomes_achieved_combined'] = $grad_out_ach;
315
+		Log::info($array_to_send);
316
+		return $array_to_send;
317
+	}
318
+}

+ 203
- 12
app/views/local/managers/pCoords/overview.blade.php Parādīt failu

@@ -22,15 +22,31 @@
22 22
 
23 23
                 <br>
24 24
                 <br>
25
-
26
-                <a href="{{ action('ProgramsController@print_program', array($program_item['program']->id)); }}" class="btn btn-primary pull-right" alt="print"><span class="glyphicon glyphicon-print"></span></a>
25
+                <div class="btn-group pull-right">
26
+                     <a href="{{ action('ProgramsController@print_program', array($program_item['program']->id)); }}" class="btn btn-primary" alt="print"><span class="glyphicon glyphicon-print"></span></a>
27
+                <button type='button' class = 'btn btn-primary' id="change-view-btn{{$index}}" onclick="changeView('#allGraph{{$index}}','#programGraph{{$index}}', {{$index}}, 'Show Program Courses')">Show Program Students</button>
28
+                </div>
27 29
                 <br>
28 30
                 <br>
29 31
 
30
-
31
-                <div class="row">
32
+                <div class = 'row'>
33
+                    <div class ='col-md-12'>
34
+                    @if($program_item['linea_de_graph']== null)
35
+                    <p><strong>This Goal Bar is the default score. If you wish to change it, change it on the selected Semesters Annual Plan</strong></p>
36
+                @else
37
+                    <p><strong>This Goal is from {{$program_item['linea_de_graph']->program_name}} on the semester {{$program_item['linea_de_graph']->semester_name}}</strong></p>
38
+        
39
+                @endif
40
+                </div>
41
+                </div>
42
+                <div class="row" id = 'allGraph{{$index}}'>
32 43
                     <div class="col-md-12 graph" id="graph{{ $index }}"></div>
33 44
                 </div>
45
+                <div class ='row graph-stu' id = "programGraph{{$index}}">
46
+                    <div class="col-md-12 graph " id = "graph-stu-program{{$index}}"></div>
47
+              
48
+                    
49
+                </div>
34 50
 
35 51
                 <!-- ===== sub tabs ===== -->
36 52
                 <div>
@@ -235,6 +251,24 @@
235 251
             </div>
236 252
         @endforeach
237 253
     </div>
254
+<script>
255
+
256
+    function changeView(graph_to_hide, graph_to_show, index, message){
257
+
258
+        current_message = $("#change-view-btn"+index).html();
259
+        $("#change-view-btn"+index).html(message);
260
+
261
+        $(graph_to_hide).hide()
262
+        $(graph_to_show).show()
263
+        
264
+
265
+        $("#change-view-btn"+index).attr('onclick','changeView("'+graph_to_show+'", "'+graph_to_hide+'",'+index+',"'+current_message+'")')
266
+    }
267
+
268
+    $(".graph-stu").hide();
269
+
270
+    </script>
271
+
238 272
 
239 273
 
240 274
 @stop
@@ -270,7 +304,7 @@
270 304
                 type: 'bar'
271 305
             },
272 306
             title: {
273
-                text: 'Performance by Learning Outcome Criteria in {{ $program_item['program']->name }} Program'
307
+                text: 'Performance by Learning Outcome Criteria in {{ $program_item['program']->name }} Courses'
274 308
             },
275 309
             legend: {
276 310
                         reversed: true,
@@ -310,12 +344,22 @@
310 344
                 }, 
311 345
                 
312 346
                         plotLines:[{
313
-                    value:66.67,
314
-                    color: '#000',
315
-                    width:3,
316
-                    zIndex:4,
317
-                    label:{
318
-                        text: 'Goal (66.67%)',
347
+                @if($program_item['linea_de_graph'] != null)
348
+                        value:{{$program_item['linea_de_graph']->expected_target}},
349
+                        color: '#000',
350
+                        width:3,
351
+                        zIndex:4,
352
+                        label:{
353
+                      
354
+                        text: 'Goal ({{$program_item['linea_de_graph']->expected_target}}%)',
355
+                        @else
356
+                        value:70.00,
357
+                        color: '#000',
358
+                        width:3,
359
+                        zIndex:4,
360
+                        label:{
361
+                        text: 'Goal (70.00%)',
362
+                        @endif
319 363
                         style: {
320 364
                             color: '#000',
321 365
                             fontSize: '14px',
@@ -387,7 +431,7 @@
387 431
                     y:-1
388 432
                 },
389 433
                 data:[
390
-                    @foreach($outcomes as $index => $outcome)
434
+                    @foreach($outcomes as $index2 => $outcome)
391 435
                         @if(
392 436
                             is_array($program_item['outcomes_attempted'])
393 437
                             && array_key_exists($outcome->id, $program_item['outcomes_attempted'])
@@ -402,6 +446,153 @@
402 446
             }]
403 447
         });
404 448
 
449
+        $('#graph-stu-program{{$index}}').highcharts({
450
+            chart: {
451
+                type: 'bar'
452
+            },
453
+            title: {
454
+                text: 'Performance by {{ $program_item['program']->name }}\'s Students in Learning Outcomes'
455
+            },
456
+            legend: {
457
+                        reversed: true,
458
+                    },
459
+            xAxis: {
460
+                categories: [
461
+                    @foreach($outcomes as $outcome)
462
+                        @if(is_array($program_item['program_outcomes_attempted'])
463
+                        && array_key_exists($outcome->id, $program_item['program_outcomes_attempted'])
464
+                        && array_key_exists($outcome->id, $program_item['program_outcomes_achieved'])
465
+                        && $program_item['program_outcomes_attempted'][$outcome->id]!=0)
466
+
467
+                        "{{{ $outcome->name }}}<br> (N = {{$program_item['program_outcomes_attempted'][$outcome->id]}}, {{$program_item['program_outcomes_achieved'][$outcome->id]}})",
468
+                    @else
469
+                        "{{$outcome->name}}<br> (N = 0, 0)",
470
+
471
+                        @endif
472
+                    
473
+                        @endforeach
474
+                ],
475
+                labels: {
476
+                    style: {
477
+                        fontSize:'11px'
478
+                    },
479
+                    step:1,
480
+                    useHTML:true,
481
+                    formatter: function() {
482
+                        return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
483
+                    },
484
+                }
485
+            },
486
+            yAxis: {
487
+                min: 0,
488
+                max: 100,
489
+                title: {
490
+                text: 'Percentage'
491
+                }, 
492
+                
493
+                        plotLines:[{
494
+                @if($program_item['linea_de_graph'] != null)
495
+                        value:{{$program_item['linea_de_graph']->expected_target}},
496
+                        color: '#000',
497
+                        width:3,
498
+                        zIndex:4,
499
+                        label:{
500
+                      
501
+                        text: 'Goal ({{$program_item['linea_de_graph']->expected_target}}%)',
502
+                        @else
503
+                        value:70.00,
504
+                        color: '#000',
505
+                        width:3,
506
+                        zIndex:4,
507
+                        label:{
508
+                        text: 'Goal (70.00%)',
509
+                        @endif
510
+                        style: {
511
+                            color: '#000',
512
+                            fontSize: '14px',
513
+                        }
514
+            
515
+                    }
516
+                }]
517
+            },
518
+            tooltip: {
519
+                headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
520
+                pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
521
+                    '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
522
+                footerFormat: '</table>',
523
+                shared: true,
524
+                useHTML: true
525
+            },
526
+            plotOptions: {
527
+                bar: {
528
+                    //grouping: false,
529
+                    shadow: false,
530
+                    borderWidth: 0,
531
+                },
532
+                series: {
533
+                pointPadding: 0,
534
+                groupPadding: 0.075
535
+                },
536
+            },
537
+            series: [{{--{
538
+                name: 'Expected Value',
539
+                color: '#555555',
540
+                dataLabels: {
541
+                    enabled: true,
542
+                    fontSize: 8,
543
+                    color: '#fff',
544
+                    align: 'right',
545
+                    format: '{y:.1f}%',
546
+                    style: {
547
+                        //fontWeight: 'bold'
548
+                    },
549
+                    y:-1
550
+                }, 
551
+
552
+            
553
+                data: [
554
+                    @foreach($outcomes as $index => $outcome)
555
+                        @if(
556
+                            is_array($program_item['outcomes_attempted'])
557
+                            && array_key_exists($outcome->id, $program_item['outcomes_attempted'])
558
+                            && $program_item['outcomes_attempted'][$outcome->id]!=0)
559
+                            {{{ $outcome->expected_outcome }}},
560
+                        @else
561
+                            0,
562
+                        @endif
563
+                    @endforeach
564
+                ]
565
+
566
+            },--}}{
567
+                name: 'Obtained Value',
568
+                color: '#e70033',
569
+                dataLabels: {
570
+                    enabled: true,
571
+                    fontSize: 8,
572
+                    color: '#fff',
573
+                    align: 'right',
574
+                    format: '{y:.1f}%',
575
+                    style: {
576
+                        //fontWeight: 'bold'
577
+                    },
578
+                    y:-1
579
+                },
580
+                data:[
581
+                    @foreach($outcomes as $index => $outcome)
582
+                        @if(
583
+                            is_array($program_item['program_outcomes_attempted'])
584
+                            && array_key_exists($outcome->id, $program_item['program_outcomes_attempted'])
585
+                            && array_key_exists($outcome->id, $program_item['program_outcomes_achieved'])
586
+                            && $program_item['program_outcomes_attempted'][$outcome->id]!=0)
587
+                            {{{ ($program_item['program_outcomes_achieved'][$outcome->id]/$program_item['program_outcomes_attempted'][$outcome->id])*100 }}},
588
+                        @else
589
+                            0,
590
+                        @endif
591
+                    @endforeach
592
+                ]
593
+            }]
594
+        });
595
+
405 596
     });
406 597
 @endforeach
407 598
 

+ 1
- 1
app/views/local/managers/sCoords/_new_navigation.blade.php Parādīt failu

@@ -4,7 +4,7 @@
4 4
       {{ HTML::linkAction('ProgramCoordinatorsController@overview', 'Online Learning Assessment System · Program Coordinator', [], ['class' => 'navbar-brand']) }}
5 5
     </div>-->
6 6
         <ul class="nav navbar-nav navbar-right ml-auto">
7
-            <li>{{ HTML::linkAction('SchoolCoordinatorsController@overview', 'Overview') }}</li>
7
+            <li>{{ HTML::linkAction('SchoolsController@show', "Overview", [Auth::user()->school->id]) }}</li>
8 8
 
9 9
             <li class="dropdown">
10 10
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"

+ 26
- 3
app/views/local/managers/shared/grouped_course.blade.php Parādīt failu

@@ -18,6 +18,12 @@
18 18
 <a href="{{ action('CoursesController@print_course', array($grouped_courses[0]->code, $grouped_courses[0]->number, $grouped_courses[0]->semester->code )); }}" class="btn btn-primary pull-right" alt="print"><span class="glyphicon glyphicon-print"></span></a>
19 19
 <br>
20 20
 <br>
21
+@if($grouped_courses[0]->program->expected_outcome_target== null)
22
+<p><strong>This Goal Bar is the default score. If you wish to change it, change it on the selected Semesters Annual Plan</strong></p>
23
+@else
24
+<p><strong>This Goal is from {{$grouped_courses[0]->program->name}} on the semester {{$grouped_courses[0]->program->expected_outcome_target->semester_name}}</strong></p>
25
+
26
+@endif
21 27
 
22 28
 <div class="row">
23 29
     <div class="col-md-12 graph" id="graph"></div>
@@ -140,14 +146,14 @@ $(function () {
140 146
             title: {
141 147
             text: 'Percentage'
142 148
             }, 
143
-            
149
+            @if($grouped_courses[0]->program->expected_outcome_target == null)
144 150
                     plotLines:[{
145
-                value:66.67,
151
+                value:70.00,
146 152
                 color: '#000',
147 153
                 width:3,
148 154
                 zIndex:4,
149 155
                 label:{
150
-                    text: 'Goal (66.67%)',
156
+                    text: 'Goal (70.00%)',
151 157
                     style: {
152 158
                         color: '#000',
153 159
                         fontSize: '14px',
@@ -155,6 +161,23 @@ $(function () {
155 161
         
156 162
                 }
157 163
             }]
164
+            @else
165
+            plotLines:[{
166
+                value:{{$grouped_courses[0]->program->expected_outcome_target->expected_target}},
167
+                color: '#000',
168
+                width:3,
169
+                zIndex:4,
170
+                label:{
171
+                    text: 'Goal ({{$grouped_courses[0]->program->expected_outcome_target->expected_target}}%)',
172
+                    style: {
173
+                        color: '#000',
174
+                        fontSize: '14px',
175
+                    }
176
+        
177
+                }
178
+            }]
179
+
180
+            @endif
158 181
         },
159 182
         tooltip: {
160 183
             headerFormat: '<span style="font-size:10px">{point.key}</span><table>',

+ 29
- 3
app/views/local/managers/shared/limited-course.blade.php Parādīt failu

@@ -17,6 +17,15 @@
17 17
 			<p>{{$course->name}}</p>
18 18
 		</div>
19 19
 	</div>
20
+    <div class = 'row'>
21
+        <div class ='col-md-12'>
22
+        @if($course->program->expected_outcome_target== null)
23
+        <p><strong>This Goal Bar is the default score. If you wish to change it, change it on the selected Semesters Annual Plan</strong></p>
24
+    @else
25
+        <p><strong>This Goal is from {{$course->program->name}} on the semester {{$course->program->expected_outcome_target->semester_name}}</strong></p>
26
+
27
+    @endif
28
+    </div>
20 29
     <div class="row">
21 30
         <div class="col-md-12" id="graph">
22 31
         </div>
@@ -162,14 +171,14 @@ $(function () {
162 171
             title: {
163 172
             text: 'Percentage'
164 173
             }, 
165
-            
174
+            @if($course->program->expected_outcome_target == null)
166 175
                     plotLines:[{
167
-                value:66.67,
176
+                value:70.00,
168 177
                 color: '#000',
169 178
                 width:3,
170 179
                 zIndex:4,
171 180
                 label:{
172
-                    text: 'Goal (66.67%)',
181
+                    text: 'Goal (70.00%)',
173 182
                     style: {
174 183
                         color: '#000',
175 184
                         fontSize: '14px',
@@ -177,6 +186,23 @@ $(function () {
177 186
         
178 187
                 }
179 188
             }]
189
+            @else
190
+            plotLines:[{
191
+                value: {{$course->program->expected_outcome_target->expected_target }},
192
+                color: '#000',
193
+                width:3,
194
+                zIndex:4,
195
+                label:{
196
+                    text: 'Goal ({{$course->program->expected_outcome_target->expected_target}}%)',
197
+                    style: {
198
+                        color: '#000',
199
+                        fontSize: '14px',
200
+                    }
201
+        
202
+                }
203
+            }]
204
+
205
+            @endif
180 206
         },
181 207
         tooltip: {
182 208
             headerFormat: '<span style="font-size:10px">{point.key}</span><table>',

+ 1
- 3
app/views/local/managers/shared/objectives.blade.php Parādīt failu

@@ -726,9 +726,7 @@
726 726
             if($('#agreement_assoc').is(':checked')){
727 727
                 agreement = 1;
728 728
             }
729
-            else{
730
-                alert("LMAOOOO");
731
-            }
729
+          
732 730
            
733 731
 
734 732
 

+ 49
- 7
app/views/local/managers/shared/print_course.blade.php Parādīt failu

@@ -32,6 +32,7 @@
32 32
             <th>Identifier</th>
33 33
             <th>Professor</th>
34 34
             <th>Assessed</th>
35
+            <th>Published</th>
35 36
         </tr>
36 37
     </thead>
37 38
     <tbody>
@@ -40,7 +41,12 @@
40 41
             <td>{{{ $section->code.$section->number.'-'.$section->section.' ('.$section->semester->code.')'}}}</td>
41 42
             <td>{{ $section->user->surnames }}, {{ $section->user->first_name }}</td>
42 43
             <td>
43
-                @if($section->outcomes_attempted!=NULL)
44
+                @if(count($section->assessedActivities))
45
+                    <span class="glyphicon glyphicon-ok"></span>
46
+                @endif
47
+            </td>
48
+            <td>
49
+                @if(count($section->publishedActivities))
44 50
                     <span class="glyphicon glyphicon-ok"></span>
45 51
                 @endif
46 52
             </td>
@@ -63,7 +69,11 @@
63 69
         <tr>
64 70
             <td>{{ $activity->name }} </td>
65 71
             <td>{{ $activity->course->section }}</td>
66
-            <td>{{ $activity->transforming_actions }}</td>
72
+            @if(isset($activity->transforming_action))
73
+            <td><strong>{{ $activity->transforming_action->at_text }}: </strong>{{$activity->transforming_action->description}}</td>
74
+            @else
75
+            <td></td>
76
+            @endif
67 77
         </tr>
68 78
     @endforeach
69 79
 
@@ -105,7 +115,7 @@ $(function () {
105 115
         xAxis: {
106 116
             categories: [
107 117
                 @foreach($outcomes as $outcome)
108
-                    "{{{ $outcome->name }}}",
118
+                    "{{{ $outcome->name }}}<br>(N = {{$outcomes_attempted[$outcome->id]}}, {{$outcomes_achieved[$outcome->id]}})",
109 119
                 @endforeach
110 120
             ],
111 121
             labels: {
@@ -123,8 +133,40 @@ $(function () {
123 133
             min: 0,
124 134
             max: 100,
125 135
             title: {
126
-                text: 'Percentage'
127
-            }
136
+            text: 'Percentage'
137
+            }, 
138
+            @if($grouped_courses[0]->program->expected_outcome_target == null)
139
+                    plotLines:[{
140
+                value:70.00,
141
+                color: '#000',
142
+                width:3,
143
+                zIndex:4,
144
+                label:{
145
+                    text: 'Goal (70.00%)',
146
+                    style: {
147
+                        color: '#000',
148
+                        fontSize: '14px',
149
+                    }
150
+        
151
+                }
152
+            }]
153
+            @else
154
+            plotLines:[{
155
+                value:{{$grouped_courses[0]->program->expected_outcome_target->expected_target}},
156
+                color: '#000',
157
+                width:3,
158
+                zIndex:4,
159
+                label:{
160
+                    text: 'Goal ({{$grouped_courses[0]->program->expected_outcome_target->expected_target}}%)',
161
+                    style: {
162
+                        color: '#000',
163
+                        fontSize: '14px',
164
+                    }
165
+        
166
+                }
167
+            }]
168
+
169
+            @endif
128 170
         },
129 171
         tooltip: {
130 172
             enabled:false,
@@ -141,7 +183,7 @@ $(function () {
141 183
                 animation:false,
142 184
             },
143 185
         },
144
-        series: [{
186
+        series: [/*{
145 187
             name: 'Expected Value',
146 188
             color: '#555555',
147 189
             dataLabels: {
@@ -168,7 +210,7 @@ $(function () {
168 210
                 @endforeach
169 211
             ]
170 212
 
171
-        },{
213
+        },*/{
172 214
             name: 'Obtained Value',
173 215
             color: '#e70033',
174 216
             dataLabels: {

+ 182
- 7
app/views/local/managers/shared/print_program.blade.php Parādīt failu

@@ -15,7 +15,10 @@
15 15
 
16 16
 @section('main')
17 17
 
18
-<div id="graph"></div>
18
+<div class = "col-md-8" id="graph"></div>
19
+<div class = 'col-md-4'></div>
20
+<div class = "col-md-8" id="graph-stu-program"></div>
21
+<div class = 'col-md-4'></div>
19 22
 
20 23
 <h3>Courses</h3>
21 24
 @if($program_courses->count()>0)
@@ -102,7 +105,7 @@ $('#graph').highcharts({
102 105
         type: 'bar'
103 106
     },
104 107
     title: {
105
-        text: 'Performance by Learning Outcome Criteria in {{ $program->name }} Program'
108
+        text: 'Performance by Learning Outcome Criteria in {{ $program->name }} Courses'
106 109
     },
107 110
     legend: {
108 111
         reversed: true,
@@ -110,7 +113,7 @@ $('#graph').highcharts({
110 113
     xAxis: {
111 114
         categories: [
112 115
             @foreach($outcomes as $outcome)
113
-                "{{{ $outcome->name }}}",
116
+                "{{{ $outcome->name }}} <br>(N = {{$outcomes_attempted[$outcome->id]}}, {{$outcomes_achieved[$outcome->id]}})",
114 117
             @endforeach
115 118
         ],
116 119
         labels: {
@@ -124,12 +127,45 @@ $('#graph').highcharts({
124 127
             },
125 128
         }
126 129
     },
130
+   
127 131
     yAxis: {
128 132
         min: 0,
129 133
         max: 100,
130 134
         title: {
131
-            text: 'Percentage'
132
-        }
135
+        text: 'Percentage'
136
+        }, 
137
+        @if($program->expected_outcome_target == null)
138
+                plotLines:[{
139
+            value:70.00,
140
+            color: '#000',
141
+            width:3,
142
+            zIndex:4,
143
+            label:{
144
+                text: 'Goal (70.00%)',
145
+                style: {
146
+                    color: '#000',
147
+                    fontSize: '14px',
148
+                }
149
+    
150
+            }
151
+        }]
152
+        @else
153
+        plotLines:[{
154
+            value:{{$program->expected_outcome_target->expected_target}},
155
+            color: '#000',
156
+            width:3,
157
+            zIndex:4,
158
+            label:{
159
+                text: 'Goal ({{$program->expected_outcome_target->expected_target}}%)',
160
+                style: {
161
+                    color: '#000',
162
+                    fontSize: '14px',
163
+                }
164
+    
165
+            }
166
+        }]
167
+
168
+        @endif
133 169
     },
134 170
     tooltip: {
135 171
         enabled:false
@@ -146,7 +182,7 @@ $('#graph').highcharts({
146 182
                 animation: false
147 183
             },
148 184
         },
149
-    series: [{
185
+    series: [/*{
150 186
         name: 'Expected Value',
151 187
         color: '#555555',
152 188
         dataLabels: {
@@ -173,7 +209,7 @@ $('#graph').highcharts({
173 209
             @endforeach
174 210
         ]
175 211
 
176
-    },{
212
+    },*/{
177 213
         name: 'Obtained Value',
178 214
         color: '#e70033',
179 215
         dataLabels: {
@@ -203,4 +239,143 @@ $('#graph').highcharts({
203 239
     }]
204 240
 });
205 241
 
242
+$('#graph-stu-program').highcharts({
243
+    chart: {
244
+        type: 'bar'
245
+    },
246
+    title: {
247
+        text: 'Performance by {{ $program->name }}\'s Students in Learning Outcomes '
248
+    },
249
+    legend: {
250
+        reversed: true,
251
+    },
252
+    xAxis: {
253
+        categories: [
254
+            @foreach($outcomes as $outcome)
255
+                "{{{ $outcome->name }}} <br>(N = {{$program_outcomes_attempted[$outcome->id]}}, {{$program_outcomes_achieved[$outcome->id]}})",
256
+            @endforeach
257
+        ],
258
+        labels: {
259
+            style: {
260
+                fontSize:'11px'
261
+            },
262
+            step:1,
263
+            useHTML:true,
264
+            formatter: function() {
265
+                return '<div style="width:100px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
266
+            },
267
+        }
268
+    },
269
+   
270
+    yAxis: {
271
+        min: 0,
272
+        max: 100,
273
+        title: {
274
+        text: 'Percentage'
275
+        }, 
276
+        @if($program->expected_outcome_target == null)
277
+                plotLines:[{
278
+            value:70.00,
279
+            color: '#000',
280
+            width:3,
281
+            zIndex:4,
282
+            label:{
283
+                text: 'Goal (70.00%)',
284
+                style: {
285
+                    color: '#000',
286
+                    fontSize: '14px',
287
+                }
288
+    
289
+            }
290
+        }]
291
+        @else
292
+        plotLines:[{
293
+            value:{{$program->expected_outcome_target->expected_target}},
294
+            color: '#000',
295
+            width:3,
296
+            zIndex:4,
297
+            label:{
298
+                text: 'Goal ({{$program->expected_outcome_target->expected_target}}%)',
299
+                style: {
300
+                    color: '#000',
301
+                    fontSize: '14px',
302
+                }
303
+    
304
+            }
305
+        }]
306
+
307
+        @endif
308
+    },
309
+    tooltip: {
310
+        enabled:false
311
+    },
312
+    plotOptions: {
313
+            bar: {
314
+                //grouping: false,
315
+                shadow: false,
316
+                borderWidth: 0,
317
+            },
318
+            series: {
319
+                pointPadding: 0,
320
+                groupPadding: 0.075,
321
+                animation: false
322
+            },
323
+        },
324
+    series: [/*{
325
+        name: 'Expected Value',
326
+        color: '#555555',
327
+        dataLabels: {
328
+            enabled: true,
329
+            fontSize: 8,
330
+            color: '#fff',
331
+            align: 'right',
332
+            format: '{y:.1f}%',
333
+            style: {
334
+                //fontWeight: 'bold'
335
+            },
336
+            y:-1
337
+        },
338
+        data: [
339
+            @foreach($outcomes as $index => $outcome)
340
+                @if(
341
+                    is_array($outcomes_attempted)
342
+                    && array_key_exists($outcome->id, $outcomes_attempted)
343
+                    && $outcomes_attempted[$outcome->id]!=0)
344
+                    {{{ $outcome->expected_outcome }}},
345
+                @else
346
+                    0,
347
+                @endif
348
+            @endforeach
349
+        ]
350
+
351
+    },*/{
352
+        name: 'Obtained Value',
353
+        color: '#e70033',
354
+        dataLabels: {
355
+            enabled: true,
356
+            fontSize: 8,
357
+            color: '#fff',
358
+            align: 'right',
359
+            format: '{y:.1f}%',
360
+            style: {
361
+                //fontWeight: 'bold'
362
+            },
363
+            y:-1
364
+        },
365
+        data:[
366
+            @foreach($outcomes as $index => $outcome)
367
+                @if(
368
+                    is_array($program_outcomes_attempted)
369
+                    && array_key_exists($outcome->id, $program_outcomes_attempted)
370
+                    && $program_outcomes_attempted[$outcome->id]!=0)
371
+                    {{{ ($program_outcomes_achieved[$outcome->id]/$program_outcomes_attempted[$outcome->id])*100 }}},
372
+                @else
373
+                    0,
374
+                @endif
375
+            @endforeach
376
+
377
+        ]
378
+    }]
379
+});
380
+
206 381
 @stop

+ 366
- 42
app/views/local/managers/shared/print_school.blade.php Parādīt failu

@@ -15,12 +15,7 @@
15 15
 
16 16
 @section('main')
17 17
 
18
-<div class="row">
19
-    <div class="col-md-12" id="graph"></div>
20
-</div>
21
-<br>
22
-<br>
23
-<br>
18
+
24 19
 <h3>Programs</h3>
25 20
 <table class="tabletable-condensed">
26 21
     <tr>
@@ -40,8 +35,13 @@
40 35
         </tr>
41 36
     @endforeach
42 37
 </table>
43
-
44
-<h3>Assessment Results by Learning Outcomes in Academic Programs</h3>
38
+<br>
39
+<br>
40
+<br>
41
+<div class="row">
42
+    <div class="col-md-12" id="graph-undergrad"></div>
43
+</div>
44
+<h3>Assessment Results by Learning Outcomes in Academic Undergraduate Programs</h3>
45 45
 <table>
46 46
     <thead>
47 47
         <th>Learning Outcome</th>
@@ -50,14 +50,14 @@
50 50
         <th>Success Rate</th>
51 51
     </thead>
52 52
     <tbody>
53
-        @foreach($outcomes as $outcome)
53
+        @foreach($outcomes_undergrad as $outcome)
54 54
             <tr>
55 55
                 <td class="col-md-6">{{ $outcome->name }}</td>
56
-                <td class="col-md-2">{{{ $achievedProgramsPerOutcome[$outcome->id] }}}</td>
57
-                <td class="col-md-2">{{{ $attemptedProgramsPerOutcome[$outcome->id] }}}</td>
56
+                <td class="col-md-2">{{{ count($attemptedUndergradProgramsPerOutcome[$outcome->id]) }}}</td>
57
+                <td class="col-md-2">{{{ count($achievedUndergradProgramsPerOutcome[$outcome->id]) }}}</td>
58 58
                 <td class="col-md-2">
59
-                    @if($attemptedProgramsPerOutcome[$outcome->id]!=0)
60
-                        {{{ round($achievedProgramsPerOutcome[$outcome->id] / $attemptedProgramsPerOutcome[$outcome->id]*100, 2) }}}%
59
+                    @if(count($attemptedUndergradProgramsPerOutcome[$outcome->id])!=0)
60
+                        {{{ round( count($achievedUndergradProgramsPerOutcome[$outcome->id]) / count($attemptedUndergradProgramsPerOutcome[$outcome->id])*100, 2) }}}%
61 61
                     @else
62 62
                         N/M
63 63
                     @endif
@@ -70,7 +70,7 @@
70 70
 </table>
71 71
 
72 72
 <h3>Courses</h3>
73
-@if($school_sections_count>0)
73
+@if($undergrad_school_sections_count>0)
74 74
     <table>
75 75
         <thead>
76 76
             <tr>
@@ -81,7 +81,7 @@
81 81
             </tr>
82 82
         </thead>
83 83
         <tbody>
84
-            @foreach($grouped_courses as $grouped_course)
84
+            @foreach($undergrad_grouped_courses as $grouped_course)
85 85
                 <tr>
86 86
                     <td class="col-md-2">{{ $grouped_course->code.$grouped_course->number.' ('.$grouped_course->semester->code.')' }}</td>
87 87
                     <td class="col-md-4">{{{ $grouped_course->name}}}</td>
@@ -102,9 +102,9 @@
102 102
 @endif
103 103
 
104 104
 <h3>Sections</h3>
105
-@if($school_sections_count>0)
106
-    <p class="lead"> {{{ $assessed_sections_count }}} out of {{{ $school_sections_count }}} section(s) doing Assessment ({{{ round($assessed_sections_count/$school_sections_count*100, 2) }}}%)</p>
107
-    <table>
105
+@if($undergrad_school_sections_count>0)
106
+<p class="lead"> {{{ $undergrad_assessed_sections_count }}} out of {{{ $undergrad_school_sections_count }}} section(s) doing Assessment ({{{ round($undergrad_assessed_sections_count/$undergrad_school_sections_count*100, 2) }}}%)</p>
107
+<table>
108 108
         <thead>
109 109
             <tr>
110 110
                 <th>Identifier</th>
@@ -117,7 +117,9 @@
117 117
         </thead>
118 118
         <tbody>
119 119
             @foreach($school->programs as $program)
120
+            @if(!$program->is_graduate)
120 121
                 @foreach($program->courses as $course)
122
+               
121 123
                 <tr>
122 124
                     <td class="col-md-2">{{ $course->code.$course->number.'-'.$course->section.' ('.$course->semester->code.')' }}</td>
123 125
                     <td class="col-md-4">{{{ $course->name}}}</td>
@@ -125,16 +127,21 @@
125 127
                     <td class="col-md-3">{{{ $course->user->surnames }}}, {{{ $course->user->first_name }}}</td>
126 128
                     <td class="col-md-1">
127 129
                         @if(count($course->assessedActivities))
128
-                            <span class="glyphicon glyphicon-ok"></span>
130
+                            Yes
131
+                        @else
132
+                            No
129 133
                         @endif
130 134
                     </td>
131 135
                     <td class="col-md-1">
132 136
                         @if(count($course->publishedActivities))
133
-                            <span class="glyphicon glyphicon-ok"></span>
137
+                            Yes
138
+                        @else
139
+                            No
134 140
                         @endif
135 141
                     </td>
136 142
                 </tr>
137 143
                 @endforeach
144
+            @endif
138 145
             @endforeach
139 146
         </tbody>
140 147
     </table>
@@ -142,6 +149,123 @@
142 149
     <p class="lead"> No sections assigned.</p>
143 150
 @endif
144 151
 
152
+
153
+<br>
154
+<br>
155
+<br>
156
+<div class="row">
157
+    <div class="col-md-12" id="graph-grad"></div>
158
+</div>
159
+
160
+
161
+<h3>Assessment Results by Learning Outcomes in Academic Graduate Programs</h3>
162
+<table>
163
+    <thead>
164
+        <th>Learning Outcome</th>
165
+        <th>Programs Achieved</th>
166
+        <th>Programs doing Assessment</th>
167
+        <th>Success Rate</th>
168
+    </thead>
169
+    <tbody>
170
+        @foreach($outcomes_grad as $outcome)
171
+        <tr>
172
+            <td class="col-md-6">{{ link_to_action('OutcomesController@show', $outcome->name, array($outcome->id), $attributes = array()) }}</td>
173
+            <td class="col-md-2">{{{ count($attemptedGradProgramsPerOutcome[$outcome->id]) }}}</td>
174
+            <td class="col-md-2">{{{ count($achievedGradProgramsPerOutcome[$outcome->id]) }}}</td>
175
+            <td class="col-md-2">
176
+                @if(count($attemptedGradProgramsPerOutcome[$outcome->id])!=0)
177
+                    {{{ round(count($achievedGradProgramsPerOutcome[$outcome->id]) / count($attemptedGradProgramsPerOutcome[$outcome->id])*100, 2) }}}%
178
+                @else
179
+                    N/M
180
+                @endif
181
+            </td>
182
+        </tr>
183
+        @endforeach
184
+    </tbody>
185
+    <tfoot></tfoot>
186
+    <caption>N/M: Not Measured</caption>
187
+</table>
188
+
189
+
190
+<h3>Courses</h3>
191
+@if($grad_school_sections_count>0)
192
+    <table>
193
+        <thead>
194
+            <tr>
195
+                <th>Identifier</th>
196
+                <th>Name</th>
197
+                <th>Program</th>
198
+                <th>Assessed and Published</th>
199
+            </tr>
200
+        </thead>
201
+        <tbody>
202
+            @foreach($grad_grouped_courses as $grouped_course)
203
+                <tr>
204
+                    <td class="col-md-2">{{ $grouped_course->code.$grouped_course->number.' ('.$grouped_course->semester->code.')' }}</td>
205
+                    <td class="col-md-4">{{{ $grouped_course->name}}}</td>
206
+                    <td class="col-md-2">{{{ $grouped_course->program->name }}}</td>
207
+                    <td class="col-md-1">
208
+                        @if($grouped_course->outcomes_attempted!=NULL)
209
+                            Yes
210
+                        @else
211
+                            No
212
+                        @endif
213
+                    </td>
214
+                </tr>
215
+            @endforeach
216
+        </tbody>
217
+    </table>
218
+@else
219
+    <p class="lead"> No courses assigned.</p>
220
+@endif
221
+
222
+<h3>Sections</h3>
223
+@if($grad_school_sections_count>0)
224
+<p class="lead"> {{{ $grad_assessed_sections_count }}} out of {{{ $grad_school_sections_count }}} section(s) doing Assessment ({{{ round($grad_assessed_sections_count/$grad_school_sections_count*100, 2) }}}%)</p>
225
+<table>
226
+        <thead>
227
+            <tr>
228
+                <th>Identifier</th>
229
+                <th>Name</th>
230
+                <th>Program</th>
231
+                <th>Professor</th>
232
+                <th>Assessed Activities</th>
233
+                <th>Assessed Results</th>
234
+            </tr>
235
+        </thead>
236
+        <tbody>
237
+            @foreach($school->programs as $program)
238
+            @if($program->is_graduate)
239
+                @foreach($program->courses as $course)
240
+               
241
+                <tr>
242
+                    <td class="col-md-2">{{ $course->code.$course->number.'-'.$course->section.' ('.$course->semester->code.')' }}</td>
243
+                    <td class="col-md-4">{{{ $course->name}}}</td>
244
+                    <td class="col-md-2">{{{ $course->program->name }}}</td>
245
+                    <td class="col-md-3">{{{ $course->user->surnames }}}, {{{ $course->user->first_name }}}</td>
246
+                    <td class="col-md-1">
247
+                        @if(count($course->assessedActivities))
248
+                            Yes
249
+                        @else
250
+                            No
251
+                        @endif
252
+                    </td>
253
+                    <td class="col-md-1">
254
+                        @if(count($course->publishedActivities))
255
+                            Yes
256
+                        @else
257
+                            No
258
+                        @endif
259
+                    </td>
260
+                </tr>
261
+                @endforeach
262
+            @endif
263
+            @endforeach
264
+        </tbody>
265
+    </table>
266
+@else
267
+    <p class="lead"> No sections assigned.</p>
268
+@endif
145 269
 @stop
146 270
 
147 271
 @section('included-js')
@@ -159,21 +283,21 @@ $(function () {
159 283
         e.preventDefault()
160 284
         $(this).tab('show');
161 285
     });
162
-
163
-    $('#graph').highcharts({
286
+    
287
+    $('#graph-grad').highcharts({
164 288
         chart: {
165 289
             type: 'bar'
166 290
         },
167 291
         title: {
168
-            text: 'Performance by Learning Outcome Criteria in {{ $school->name }}'
292
+            text: 'Graduate Performance by {{ $school->name }} Students by Learning Outcome Criteria'
169 293
         },
170 294
         legend: {
171 295
             reversed: true,
172 296
         },
173 297
         xAxis: {
174 298
             categories: [
175
-                @foreach($outcomes as $outcome)
176
-                    "{{{ $outcome->name }}}",
299
+                @foreach($outcomes_grad as $outcome)
300
+                    "{{{ $outcome->name }}} <br> (N = {{$grad_outcomes_attempted[$outcome->id]}} , {{$grad_outcomes_achieved[$outcome->id]}})",
177 301
                 @endforeach
178 302
             ],
179 303
             labels: {
@@ -192,10 +316,48 @@ $(function () {
192 316
             max: 100,
193 317
             title: {
194 318
                 text: 'Percentage'
319
+            },
320
+            
321
+        @if(isset($default_grad))
322
+            plotLines:[{
323
+        value:66.67,
324
+        color: '#000',
325
+        width:3,
326
+        zIndex:4,
327
+        label:{
328
+            text: 'Goal (70%)',
329
+            style: {
330
+                color: '#000',
331
+                fontSize: '14px',
332
+            }
333
+
334
+        }
335
+    }]
336
+    @else
337
+    plotLines:[{
338
+        value:{{$linea_grad->expected_target}},
339
+        color: '#000',
340
+        width:3,
341
+        zIndex:4,
342
+        label:{
343
+            text: 'Goal ({{$linea_grad->expected_target}}%)',
344
+            style: {
345
+                color: '#000',
346
+                fontSize: '14px',
195 347
             }
348
+
349
+        }
350
+    }]
351
+
352
+    @endif
196 353
         },
197 354
         tooltip: {
198
-            enabled: false,
355
+            headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
356
+            pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
357
+                '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
358
+            footerFormat: '</table>',
359
+            shared: true,
360
+            useHTML: true
199 361
         },
200 362
         plotOptions: {
201 363
             bar: {
@@ -208,7 +370,7 @@ $(function () {
208 370
             groupPadding: 0.075
209 371
             },
210 372
         },
211
-        series: [{
373
+        series: [/*{
212 374
             name: 'Expected Value',
213 375
             color: '#555555',
214 376
             dataLabels: {
@@ -223,19 +385,19 @@ $(function () {
223 385
                 y:-1
224 386
             },
225 387
             data: [
226
-                @foreach($outcomes as $index => $outcome)
388
+                @foreach($outcomes_grad as $index => $outcome)
227 389
                     @if(
228
-                        is_array($outcomes_attempted)
229
-                        && array_key_exists($outcome->id, $outcomes_attempted)
230
-                        && $outcomes_attempted[$outcome->id]!=0)
390
+                        is_array($grad_outcomes_attempted)
391
+                        && array_key_exists($outcome->id, $grad_outcomes_attempted)
392
+                        && $grad_outcomes_attempted[$outcome->id]!=0)
231 393
                         {{{ $outcome->expected_outcome }}},
232 394
                     @else
233 395
                         0,
234 396
                     @endif
235 397
                 @endforeach
236
-            ]
237
-
238
-        }, {
398
+            ],
399
+            pointPadding: 0,
400
+        }, */{
239 401
             name: 'Obtained Value',
240 402
             color: '#e70033',
241 403
             dataLabels: {
@@ -250,23 +412,185 @@ $(function () {
250 412
                 y:-1
251 413
             },
252 414
             data:[
253
-                @foreach($outcomes as $index => $outcome)
415
+                @foreach($outcomes_grad as $index => $outcome)
254 416
                     @if(
255
-                        is_array($outcomes_attempted)
256
-                        && array_key_exists($outcome->id, $outcomes_attempted)
257
-                        && $outcomes_attempted[$outcome->id]!=0)
258
-                        {{{ ($outcomes_achieved[$outcome->id]/$outcomes_attempted[$outcome->id])*100 }}},
417
+                        is_array($grad_outcomes_attempted)
418
+                        && array_key_exists($outcome->id, $grad_outcomes_attempted)
419
+                        && $grad_outcomes_attempted[$outcome->id]!=0)
420
+                        <?php
421
+                         if (isset($grad_outcomes_achieved[$outcome->id]))
422
+                        $achieved = $grad_outcomes_achieved[$outcome->id];
423
+                        else {
424
+                            $achieved =0;
425
+                        }
426
+                        ?>
427
+                        {{{ ($achieved/$grad_outcomes_attempted[$outcome->id])*100 }}},
259 428
                     @else
260 429
                         0,
261 430
                     @endif
262 431
                 @endforeach
432
+            ],
433
+            pointPadding: 0,
434
+        }]
435
+    });
436
+});
263 437
 
264
-            ]
265
-        }, ]
438
+    $('#graph-undergrad').highcharts({
439
+        chart: {
440
+            type: 'bar'
441
+        },
442
+        title: {
443
+            text: 'Undergraduate Performance of {{ $school->name }} Students by Learning Outcome'
444
+        },
445
+        legend: {
446
+            reversed: true,
447
+        },
448
+        xAxis: {
449
+            categories: [
450
+                @foreach($outcomes_undergrad as $outcome)
451
+                    "{{{ $outcome->name }}},  <br> (N = {{$undergrad_outcomes_attempted[$outcome->id]}} ,{{$undergrad_outcomes_achieved[$outcome->id]}})",
452
+                @endforeach
453
+            ],
454
+            labels: {
455
+                style: {
456
+                    fontSize:'11px'
457
+                },
458
+                step:1,
459
+                useHTML:true,
460
+                formatter: function() {
461
+                    return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
462
+                },
463
+            }
464
+        },
465
+        yAxis: {
466
+            min: 0,
467
+            max: 100,
468
+            title: {
469
+                text: 'Percentage'
470
+            }, 
471
+        @if(isset($default_undergrad))
472
+            plotLines:[{
473
+        value:66.67,
474
+        color: '#000',
475
+        width:3,
476
+        zIndex:4,
477
+        label:{
478
+            text: 'Goal (70%)',
479
+            style: {
480
+                color: '#000',
481
+                fontSize: '14px',
482
+            }
483
+
484
+        }
485
+    }]
486
+    @else
487
+    plotLines:[{
488
+        value:{{$linea_undergrad->expected_target}},
489
+        color: '#000',
490
+        width:3,
491
+        zIndex:4,
492
+        label:{
493
+            text: 'Goal ({{$linea_undergrad->expected_target}}%)',
494
+            style: {
495
+                color: '#000',
496
+                fontSize: '14px',
497
+            }
498
+
499
+        }
500
+    }]
501
+
502
+    @endif
503
+        },
504
+        tooltip: {
505
+            headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
506
+            pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
507
+                '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
508
+            footerFormat: '</table>',
509
+            shared: true,
510
+            useHTML: true
511
+        },
512
+        plotOptions: {
513
+            bar: {
514
+                //grouping: false,
515
+                shadow: false,
516
+                borderWidth: 0,
517
+            },
518
+            series: {
519
+            pointPadding: 0,
520
+            groupPadding: 0.075
521
+            },
522
+        },
523
+        series: [/*{
524
+            name: 'Expected Value',
525
+            color: '#555555',
526
+            dataLabels: {
527
+                enabled: true,
528
+                fontSize: 8,
529
+                color: '#fff',
530
+                align: 'right',
531
+                format: '{y:.1f}%',
532
+                style: {
533
+                    //fontWeight: 'bold'
534
+                }, 
535
+                y:-1
536
+            },
537
+            data: [
538
+                @foreach($outcomes_undergrad as $index => $outcome)
539
+                    @if(
540
+                        is_array($undergrad_outcomes_attempted)
541
+                        && array_key_exists($outcome->id, $undergrad_outcomes_attempted)
542
+                        && $undergrad_outcomes_attempted[$outcome->id]!=0)
543
+                        {{{ $outcome->expected_outcome }}},
544
+                    @else
545
+                        0,
546
+                    @endif
547
+                @endforeach
548
+            ],
549
+            pointPadding: 0,
550
+        },*/ {
551
+            name: 'Obtained Value',
552
+            color: '#e70033',
553
+            dataLabels: {
554
+                enabled: true,
555
+                fontSize: 8,
556
+                color: '#fff',
557
+                align: 'right',
558
+                format: '{y:.1f}%',
559
+                style: {
560
+                    //fontWeight: 'bold'
561
+                },
562
+                y:-1
563
+            },
564
+            data:[
565
+                @foreach($outcomes_undergrad as $index => $outcome)
566
+                    @if(
567
+                        is_array($undergrad_outcomes_attempted)
568
+                        && array_key_exists($outcome->id, $undergrad_outcomes_attempted)
569
+                        && $undergrad_outcomes_attempted[$outcome->id]!=0)
570
+                        <?php
571
+                        
572
+                        if (isset($undergrad_outcomes_achieved[$outcome->id]))
573
+                        $achieved = $undergrad_outcomes_achieved[$outcome->id];
574
+                        else {
575
+                            $achieved =0;
576
+                        }
577
+                        
578
+                        ?>
579
+                        {{{ ($achieved/$undergrad_outcomes_attempted[$outcome->id])*100 }}},
580
+                    @else
581
+                        0,
582
+                    @endif
583
+                @endforeach
584
+            ],
585
+            pointPadding: 0,
586
+        }]
266 587
     });
267 588
 
589
+
590
+   
591
+
268 592
     // Include dummy graph for outcomes
269 593
     @include('global.dummy-outcomes')
270
-});
594
+
271 595
 
272 596
 @stop

+ 36
- 4
app/views/local/managers/shared/program.blade.php Parādīt failu

@@ -242,7 +242,7 @@ reversed: true,
242 242
 xAxis: {
243 243
 categories: [
244 244
 @foreach($outcomes as $outcome)
245
-"{{{ $outcome->name }}}",
245
+"{{{ $outcome->name }}},  <br> (N = {{$outcomes_attempted[$outcome->id]}} ,{{$outcomes_achieved[$outcome->id]}})",
246 246
 @endforeach
247 247
 ],
248 248
 labels: {
@@ -261,7 +261,39 @@ min: 0,
261 261
 max: 100,
262 262
 title: {
263 263
 text: 'Percentage'
264
-}
264
+},
265
+@if($program->expected_outcome_target == null)
266
+                plotLines:[{
267
+            value:66.67,
268
+            color: '#000',
269
+            width:3,
270
+            zIndex:4,
271
+            label:{
272
+                text: 'Goal (70%)',
273
+                style: {
274
+                    color: '#000',
275
+                    fontSize: '14px',
276
+                }
277
+    
278
+            }
279
+        }]
280
+        @else
281
+        plotLines:[{
282
+            value:{{$program->expected_outcome_target->expected_target}},
283
+            color: '#000',
284
+            width:3,
285
+            zIndex:4,
286
+            label:{
287
+                text: 'Goal ({{$program->expected_outcome_target->expected_target}}%)',
288
+                style: {
289
+                    color: '#000',
290
+                    fontSize: '14px',
291
+                }
292
+    
293
+            }
294
+        }]
295
+
296
+        @endif
265 297
 },
266 298
 tooltip: {
267 299
 headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
@@ -282,7 +314,7 @@ pointPadding: 0,
282 314
 groupPadding: 0.075
283 315
 },
284 316
 },
285
-series: [{
317
+series: [/*{
286 318
 name: 'Expected Value',
287 319
 color: '#555555',
288 320
 dataLabels: {
@@ -309,7 +341,7 @@ is_array($outcomes_attempted)
309 341
 @endforeach
310 342
 ]
311 343
 
312
-},{
344
+},*/{
313 345
 name: 'Obtained Value',
314 346
 color: '#e70033',
315 347
 dataLabels: {

+ 47
- 14
app/views/local/managers/shared/program_student_result.blade.php Parādīt failu

@@ -321,6 +321,7 @@ $('#graph').highcharts({
321 321
         title: {
322 322
             text: 'Percentage'
323 323
         },
324
+        @if($program->expected_outcome_target == null)
324 325
 			plotLines:[{
325 326
 		value:70,
326 327
 		color: '#000',
@@ -335,6 +336,22 @@ $('#graph').highcharts({
335 336
 
336 337
 		}
337 338
 	}]
339
+    @else
340
+    plotLines:[{
341
+		value:{{$program->expected_outcome_target->expected_target}},
342
+		color: '#000',
343
+		width:3,
344
+		zIndex:4,
345
+		label:{
346
+			text: 'Goal ({{$program->expected_outcome_target->expected_target}}%)',
347
+			style: {
348
+				color: '#000',
349
+				fontSize: '14px',
350
+			}
351
+
352
+		}
353
+	}]
354
+    @endif
338 355
 
339 356
     },
340 357
     tooltip: {
@@ -443,21 +460,37 @@ $('#graph2').highcharts({
443 460
         max: 100,
444 461
         title: {
445 462
             text: 'Percentage'
446
-        },
447
-        			plotLines:[{
448
-		value:70,
449
-		color: '#000',
450
-		width:3,
451
-		zIndex:4,
452
-		label:{
453
-			text: 'Goal (70%)',
454
-			style: {
455
-				color: '#000',
456
-				fontSize: '14px',
457
-			}
463
+        },        @if($program->expected_outcome_target == null)
464
+        plotLines:[{
465
+    value:70,
466
+    color: '#000',
467
+    width:3,
468
+    zIndex:4,
469
+    label:{
470
+        text: 'Goal (70%)',
471
+        style: {
472
+            color: '#000',
473
+            fontSize: '14px',
474
+        }
458 475
 
459
-		}
460
-	}]
476
+    }
477
+}]
478
+@else
479
+plotLines:[{
480
+    value:{{$program->expected_outcome_target->expected_target}},
481
+    color: '#000',
482
+    width:3,
483
+    zIndex:4,
484
+    label:{
485
+        text: 'Goal ({{$program->expected_outcome_target->expected_target}}%)',
486
+        style: {
487
+            color: '#000',
488
+            fontSize: '14px',
489
+        }
490
+
491
+    }
492
+}]
493
+@endif
461 494
 
462 495
     },
463 496
     tooltip: {

+ 129
- 6
app/views/local/managers/shared/school.blade.php Parādīt failu

@@ -25,7 +25,8 @@
25 25
     <div role="tabpanel" class="tab-pane active" id="undergraduate">
26 26
         <div class="row">
27 27
             <div class="col-md-9 graph" id="graph-undergrad"></div>
28
-                <div class="col-md-3">
28
+
29
+            <div class="col-md-3">
29 30
                 <br>
30 31
                     <div class="panel panel-default panel-scrolling">
31 32
                         <div class="panel-heading" role="tab" id="headingOne">
@@ -52,8 +53,17 @@
52 53
                             </table>
53 54
                         </div>
54 55
                     </div>
56
+                    <br>
57
+
58
+                @if(isset($default_undergrad))
59
+                <p><strong>This Goal Bar is the default score. If you wish to change it, change it on the selected Semesters Annual Plan</strong></p>
60
+            @else
61
+                <p><strong>This Goal is from {{$linea_undergrad->program_name}} on the semester {{$linea_undergrad->semester_name}}</strong></p>
62
+    
63
+            @endif
55 64
                 </div>
56
-            </div>
65
+
66
+                        </div>
57 67
 
58 68
         <div>
59 69
             <!-- Nav tabs -->
@@ -61,6 +71,9 @@
61 71
                 <li role="presentation" class="active"><a href="#undergrad-outcomes-assessed" aria-controls="undergrad-outcomes-assessed" role="tab">Assessment Results by Learning Outcomes in Academic Programs</a></li>
62 72
                 <li role="presentation"><a href="#undergrad-courses" aria-controls="undergrad-courses" role="tab"> Undergraduate Courses</a></li>
63 73
                 <li role="presentation"><a href="#undergrad-sections" aria-controls="undergrad-sections" role="tab">Sections</a></li>
74
+               <!-- <li role="presentation"><a href="#performance-undergrad-students" aria-controls = 'performance-undergrad-students' role="tab">Performance by Students in Learning Outcomes</a></li>-->
75
+
76
+      
64 77
             </ul>
65 78
 
66 79
             <!-- Tab panes -->
@@ -213,6 +226,7 @@
213 226
                         </div>
214 227
                     </div>
215 228
                 </div>
229
+                <div role="tabpanel" class="tab-pane" id="performance-undergrad-students"></div>
216 230
             </div>
217 231
         </div>
218 232
     </div>
@@ -247,6 +261,15 @@
247 261
                             </table>
248 262
                         </div>
249 263
                     </div>
264
+
265
+                    <br>
266
+
267
+                    @if(isset($default_grad))
268
+                    <p><strong>This Goal Bar is the default score. If you wish to change it, change it on the selected Semesters Annual Plan</strong></p>
269
+                @else
270
+                    <p><strong>This Goal is from {{$linea_grad->program_name}} on the semester {{$linea_grad->semester_name}}</strong></p>
271
+        
272
+                @endif
250 273
                 </div>
251 274
             </div>
252 275
 
@@ -256,6 +279,7 @@
256 279
                 <li role="presentation" class="active"><a href="#grad-outcomes-assessed" aria-controls="grad-outcomes-assessed" role="tab">Assessment Results by Learning Outcomes in Academic Programs</a></li>
257 280
                 <li role="presentation"><a href="#grad-courses" aria-controls="grad-courses" role="tab"> Graduate Courses</a></li>
258 281
                 <li role="presentation"><a href="#grad-sections" aria-controls="grad-sections" role="tab">Sections</a></li>
282
+                <!--<li role="presentation"><a href="#performance-grad-students" aria-controls = 'performance-grad-students' role="tab">Performance by Students in Learning Outcomes</a></li>-->
259 283
             </ul>
260 284
 
261 285
             <!-- Tab panes -->
@@ -408,6 +432,8 @@
408 432
                         </div>
409 433
                     </div>
410 434
                 </div>
435
+                <div role="tabpanel" class = "tab-pane" id = "performance-grad-students">
436
+                </div>
411 437
             </div>
412 438
         </div>
413 439
     </div>
@@ -449,7 +475,7 @@ $(function () {
449 475
                 type: 'bar'
450 476
             },
451 477
             title: {
452
-                text: 'Undergraduate Performance by Learning Outcome Criteria in {{ $school->name }}'
478
+                text: 'Undergraduate Performance of {{ $school->name }} Students by Learning Outcome'
453 479
             },
454 480
             legend: {
455 481
                 reversed: true,
@@ -476,7 +502,39 @@ $(function () {
476 502
                 max: 100,
477 503
                 title: {
478 504
                     text: 'Percentage'
505
+                }, 
506
+            @if(isset($default_undergrad))
507
+                plotLines:[{
508
+            value:66.67,
509
+            color: '#000',
510
+            width:3,
511
+            zIndex:4,
512
+            label:{
513
+                text: 'Goal (70%)',
514
+                style: {
515
+                    color: '#000',
516
+                    fontSize: '14px',
517
+                }
518
+    
519
+            }
520
+        }]
521
+        @else
522
+        plotLines:[{
523
+            value:{{$linea_undergrad->expected_target}},
524
+            color: '#000',
525
+            width:3,
526
+            zIndex:4,
527
+            label:{
528
+                text: 'Goal ({{$linea_undergrad->expected_target}}%)',
529
+                style: {
530
+                    color: '#000',
531
+                    fontSize: '14px',
479 532
                 }
533
+    
534
+            }
535
+        }]
536
+
537
+        @endif
480 538
             },
481 539
             tooltip: {
482 540
                 headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
@@ -568,7 +626,7 @@ $(function () {
568 626
                 type: 'bar'
569 627
             },
570 628
             title: {
571
-                text: 'Graduate Performance by Learning Outcome Criteria in {{ $school->name }}'
629
+                text: 'Graduate Performance by {{ $school->name }} Students by Learning Outcome Criteria'
572 630
             },
573 631
             legend: {
574 632
                 reversed: true,
@@ -595,7 +653,40 @@ $(function () {
595 653
                 max: 100,
596 654
                 title: {
597 655
                     text: 'Percentage'
656
+                },
657
+                
658
+            @if(isset($default_grad))
659
+                plotLines:[{
660
+            value:70.00,
661
+            color: '#000',
662
+            width:3,
663
+            zIndex:4,
664
+            label:{
665
+                text: 'Goal (70%)',
666
+                style: {
667
+                    color: '#000',
668
+                    fontSize: '14px',
669
+                }
670
+    
671
+            }
672
+        }]
673
+        @else
674
+        plotLines:[{
675
+            value:{{$linea_grad->expected_target}},
676
+            color: '#000',
677
+            width:3,
678
+            zIndex:4,
679
+            label:{
680
+                text: 'Goal ({{$linea_grad->expected_target}}%)',
681
+                style: {
682
+                    color: '#000',
683
+                    fontSize: '14px',
598 684
                 }
685
+    
686
+            }
687
+        }]
688
+
689
+        @endif
599 690
             },
600 691
             tooltip: {
601 692
                 headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
@@ -616,7 +707,7 @@ $(function () {
616 707
                 groupPadding: 0.075
617 708
                 },
618 709
             },
619
-            series: [{
710
+            series: [/*{
620 711
                 name: 'Expected Value',
621 712
                 color: '#555555',
622 713
                 dataLabels: {
@@ -643,7 +734,7 @@ $(function () {
643 734
                     @endforeach
644 735
                 ],
645 736
                 pointPadding: 0,
646
-            }, {
737
+            }, */{
647 738
                 name: 'Obtained Value',
648 739
                 color: '#e70033',
649 740
                 dataLabels: {
@@ -713,7 +804,39 @@ $(function () {
713 804
                 max: 100,
714 805
                 title: {
715 806
                     text: 'Percentage'
807
+                }, 
808
+                @if(isset($default_undergrad))
809
+                    plotLines:[{
810
+                value:66.67,
811
+                color: '#000',
812
+                width:3,
813
+                zIndex:4,
814
+                label:{
815
+                    text: 'Goal (70%)',
816
+                    style: {
817
+                        color: '#000',
818
+                        fontSize: '14px',
819
+                    }
820
+        
716 821
                 }
822
+            }]
823
+            @else
824
+            plotLines:[{
825
+                value:{{$linea_undergrad->expected_target}},
826
+                color: '#000',
827
+                width:3,
828
+                zIndex:4,
829
+                label:{
830
+                    text: 'Goal ({{$linea_undergrad->expected_target}}%)',
831
+                    style: {
832
+                        color: '#000',
833
+                        fontSize: '14px',
834
+                    }
835
+        
836
+                }
837
+            }]
838
+    
839
+            @endif
717 840
             },
718 841
             tooltip: {
719 842
                 headerFormat: '<span style="font-size:10px">{point.key}</span><table>',

+ 23
- 3
app/views/local/professors/activity.blade.php Parādīt failu

@@ -506,7 +506,7 @@
506 506
         //array_key_exists($outcome->id, $outcomes_attempted) &&
507 507
         //$outcomes_attempted[$outcome->id] != 0
508 508
         )
509
-        
509
+         
510 510
             <?php
511 511
             $attempted = $outcomes_activity[$outcome->id]->attempted;
512 512
             $achieved = $outcomes_activity[$outcome->id]->achieved;
@@ -539,14 +539,15 @@
539 539
     title: {
540 540
     text: 'Percentage'
541 541
     }, 
542
+    @if($activity->course->program->expected_outcome_target == null)
542 543
     
543 544
 			plotLines:[{
544
-		value:66.67,
545
+		value:70.00,
545 546
 		color: '#000',
546 547
 		width:3,
547 548
 		zIndex:4,
548 549
 		label:{
549
-			text: 'Goal (66.67%)',
550
+			text: 'Goal (70.00%)',
550 551
 			style: {
551 552
 				color: '#000',
552 553
 				fontSize: '14px',
@@ -554,6 +555,25 @@
554 555
 
555 556
 		}
556 557
 	}]
558
+
559
+    @else
560
+    plotLines:[{
561
+		value:{{$activity->course->program->expected_outcome_target->expected_target}},
562
+		color: '#000',
563
+		width:3,
564
+		zIndex:4,
565
+		label:{
566
+			text: 'Goal ({{$activity->course->program->expected_outcome_target->expected_target}})',
567
+			style: {
568
+				color: '#000',
569
+				fontSize: '14px',
570
+			}
571
+
572
+		}
573
+	}]
574
+
575
+    @endif
576
+
557 577
     },
558 578
     tooltip: {
559 579
     headerFormat: '<span style="font-size:10px">{point.key}</span><table>',

+ 44
- 6
app/views/local/professors/compare_activities.blade.php Parādīt failu

@@ -843,14 +843,29 @@
843 843
         title: {
844 844
         text: 'Percentage'
845 845
         }, 
846
-        
847
-                plotLines:[{
848
-            value:66.67,
846
+        @if($activity_1->course->program->expected_outcome_target == null)
847
+        plotLines:[{
848
+            value:70.00,
849
+            color: '#000',
850
+            width:3,
851
+            zIndex:4,
852
+            label:{
853
+                text: 'Goal (70.00%)',
854
+                style: {
855
+                    color: '#000',
856
+                    fontSize: '14px',
857
+                }
858
+    
859
+            }
860
+        }]
861
+        @else
862
+        plotLines:[{
863
+            value:{{$activity_1->course->program->expected_outcome_target->expected_target}},
849 864
             color: '#000',
850 865
             width:3,
851 866
             zIndex:4,
852 867
             label:{
853
-                text: 'Goal (66.67%)',
868
+                text: 'Goal ({{$activity_1->course->program->expected_outcome_target->expected_target}}%)',
854 869
                 style: {
855 870
                     color: '#000',
856 871
                     fontSize: '14px',
@@ -858,6 +873,8 @@
858 873
     
859 874
             }
860 875
         }]
876
+        @endif
877
+
861 878
     },
862 879
     tooltip: {
863 880
     headerFormat: '<span style="font-size:10px">{point.key}</span>'+
@@ -968,14 +985,16 @@
968 985
         title: {
969 986
         text: 'Percentage'
970 987
         }, 
988
+
989
+        @if($activity_2->course->program->expected_outcome_target == null)
971 990
         
972 991
                 plotLines:[{
973
-            value:66.67,
992
+            value:70.00,
974 993
             color: '#000',
975 994
             width:3,
976 995
             zIndex:4,
977 996
             label:{
978
-                text: 'Goal (66.67%)',
997
+                text: 'Goal (70.00%)',
979 998
                 style: {
980 999
                     color: '#000',
981 1000
                     fontSize: '14px',
@@ -983,6 +1002,25 @@
983 1002
     
984 1003
             }
985 1004
         }]
1005
+        @else
1006
+         
1007
+        plotLines:[{
1008
+            value:{{$activity_2->course->program->expected_outcome_target->expected_target}},
1009
+            color: '#000',
1010
+            width:3,
1011
+            zIndex:4,
1012
+            label:{
1013
+                text: 'Goal ({{$activity_2->course->program->expected_outcome_target->expected_target}}%)',
1014
+                style: {
1015
+                    color: '#000',
1016
+                    fontSize: '14px',
1017
+                }
1018
+    
1019
+            }
1020
+        }]
1021
+
1022
+        @endif
1023
+        
986 1024
     },
987 1025
     tooltip: {
988 1026
     headerFormat: '<span style="font-size:10px">{point.key}</span>'+

+ 20
- 2
app/views/local/professors/course.blade.php Parādīt failu

@@ -311,13 +311,14 @@ $(function () {
311 311
             title: {
312 312
                 text: 'Percentage'
313 313
             },
314
+            @if($course->program->expected_outcome_target == null)
314 315
             plotLines:[{
315
-                value:66.67,
316
+                value:70.00,
316 317
                 color: '#000',
317 318
                 width:3,
318 319
                 zIndex:4,
319 320
                 label:{
320
-                    text: 'Goal (66.67%)',
321
+                    text: 'Goal (70.00%)',
321 322
                     style: {
322 323
                         color: '#000',
323 324
                         fontSize: '14px',
@@ -325,6 +326,23 @@ $(function () {
325 326
         
326 327
                 }
327 328
             }]
329
+            @else
330
+            plotLines:[{
331
+                value:{{$course->program->expected_outcome_target->expected_target}},
332
+                color: '#000',
333
+                width:3,
334
+                zIndex:4,
335
+                label:{
336
+                    text: 'Goal ({{$course->program->expected_outcome_target->expected_target}}%)',
337
+                    style: {
338
+                        color: '#000',
339
+                        fontSize: '14px',
340
+                    }
341
+        
342
+                }
343
+            }]
344
+            @endif
345
+
328 346
         },
329 347
         tooltip: {
330 348
             headerFormat: '<span style="font-size:10px">{point.key}</span><table>',

+ 19
- 3
app/views/local/professors/overview.blade.php Parādīt failu

@@ -174,14 +174,14 @@ function loadGraphs() {
174 174
                     text: 'Percentage'
175 175
                 },
176 176
 
177
-                
177
+                @if($grouped_course->program->expected_outcome_target == null)
178 178
 			plotLines:[{
179
-		value:66.67,
179
+		value:70.00,
180 180
 		color: '#000',
181 181
 		width:3,
182 182
 		zIndex:4,
183 183
 		label:{
184
-			text: 'Goal (66.67%)',
184
+			text: 'Goal (70.00%)',
185 185
 			style: {
186 186
 				color: '#000',
187 187
 				fontSize: '14px',
@@ -189,6 +189,22 @@ function loadGraphs() {
189 189
 
190 190
 		}
191 191
 	}]
192
+    @else			plotLines:[{
193
+		value:{{$grouped_course->program->expected_outcome_target->expected_target}},
194
+		color: '#000',
195
+		width:3,
196
+		zIndex:4,
197
+		label:{
198
+			text: 'Goal ({{$grouped_course->program->expected_outcome_target->expected_target}})',
199
+			style: {
200
+				color: '#000',
201
+				fontSize: '14px',
202
+			}
203
+
204
+		}
205
+	}]
206
+    @endif
207
+
192 208
 
193 209
             },
194 210
             tooltip: {

+ 167
- 16
app/views/local/professors/program.blade.php Parādīt failu

@@ -14,9 +14,13 @@
14 14
 
15 15
 @section('main')
16 16
 
17
-<div class="row">
17
+<button type='button' class = 'btn btn-primary' id="change-view-btn" onclick="changeView('#allGraph','#programGraph', '', 'Show All Students')">Show Program Students</button>
18
+<div class="row" id = "allGraph">
18 19
     <div class="col-md-12" id="graph"></div>
19 20
 </div>
21
+<div class="row graph-stu" id = "programGraph">
22
+    <div class = "col-md-12" id="graph-stu-program"></div>
23
+</div>
20 24
 
21 25
 <div class="row">
22 26
     <div class="col-md-12">
@@ -94,6 +98,23 @@
94 98
     </div>
95 99
 </div>
96 100
 
101
+<script>
102
+
103
+function changeView(graph_to_hide, graph_to_show, index, message){
104
+
105
+current_message = $("#change-view-btn"+index).html();
106
+$("#change-view-btn"+index).html(message);
107
+
108
+$(graph_to_hide).hide()
109
+$(graph_to_show).show()
110
+
111
+
112
+$("#change-view-btn"+index).attr('onclick','changeView("'+graph_to_show+'", "'+graph_to_hide+'","'+index+'","'+current_message+'")')
113
+}
114
+
115
+$(".graph-stu").hide();
116
+</script>
117
+
97 118
 @stop
98 119
 
99 120
 @section('included-js')
@@ -116,7 +137,7 @@ $(function () {
116 137
         xAxis: {
117 138
             categories: [
118 139
                 @foreach($outcomes as $outcome)
119
-                    "{{{ $outcome->name }}}",
140
+                    "{{{ $outcome->name }}}<br> (N = {{$outcomes_attempted[$outcome->id]}}, {{$outcomes_achieved[$outcome->id]}})",
120 141
                 @endforeach
121 142
             ],
122 143
             labels: {
@@ -135,21 +156,38 @@ $(function () {
135 156
             max: 100,
136 157
             title: {
137 158
                 text: 'Percentage'
138
-            },
139
-			plotLines:[{
140
-                value:66.67,
159
+            },@if($program->expected_outcome_target == null)
160
+            plotLines:[{
161
+        value:70.00,
162
+        color: '#000',
163
+        width:3,
164
+        zIndex:4,
165
+        label:{
166
+            text: 'Goal (70.00%)',
167
+            style: {
141 168
                 color: '#000',
142
-                width:3,
143
-                zIndex:4,
144
-                label:{
145
-                    text: 'Goal (66.67%)',
146
-                    style: {
147
-                        color: '#000',
148
-                        fontSize: '14px',
149
-                    }
150
-        
151
-                }
152
-            }]
169
+                fontSize: '14px',
170
+            }
171
+
172
+        }
173
+    }]
174
+    @else
175
+    plotLines:[{
176
+        value:{{$program->expected_outcome_target->expected_target}},
177
+        color: '#000',
178
+        width:3,
179
+        zIndex:4,
180
+        label:{
181
+            text: 'Goal ({{$program->expected_outcome_target->expected_target}}%)',
182
+            style: {
183
+                color: '#000',
184
+                fontSize: '14px',
185
+            }
186
+
187
+        }
188
+    }]
189
+
190
+    @endif
153 191
         },
154 192
         tooltip: {
155 193
             headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
@@ -236,6 +274,119 @@ $(function () {
236 274
         } --}}]
237 275
     });
238 276
 
277
+    
278
+$('#graph-stu-program').highcharts({
279
+    chart: {
280
+        type: 'bar'
281
+    },
282
+    title: {
283
+        text: 'Performance by Learning Outcome Criteria in Program\'s students'
284
+    },
285
+    legend: {
286
+        reversed: true,
287
+    },
288
+    xAxis: {
289
+        categories: [
290
+            @foreach($outcomes as $outcome)
291
+                "{{{ $outcome->name }}} <br>(N = {{$program_outcomes_attempted[$outcome->id]}}, {{$program_outcomes_achieved[$outcome->id]}})",
292
+            @endforeach
293
+        ],
294
+        labels: {
295
+            style: {
296
+                fontSize:'11px'
297
+            },
298
+            step:1,
299
+            useHTML:true,
300
+            formatter: function() {
301
+                return '<div style="width:100px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
302
+            },
303
+        }
304
+    },
305
+   
306
+    yAxis: {
307
+        min: 0,
308
+        max: 100,
309
+        title: {
310
+        text: 'Percentage'
311
+        }, 
312
+        @if($program->expected_outcome_target == null)
313
+                plotLines:[{
314
+            value:70.00,
315
+            color: '#000',
316
+            width:3,
317
+            zIndex:4,
318
+            label:{
319
+                text: 'Goal (70.00%)',
320
+                style: {
321
+                    color: '#000',
322
+                    fontSize: '14px',
323
+                }
324
+    
325
+            }
326
+        }]
327
+        @else
328
+        plotLines:[{
329
+            value:{{$program->expected_outcome_target->expected_target}},
330
+            color: '#000',
331
+            width:3,
332
+            zIndex:4,
333
+            label:{
334
+                text: 'Goal ({{$program->expected_outcome_target->expected_target}}%)',
335
+                style: {
336
+                    color: '#000',
337
+                    fontSize: '14px',
338
+                }
339
+    
340
+            }
341
+        }]
342
+
343
+        @endif
344
+    },
345
+    tooltip: {
346
+        enabled:false
347
+    },
348
+    plotOptions: {
349
+            bar: {
350
+                //grouping: false,
351
+                shadow: false,
352
+                borderWidth: 0,
353
+            },
354
+            series: {
355
+                pointPadding: 0,
356
+                groupPadding: 0.075,
357
+                animation: false
358
+            },
359
+        },
360
+    series: [{
361
+        name: 'Obtained Value',
362
+        color: '#e70033',
363
+        dataLabels: {
364
+            enabled: true,
365
+            fontSize: 8,
366
+            color: '#fff',
367
+            align: 'right',
368
+            format: '{y:.1f}%',
369
+            style: {
370
+                //fontWeight: 'bold'
371
+            },
372
+            y:-1
373
+        },
374
+        data:[
375
+            @foreach($outcomes as $index => $outcome)
376
+                @if(
377
+                    is_array($program_outcomes_attempted)
378
+                    && array_key_exists($outcome->id, $program_outcomes_attempted)
379
+                    && $program_outcomes_attempted[$outcome->id]!=0)
380
+                    {{{ ($program_outcomes_achieved[$outcome->id]/$program_outcomes_attempted[$outcome->id])*100 }}},
381
+                @else
382
+                    0,
383
+                @endif
384
+            @endforeach
385
+
386
+        ]
387
+    }]
388
+});
389
+
239 390
     // Include dummy graph for outcomes
240 391
     @include('global.dummy-outcomes')
241 392
 });