├── .gitignore ├── CHANGELOG ├── LICENSE ├── README.md ├── manage.py ├── populate_database.py ├── tasks ├── __init__.py ├── admin.py ├── apps.py ├── forms.py ├── models.py ├── static │ └── tasks │ │ ├── TPS_bar_tr.png │ │ ├── pencil.png │ │ └── style.css ├── templates │ └── tasks │ │ ├── base.html │ │ ├── change_password.html │ │ ├── email_template.html │ │ ├── index.html │ │ ├── lecturer_course_view.html │ │ ├── lecturer_index.html │ │ ├── lecturer_menu.html │ │ ├── lecturer_task_view.html │ │ ├── lecturer_team_view.html │ │ ├── login.html │ │ ├── mastercourse_create.html │ │ ├── milestone_create.html │ │ ├── milestone_edit.html │ │ ├── milestone_grade.html │ │ ├── my_details.html │ │ ├── my_email.html │ │ ├── my_notifications.html │ │ ├── my_teams.html │ │ ├── password_success.html │ │ ├── profile.html │ │ ├── profile_lecturer.html │ │ ├── task_create.html │ │ ├── task_edit.html │ │ ├── task_view.html │ │ ├── team_create.html │ │ ├── team_edit_std.html │ │ ├── team_success.html │ │ └── updates.html ├── tests.py ├── urls.py └── views.py └── tps ├── __init__.py ├── asgi.py ├── settings.py ├── urls.py └── wsgi.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | .vscode 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | 103 | .DS_Store 104 | *.sqlite3 105 | media/ 106 | *.pyc 107 | *.db 108 | *.pid 109 | 110 | # Ignore Django Migrations in Development if you are working on team 111 | 112 | # Only for Development only 113 | # **/migrations/** 114 | # !**/migrations 115 | # !**/migrations/__init__.py 116 | 117 | # Byte-compiled / optimized / DLL files 118 | __pycache__/ 119 | *.py[cod] 120 | *$py.class 121 | 122 | # C extensions 123 | *.so 124 | 125 | # Distribution / packaging 126 | .Python 127 | build/ 128 | develop-eggs/ 129 | dist/ 130 | downloads/ 131 | eggs/ 132 | .eggs/ 133 | lib/ 134 | lib64/ 135 | parts/ 136 | sdist/ 137 | var/ 138 | wheels/ 139 | *.egg-info/ 140 | .installed.cfg 141 | *.egg 142 | MANIFEST 143 | 144 | # PyInstaller 145 | # Usually these files are written by a python script from a template 146 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 147 | *.manifest 148 | *.spec 149 | 150 | # Installer logs 151 | pip-log.txt 152 | pip-delete-this-directory.txt 153 | 154 | # Unit test / coverage reports 155 | htmlcov/ 156 | .tox/ 157 | .coverage 158 | .coverage.* 159 | .cache 160 | nosetests.xml 161 | coverage.xml 162 | *.cover 163 | .hypothesis/ 164 | 165 | # Translations 166 | *.mo 167 | *.pot 168 | 169 | # Django stuff: 170 | *.log 171 | local_settings.py 172 | 173 | # Flask stuff: 174 | instance/ 175 | .webassets-cache 176 | 177 | # Scrapy stuff: 178 | .scrapy 179 | 180 | # Sphinx documentation 181 | docs/_build/ 182 | 183 | # PyBuilder 184 | target/ 185 | 186 | # Jupyter Notebook 187 | .ipynb_checkpoints 188 | 189 | # pyenv 190 | .python-version 191 | 192 | # celery beat schedule file 193 | celerybeat-schedule 194 | 195 | # SageMath parsed files 196 | *.sage.py 197 | 198 | # Environments 199 | .env 200 | .venv 201 | env/ 202 | venv/ 203 | ENV/ 204 | env.bak/ 205 | venv.bak/ 206 | 207 | # Spyder project settings 208 | .spyderproject 209 | .spyproject 210 | 211 | # Rope project settings 212 | .ropeproject 213 | 214 | # mkdocs documentation 215 | /site 216 | 217 | # mypy 218 | .mypy_cache/ 219 | .idea/ 220 | db.sqlite3 221 | *.sqlite3 222 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | Initial version, 2017 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Task Point System 2 | 3 | Task Point System (TPS) is a project management process, developed as a web application, and is currently running at http://setps.ieu.edu.tr.  4 | 5 | The idea is based on the paper "Implementing large projects in software engineering courses" by David Coppit [1]. TPS uses the concept of "tasks," atomic pieces of work that can be handled by a single developer. The purpose of the TPS is to provide a system that encourages equal contribution for every student and to let the students have a more realistic approach of a course project [2]. 6 | 7 | ## History 8 | 9 | TPS has been in use since the 2016-2017 Spring semester. It was used as a process on online services such as Trello and Asana in the "SE315 Software Project Management" course in Izmir University of Economics, and the results have been presented at a national conference [3]. The following semester, it was implemented as a standalone web application using Django. Since then, it has been an integral part of the "SE302 Principles of Software Engineering" course and other courses such as "CE216 Fundamental Topics in Programming." 10 | 11 | ## Development 12 | 13 | TPS is implemented in Django. The views make use of Bootstrap and jQuery to provide a better user experience. It is developed and maintained by Kaya Oğuz (http://homes.ieu.edu.tr/koguz) with several other contributors. Please visit the Wiki page for more information. 14 | 15 | ## References 16 | 1. D. Coppit, "Implementing large projects in software engineering courses," Computer Science Education, vol. 16, no. 1, pp. 53–73, Mar. 2006. 17 | 2. D. Oguz and K. Oguz, "Perspectives on the Gap Between the Software Industry and the Software Engineering Education," IEEE Access, vol. 7, pp. 117527–117543, 2019. 18 | 3. K. Oguz and S. Gül, "Managing and evaluating team projects in software engineering education," in CEUR Workshop Proceedings, 2017, vol. 1980, pp. 184–195. 19 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tps.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /populate_database.py: -------------------------------------------------------------------------------- 1 | import os, django 2 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tps.settings") 3 | django.setup() 4 | from tasks.models import * 5 | from django.contrib.auth.models import User 6 | from datetime import date, timedelta, datetime 7 | 8 | 9 | # Worth noting that the create operations of different models should be done in this order 10 | # due to the foreign key references between some models, which also explains why the scope is shared. 11 | 12 | supers = [] 13 | supers.append(User.objects.create_superuser('super1', password='super1password', email='')) 14 | for super in supers: 15 | super.save() 16 | 17 | dev_users = [] 18 | dev_users.append(User.objects.create_user(username='dev1', password='dev1password')) 19 | dev_users.append(User.objects.create_user(username='dev2', password='dev2password')) 20 | dev_users.append(User.objects.create_user(username='dev3', password='dev3password')) 21 | dev_users.append(User.objects.create_user(username='dev4', password='dev4password')) 22 | dev_users.append(User.objects.create_user(username='dev5', password='dev5password')) 23 | dev_users.append(User.objects.create_user(username='dev6', password='dev6password')) 24 | for user in dev_users: 25 | user.save() 26 | 27 | 28 | courses = [] 29 | courses.append(Course(course='SE 302',section=1,year = 2020, term=2, number_of_students=40, team_weight=60, ind_weight=40)) 30 | courses.append(Course(course='CE 350',section=1,year = 2020, term=2, number_of_students=40, team_weight=60, ind_weight=40)) 31 | for course in courses: 32 | course.create_course_name() 33 | course.save() 34 | 35 | milestones = [] 36 | four_weeks = timedelta(weeks=4) 37 | eight_weeks = timedelta(weeks=8) 38 | four_weeks_from_now = datetime.now() + four_weeks 39 | four_weeks_from_today = four_weeks_from_now.date() 40 | eight_weeks_from_now = datetime.now() + eight_weeks 41 | eight_weeks_from_today = eight_weeks_from_now.date() 42 | milestones.append(Milestone(course=courses[0], name='Milestone1-SE 302', description='Milestone1-SE 302 Description', due = four_weeks_from_today )) 43 | milestones.append(Milestone(course=courses[0], name='Milestone2-SE 302', description='Milestone2-SE 302 Description', due = eight_weeks_from_today )) 44 | milestones.append(Milestone(course=courses[0], name='Milestone3-SE 302', description='Milestone3-SE 302 Description', due = eight_weeks_from_today )) 45 | milestones.append(Milestone(course=courses[1], name='Milestone1-CE 350', description='Milestone1-CE 350 Description', due = four_weeks_from_today )) 46 | milestones.append(Milestone(course=courses[1], name='Milestone2-CE 350', description='Milestone2-CE 350 Description', due = eight_weeks_from_today )) 47 | for milestone in milestones: 48 | milestone.save() 49 | 50 | teams = [] 51 | teams.append(Team(course=courses[0], name='Team1-SE 3-2', github='fillertext')) 52 | teams.append(Team(course=courses[0], name='Team2-SE 3-2', github='fillertext')) 53 | teams.append(Team(course=courses[1], name='Team1-SE 3-2', github='fillertext')) 54 | for team in teams: 55 | team.save() 56 | 57 | developers = [] 58 | developers.append(Developer(id='100', user=dev_users[0])) 59 | developers.append(Developer(id='101', user=dev_users[1])) 60 | developers.append(Developer(id='102', user=dev_users[2])) 61 | developers.append(Developer(id='103', user=dev_users[3])) 62 | developers.append(Developer(id='104', user=dev_users[4])) 63 | developers.append(Developer(id='105', user=dev_users[5])) 64 | for developer in developers: 65 | developer.save() 66 | 67 | dev_team_relations = [] 68 | dev_team_relations.append(DeveloperTeam(developer=developers[0], team=teams[0])) 69 | dev_team_relations.append(DeveloperTeam(developer=developers[1], team=teams[0])) 70 | dev_team_relations.append(DeveloperTeam(developer=developers[2], team=teams[1])) 71 | dev_team_relations.append(DeveloperTeam(developer=developers[3], team=teams[1])) 72 | dev_team_relations.append(DeveloperTeam(developer=developers[4], team=teams[1])) 73 | dev_team_relations.append(DeveloperTeam(developer=developers[5], team=teams[2])) 74 | for dev_team_relation in dev_team_relations: 75 | dev_team_relation.save() 76 | 77 | 78 | two_weeks = timedelta(weeks=2) 79 | two_weeks_from_now = datetime.now() + two_weeks 80 | two_weeks_from_today = two_weeks_from_now.date() 81 | tasks = [] 82 | tasks.append(Task( 83 | milestone=milestones[0], 84 | assignee=developers[0], 85 | team=teams[0], 86 | title='Task0 brief name', 87 | description='Task0 description', 88 | due=two_weeks_from_today 89 | )) 90 | tasks.append(Task( 91 | milestone=milestones[0], 92 | assignee=developers[1], 93 | team=teams[0], 94 | title='Task1 brief name', 95 | description='Task1 description', 96 | due=two_weeks_from_today 97 | )) 98 | tasks.append(Task( 99 | milestone=milestones[0], 100 | assignee=developers[0], 101 | team=teams[0], 102 | title='Task2 brief name', 103 | description='Task2 description', 104 | due=two_weeks_from_today 105 | )) 106 | 107 | for task in tasks: 108 | task.save() -------------------------------------------------------------------------------- /tasks/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koguz/TaskPointSystem/1996f577e98035fd50df66c72e6a487f333d0b2e/tasks/__init__.py -------------------------------------------------------------------------------- /tasks/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import * 3 | 4 | # Register your models here. 5 | 6 | admin.site.register(Lecturer) 7 | admin.site.register(Developer) 8 | admin.site.register(MasterCourse) 9 | admin.site.register(Course) 10 | admin.site.register(Milestone) 11 | admin.site.register(Team) 12 | admin.site.register(MasterTask) 13 | admin.site.register(Task) 14 | admin.site.register(Comment) 15 | admin.site.register(Vote) 16 | admin.site.register(Like) 17 | admin.site.register(MasterTaskLog) 18 | admin.site.register(TeamMilestoneGrade) 19 | -------------------------------------------------------------------------------- /tasks/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class TasksConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'tasks' 7 | -------------------------------------------------------------------------------- /tasks/forms.py: -------------------------------------------------------------------------------- 1 | from django.db.models.base import Model 2 | from django.forms import ModelForm, DateInput, Textarea 3 | 4 | from .models import * 5 | 6 | class MasterCourseForm(ModelForm): 7 | class Meta: 8 | model = MasterCourse 9 | fields = ['code', 'name'] 10 | 11 | class CourseForm(ModelForm): 12 | class Meta: 13 | model = Course 14 | fields = ['semester', 'group_weight', 'individual_weight'] 15 | 16 | class MilestoneForm(ModelForm): 17 | class Meta: 18 | model = Milestone 19 | fields = ['name', 'description', 'weight', 'due'] 20 | widgets = { 21 | 'due': DateInput(attrs={'class': 'datepicker'}), 22 | } 23 | 24 | class TaskForm(ModelForm): 25 | class Meta: 26 | model = Task 27 | fields = ['title', 'description', 'priority', 'promised_date'] 28 | widgets = { 29 | 'promised_date': DateInput(attrs={'class': 'datepicker'}), 30 | } 31 | 32 | def clean(self): 33 | cleaned_data = super().clean() 34 | due = cleaned_data.get('promised_date') 35 | from datetime import date 36 | if due < date.today(): 37 | raise ValidationError("Promised date is in the past!") 38 | 39 | 40 | class CommentForm(ModelForm): 41 | class Meta: 42 | model=Comment 43 | fields = ['body', 'file_url'] 44 | widgets = { 45 | 'body': Textarea(attrs={'cols': 20, 'rows': 5}), 46 | } 47 | 48 | class TeamFormStd(ModelForm): 49 | class Meta: 50 | model = Team 51 | fields = ['name', 'github'] 52 | 53 | class EmailChangeForm(ModelForm): 54 | class Meta: 55 | model = User 56 | fields = ['email'] 57 | 58 | class PhotoURLChangeForm(ModelForm): 59 | class Meta: 60 | model = Developer 61 | fields = ['photoURL'] 62 | exculude = ['team'] -------------------------------------------------------------------------------- /tasks/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.db.models.deletion import CASCADE, SET_NULL 3 | from django.db.models.fields.related import ForeignKey 4 | from django.core.exceptions import ValidationError 5 | from django.contrib.auth.models import User 6 | from django.utils.translation import gettext_lazy as _ 7 | 8 | def past_date_validator(value): 9 | import datetime 10 | if datetime.date.today() >= value: 11 | raise ValidationError( 12 | _('%(value)s is in the past!'), 13 | params={'value': value}, 14 | ) 15 | 16 | class Lecturer(models.Model): 17 | user = models.OneToOneField(User, on_delete=CASCADE) 18 | 19 | def __str__(self): 20 | return self.getName() 21 | 22 | def getName(self): 23 | return self.user.first_name + " " + self.user.last_name 24 | 25 | class MasterCourse(models.Model): 26 | code = models.CharField("Course Code", max_length=8) 27 | name = models.CharField("Course Name", max_length=256) 28 | 29 | def __str__(self): 30 | return self.code + " - " + self.name 31 | 32 | class Course(models.Model): 33 | masterCourse = models.ForeignKey(MasterCourse, on_delete=CASCADE) 34 | lecturer = models.ForeignKey(Lecturer, on_delete=SET_NULL, null=True) 35 | semester = models.CharField(max_length=128) 36 | group_weight = models.PositiveSmallIntegerField("Group Weight", default=40) 37 | individual_weight = models.PositiveSmallIntegerField("Individual Weight", default=60) 38 | active = models.BooleanField("Active", default=True) 39 | # TODO check if group + individual is 100 40 | 41 | def __str__(self): 42 | return str(self.masterCourse) + " @ " + self.semester 43 | 44 | def get_current_milestone(self): 45 | import datetime 46 | return self.milestone_set.all().order_by('due').exclude(due__lte=datetime.date.today())[0] 47 | 48 | class Milestone(models.Model): 49 | course = models.ForeignKey(Course, on_delete=CASCADE) 50 | name = models.CharField("Milestone", max_length=128) 51 | description = models.TextField("Milestone Details") 52 | weight = models.PositiveSmallIntegerField("Weight", default=30) 53 | due = models.DateField("Due Date") 54 | 55 | def __str__(self): 56 | return self.name 57 | 58 | class Team(models.Model): 59 | course = models.ForeignKey(Course, on_delete=CASCADE) 60 | name = models.CharField(max_length=256) 61 | github = models.CharField("Git Page", max_length=512, null=True) 62 | supervisor = models.ForeignKey(Lecturer, on_delete=SET_NULL, blank=True, null=True) 63 | 64 | def __str__(self): 65 | return self.name 66 | 67 | def get_all_milestone_points(self, m): 68 | p = 0 69 | for task in self.mastertask_set.all().filter(milestone=m): 70 | p = p + task.get_points() 71 | return p 72 | 73 | def get_all_accepted_points(self, m): 74 | p = 0 75 | for task in self.mastertask_set.all().filter(milestone=m): 76 | if task.status == 5: 77 | p = p + task.get_points() 78 | return p 79 | 80 | def get_milestone_list(self): 81 | milestone_list = {} 82 | for m in self.course.milestone_set.all(): 83 | milestone_list[m.name] = self.get_team_points(m) 84 | return milestone_list 85 | 86 | def get_team_points(self, m): 87 | g = 0 88 | if self.get_all_milestone_points(m) > 0: 89 | g = round((self.get_all_accepted_points(m) / self.get_all_milestone_points(m)) * 100) 90 | return g 91 | 92 | def get_developer_average(self, m): 93 | return self.get_all_milestone_points(m) / len(self.developer_set.all()) 94 | 95 | 96 | class Developer(models.Model): 97 | user = models.OneToOneField(User, on_delete=CASCADE) 98 | team = models.ManyToManyField(Team, blank=True) 99 | photoURL = models.URLField(max_length=200, default="https://cdn0.iconfinder.com/data/icons/social-media-network-4/48/male_avatar-512.png", blank=True) 100 | 101 | # team = models.ForeignKey(Team, on_delete=SET_NULL, blank=True, null=True) 102 | 103 | def __str__(self): 104 | return self.getName() 105 | 106 | def getName(self): 107 | return self.user.first_name + " " + self.user.last_name 108 | 109 | def get_all_accepted_points(self, m): 110 | p = 0 111 | for task in self.mastertask_set.all().filter(milestone=m): 112 | if task.status == 5: 113 | p = p + task.get_points() 114 | return p 115 | 116 | def get_developer_grade(self, m): 117 | t = self.team.all()[0] 118 | g = 0 119 | if t.get_developer_average(m) > 0: 120 | g = round((self.get_all_accepted_points(m) / t.get_developer_average(m)) * 100) 121 | if g > 100: 122 | g = 100 123 | return g 124 | 125 | # we have to get the milestone names and points 126 | # for those milestones in a dictionary, so that i can loop through it in the template... 127 | def get_milestone_list(self, team_id): 128 | milestone_list = {} 129 | t = Team.objects.get(pk=team_id) 130 | for m in t.course.milestone_set.all(): 131 | milestone_list[m.name] = self.get_developer_grade(m) 132 | return milestone_list 133 | 134 | def get_project_grade(self, team_id): 135 | team_grade = 0 136 | ind_grade = 0 137 | t = Team.objects.get(pk=team_id) 138 | c = t.course 139 | for m in c.milestone_set.all(): 140 | team_grade = team_grade + t.get_team_points(m) * (m.weight / 100) 141 | ind_grade = ind_grade + self.get_developer_grade(m) * (m.weight / 100) 142 | return round(team_grade * (c.group_weight / 100) + ind_grade * (c.individual_weight / 100)) 143 | 144 | # TODO check permissions https://docs.djangoproject.com/en/3.2/topics/auth/default/ 145 | 146 | class MasterTask(models.Model): 147 | 148 | DIFFICULTY = ( 149 | (1, 'Easy'), 150 | (2, 'Normal'), 151 | (3, 'Difficult') 152 | ) 153 | 154 | STATUS = ( 155 | (1, 'Proposed'), 156 | (2, 'Open'), 157 | (3, 'Completed'), 158 | (4, 'Rejected'), 159 | (5, 'Accepted') 160 | ) 161 | 162 | milestone = models.ForeignKey(Milestone, on_delete=CASCADE) 163 | owner = models.ForeignKey(Developer, on_delete=CASCADE) 164 | team = models.ForeignKey(Team, on_delete=CASCADE) 165 | opened = models.DateTimeField("Opened Date", null=True) 166 | completed = models.DateTimeField("Completion Date", null=True) 167 | difficulty = models.PositiveSmallIntegerField("Difficulty", choices=DIFFICULTY, default=2) 168 | status = models.PositiveSmallIntegerField("Status", choices=STATUS, default=1) 169 | 170 | def __str__(self): 171 | # this query gives me the last task title associated with this master task 172 | return self.task_set.all().order_by('pk').reverse()[0].title 173 | 174 | # TODO 175 | def getStatus(self): 176 | return self.STATUS[self.status-1][1] 177 | 178 | def getDifficulty(self): 179 | return self.DIFFICULTY[self.difficulty-1][1] 180 | 181 | def get_points(self): 182 | return self.difficulty * self.get_task().priority 183 | 184 | def get_task(self): 185 | return self.task_set.all().order_by('pk').reverse()[0] 186 | 187 | class Task(models.Model): 188 | PRIORITY = ( 189 | (1, 'Low'), 190 | (2, 'Planned'), 191 | (3, 'Urgent') 192 | ) 193 | masterTask = models.ForeignKey(MasterTask, on_delete=CASCADE) 194 | title = models.CharField("Brief Task Title", max_length=256) 195 | description = models.TextField("Description") 196 | promised_date = models.DateField("Promised Date", validators=[past_date_validator]) 197 | priority = models.PositiveSmallIntegerField("Priority", choices=PRIORITY, default=2) 198 | version = models.IntegerField("version", default=1) 199 | 200 | def __str__(self): 201 | return self.title 202 | 203 | def getPriority(self): 204 | return self.PRIORITY[self.priority-1][1] 205 | 206 | class Vote(models.Model): 207 | task = models.ForeignKey(Task, on_delete=CASCADE) 208 | owner = models.ForeignKey(Developer, on_delete=CASCADE) 209 | vote = models.BooleanField("Approve") 210 | status = models.SmallIntegerField("Status", default=1) 211 | 212 | class Comment(models.Model): 213 | owner = models.ForeignKey(User, on_delete=models.CASCADE) 214 | mastertask = models.ForeignKey(MasterTask, on_delete=models.CASCADE) 215 | task = models.ForeignKey(Task, on_delete=models.CASCADE) 216 | body = models.TextField("Comment") 217 | file_url = models.URLField("URL", max_length=512, blank=True, null=True) 218 | approved = models.BooleanField("Approved", blank=True, null=True) 219 | date = models.DateTimeField("Date", auto_now_add=True) 220 | 221 | def __str__(self): 222 | return self.body 223 | 224 | class Like(models.Model): 225 | owner = models.ForeignKey(Developer, on_delete=models.CASCADE) 226 | mastertask = models.ForeignKey(MasterTask, on_delete=models.CASCADE) 227 | liked = models.BooleanField("Liked") 228 | 229 | class MasterTaskLog(models.Model): 230 | mastertask = models.ForeignKey(MasterTask, on_delete=models.CASCADE) 231 | taskstatus = models.CharField("Task Status", max_length=64) 232 | tarih = models.DateTimeField("Date", auto_now_add=True) 233 | log = models.TextField("Log") 234 | gizli = models.BooleanField("Gizli", default=False) 235 | 236 | class TeamMilestoneGrade(models.Model): 237 | milestone = models.ForeignKey(Milestone, on_delete=models.CASCADE) 238 | team = models.ForeignKey(Team, on_delete=models.CASCADE) 239 | grade = models.PositiveSmallIntegerField("Grade", default=0) 240 | 241 | 242 | -------------------------------------------------------------------------------- /tasks/static/tasks/TPS_bar_tr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koguz/TaskPointSystem/1996f577e98035fd50df66c72e6a487f333d0b2e/tasks/static/tasks/TPS_bar_tr.png -------------------------------------------------------------------------------- /tasks/static/tasks/pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koguz/TaskPointSystem/1996f577e98035fd50df66c72e6a487f333d0b2e/tasks/static/tasks/pencil.png -------------------------------------------------------------------------------- /tasks/static/tasks/style.css: -------------------------------------------------------------------------------- 1 | body, p, td, div, nav { 2 | font-family: 'Roboto', sans-serif; 3 | } 4 | 5 | h1, h2, h3, h4, h5, h6 { 6 | font-family: 'Roboto', sans-serif; 7 | font-weight: 400; 8 | } 9 | -------------------------------------------------------------------------------- /tasks/templates/tasks/base.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | 3 | 4 | 5 | 6 | 12 | 16 | 17 | 18 | 22 | 23 | 27 | {% block customcss %} {% endblock %} 28 | 29 | TPS - {{ page_title }} 30 | 31 | 32 | 105 | 106 |
107 |
108 |
{% block breadcrumbs %} {% endblock %}
109 |
110 |
111 | 112 |
113 |
114 |
{% block alert %} {% endblock %}
115 |
{% block left_content %} {% endblock %}
116 |
{% block main_content %} {% endblock %}
117 |
{% block right_content %} {% endblock %}
118 |
119 |
120 | 121 |
122 |
123 |
{% block main_left_content %} {% endblock %}
124 |
{% block main_right_content %} {% endblock %}
127 |
128 |
129 | 130 |
131 |
132 |
{% block small_left_content %} {% endblock %}
135 |
{% block large_main_content %} {% endblock %}
138 |
139 |
140 | 141 |
142 |
143 |
144 |
Task Point System, 2017-2022
146 |
147 |
148 | 149 | 154 | 159 | 164 | {% block scriptblock %} 165 | 174 | {% endblock %} 175 | 176 | 177 | -------------------------------------------------------------------------------- /tasks/templates/tasks/change_password.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/profile.html" %} {% load static %} {% block main_content %} 2 | 8 |

CHANGE YOUR PASSWORD


9 | 10 |
11 |
12 | {% csrf_token %} 13 | 14 | {{ form }} 15 | 26 |
 
27 |
28 |
29 | 32 | {% endblock%} 33 | -------------------------------------------------------------------------------- /tasks/templates/tasks/email_template.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 99 | 100 | 101 | 106 | 107 | 108 | 109 | 119 | 120 | 121 | 136 | 137 | 138 | 772 | 773 | 774 |
145 | 146 | 147 |
151 |
163 |
172 | 173 | 174 | 175 |
184 |
185 | 186 |
196 | 197 | 198 | 206 | 207 | 208 | 227 | 228 | 229 |
217 |
225 |
226 |
230 | 231 | 232 |
233 | 234 |
235 |
236 | 237 | 238 |
239 |
240 |
241 | 242 |
246 |
258 |
267 | 268 | 269 | 270 |
279 |
280 | 281 |
291 | 292 | 293 | 301 | 302 | 303 | 350 | 351 | 352 |
312 | 318 | 319 | 347 | 348 |
326 | Image 346 |
349 |
353 | 354 | 355 |
356 | 357 |
358 |
359 | 360 | 361 |
362 |
363 |
364 | 365 |
369 |
381 |
390 |
399 |
400 | 401 |
411 | 412 | 413 | 421 | 422 | 423 | 470 | 471 | 472 |
432 | 438 | 439 | 467 | 468 |
446 | Image 466 |
469 |
473 | 474 | 482 | 483 | 484 | 520 | 521 | 522 |
493 |
501 |

{{title}} 516 | 517 |

518 |
519 |
523 | 524 | 525 |
526 | 527 |
528 |
529 | 530 | 531 |
532 |
533 |
534 | 535 |
539 |
551 |
560 | 561 | 562 | 563 |
572 |
573 | 574 |
584 | 585 | 586 | 594 | 595 | 596 | 624 | 625 | 626 |
605 |
612 | {% for content in contentList%} 613 |

{{content}}

621 | {% endfor %} 622 |
623 |
627 | 628 | 636 | 637 | 638 | 705 | 706 | 707 |
647 | 704 |
708 | 709 | 717 | 718 | 719 | 755 | 756 | 757 |
728 |
735 |

Thanks,

744 |

The TPS Team

753 |
754 |
758 | 759 | 760 |
761 | 762 |
763 |
764 | 765 | 766 |
767 |
768 |
769 | 770 | 771 |
775 | 776 | 777 | 778 | 779 | -------------------------------------------------------------------------------- /tasks/templates/tasks/index.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} {% load static %} {% block alert %} 2 | {% if not user.email%} 3 | 9 | {% endif %} 10 | {% endblock %} 11 | 12 | {% block left_content %} 13 | 14 |
15 | 32 |
33 |

Visit Team Git Repository

34 |

Edit Team Information

35 |
36 |
Team Points
37 | 38 |

39 | {% for key, value in team.get_milestone_list.items %} 40 | {{ key }}: {{ value }} Points
41 | {% endfor %} 42 |

43 | 44 |
Developer Points
45 |

46 |

    47 | {% for dev, value in developers.items %} 48 |
  • {{ dev }} 49 |
      50 |
    • Overall Project: {{ value.0 }} Points
    • 51 | {% for k, v in value.1.items %} 52 |
    • {{ k }}: {{ v }} Points
    • 53 | {% endfor %} 54 |
    55 |
  • 56 | {% endfor %} 57 |
58 |

59 | {% endblock %} 60 | 61 | {% block main_content %} 62 |
63 |
64 |

Tasks

65 |
66 |
67 | 68 |
69 |
70 |
71 |
72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | {% for mtask in tasks %} 83 | 84 | 85 | 86 | 87 | 98 | 99 | {% endfor %} 100 | 101 |
OwnerTitleMilestoneStatus
{{mtask.owner}}{{mtask}}{{mtask.milestone}}{{mtask.getStatus}}
102 |
103 | 104 | 105 | 106 | 107 | {% endblock%} 108 | 109 | {% block right_content %} 110 |

Project Information


111 |
Current Milestone: {{ milestone }}
112 |

{{milestone.description|linebreaksbr}}

113 |

Due: {{milestone.due}}

114 |

Weight: {{milestone.weight}}

115 | {% endblock %} -------------------------------------------------------------------------------- /tasks/templates/tasks/lecturer_course_view.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} 2 | {% load static %} 3 | 4 | 5 | {% block breadcrumbs %} 6 | Home > 7 | {{ course }} 8 | {% endblock %} 9 | 10 | {% block small_left_content %} 11 |

Milestones

12 | Create new
13 | {% for ms in milestones %} 14 | {{ ms }}
15 | [ Edit | Grades ]
16 | {% endfor %} 17 | 18 | 19 |
20 |

Teams

21 |
    22 | {% for team in teams %} 23 |
  • {{ team }}
  • 24 | {% endfor %} 25 |
26 | {% endblock %} 27 | 28 | {% block large_main_content %} 29 | 30 |

{{ course }}

31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | {% for task in tasks %} 46 | 47 | 48 | 49 | 50 | 51 | 62 | {% if task.completed %} 63 | 64 | {% else %} 65 | 66 | {% endif %} 67 | 68 | {% endfor %} 69 | 70 |
TeamOwnerTitleMilestoneStatusCompletion Time
{{task.team}}{{task.owner}}{{task}}{{task.milestone}}{{task.getStatus}}{{task.completed|timeuntil:task.opened}}-
71 | 72 | 73 | {% endblock%} -------------------------------------------------------------------------------- /tasks/templates/tasks/lecturer_index.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} {% load static %} {% block left_content %} 2 | {%include "tasks/lecturer_menu.html" %} {% endblock %} {% block main_content %} 3 | 4 |

Hello {{ user_display_name }}!

5 |

Todo list

6 |
    7 |
  • Check permissions - check if updating tasks are valid.
  • 8 |
  • Logging
  • 9 |
  • Let the team to change team properties
  • 10 |
11 | 12 | {% endblock%} -------------------------------------------------------------------------------- /tasks/templates/tasks/lecturer_menu.html: -------------------------------------------------------------------------------- 1 |
Lecturer Menu
2 |
Select Course
3 | 13 |
14 |
Course Menu
15 | -------------------------------------------------------------------------------- /tasks/templates/tasks/lecturer_task_view.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} 2 | {% load static %} 3 | 4 | 5 | {% block breadcrumbs %} 6 | Home > 7 | {{ course }} > 8 | Task: {{mastertask}} 9 | {% endblock %} 10 | 11 | {% block main_left_content %} 12 |
13 |
{{mastertask}}
14 |
15 |
Assigned to {{mastertask.owner}}
16 |
Due {{ task.promised_date }}
17 |

{{task.description|linebreaksbr}}

18 |
19 | 25 |
26 | 27 |

 

28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | {% load tz %} 38 | 39 | {% for log in logs %} 40 | 41 | 42 | 43 | 44 | 45 | {% endfor %} 46 | 47 |
DateTask StatusLog Message
{{log.tarih|localtime}}{{log.taskstatus}}{{log.log}}
48 | 49 | {% endblock %} 50 | 51 | {% block main_right_content %} 52 | 53 |

Comments

54 |
55 | {% csrf_token %} 56 | 57 | {{ form }} 58 | 59 | 60 | 63 | 64 |
  61 | 62 |
65 |
66 | 67 |
68 | {% for comment in comments %} 69 |
70 |
71 | {{ comment.owner.get_full_name }} 72 | {% if comment.approved %} approves.{% elif comment.approved == False %} requests changes.{% endif %} 73 |
74 |
75 |

{{comment.body|linebreaksbr}}

76 | {% if comment.file_url %} 77 | {{comment.file_url}} 78 | {% endif %} 79 |
80 | 81 |
82 | {% endfor %} 83 | 84 | {% endblock%} -------------------------------------------------------------------------------- /tasks/templates/tasks/lecturer_team_view.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} 2 | {% load static %} 3 | 4 | 5 | {% block small_left_content %} 6 |

Team Information

7 |

Visit Team Git Repository

8 |
Team Points
9 |

10 | {% for key, value in team.get_milestone_list.items %} 11 | {{ key }}: {{ value }} Points
12 | {% endfor %} 13 |

14 | 15 |
Developer Points
16 |

17 |

    18 | {% for dev, value in developers.items %} 19 |
  • {{ dev }} 20 |
      21 |
    • Overall Project: {{ value.0 }} Points
    • 22 | {% for k, v in value.1.items %} 23 |
    • {{ k }}: {{ v }} Points
    • 24 | {% endfor %} 25 |
    26 |
  • 27 | {% endfor %} 28 |
29 |

30 | 31 | {% endblock %} 32 | 33 | {% block large_main_content %} 34 | 35 |

{{ team }}

36 | 37 | << Back to {{ course }} 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | {% for task in tasks %} 52 | 53 | 54 | 55 | 56 | 57 | 68 | {% if task.completed %} 69 | 70 | {% else %} 71 | 72 | {% endif %} 73 | 74 | {% endfor %} 75 | 76 |
TeamOwnerTitleMilestoneStatusCompletion Time
{{task.team}}{{task.owner}}{{task}}{{task.milestone}}{{task.getStatus}}{{task.completed|timeuntil:task.opened}}-
77 | 78 | 79 | {% endblock%} -------------------------------------------------------------------------------- /tasks/templates/tasks/login.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} {% load static %} {% block customcss %} 2 | 3 | 16 | 17 | {% endblock %} {% block menubar %} {% endblock %} {% block main_content %} 18 | 19 |
20 |

TPS Login

21 |
22 | {% csrf_token %} 23 |
24 | 25 | 26 |
27 |
28 | 29 | 30 |
31 | 32 | 33 |
34 |
35 | 36 |
37 |

{{ login_error }}

38 |
39 | 40 | {% endblock %} 41 | -------------------------------------------------------------------------------- /tasks/templates/tasks/mastercourse_create.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} 2 | {% load static %} 3 | 4 | 5 | {% block left_content %} 6 | Back to lecturer view 7 | {% endblock %} 8 | 9 | {% block main_content %} 10 |

Create Master Course

11 |
12 | {% csrf_token %} 13 | 14 | {{ form }} 15 | {{ form_details }} 16 | 17 |
 
18 | 19 |
20 | 21 | {% endblock%} -------------------------------------------------------------------------------- /tasks/templates/tasks/milestone_create.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} 2 | {% load static %} 3 | 4 | 5 | 6 | {% block main_content %} 7 | 8 |

Create New Milestone

9 | 10 |
11 | {% csrf_token %} 12 | 13 | {{ form }} 14 | 15 | 16 | 17 |
 
18 |
19 | 20 | {% endblock%} 21 | 22 | -------------------------------------------------------------------------------- /tasks/templates/tasks/milestone_edit.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} 2 | {% load static %} 3 | 4 | 5 | 6 | {% block main_content %} 7 | 8 |

Edit Milestone

9 | 10 |
11 | {% csrf_token %} 12 | 13 | {{ form }} 14 | 15 | 16 | 17 |
 
18 |
19 | 20 | {% endblock%} 21 | 22 | -------------------------------------------------------------------------------- /tasks/templates/tasks/milestone_grade.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} 2 | {% load static %} 3 | 4 | 5 | 6 | {% block main_content %} 7 | 8 |

Grade Milestone

9 | 10 |
11 | 12 | {% csrf_token %} 13 | 14 | 15 | 16 | 17 | 18 | {% for k, v in grades.items %} 19 | 20 | 21 | 22 | 23 | {% endfor %} 24 | 25 | 26 | 27 |
TeamGrade
{{ k }}
 
28 |
29 | 30 | {% endblock%} 31 | 32 | -------------------------------------------------------------------------------- /tasks/templates/tasks/my_details.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/profile.html" %} {% load static %} {% block main_content %} 2 | 20 | 21 |
22 |

INFORMATION


23 |
24 |
Name: {{ user.first_name }}
25 |
26 |
27 |
Surname: {{ user.last_name }}
28 |
29 |
30 |
School ID: {{ user.username}}
31 |
32 | 33 |
E-mail: {{ user.email }}
34 | 35 | 36 |
37 | 38 | 39 | 42 | {%endblock %} 43 | -------------------------------------------------------------------------------- /tasks/templates/tasks/my_email.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/profile.html" %} {% load static %} {% block main_content %} 2 | 15 |
16 |

NOTIFICATIONS


17 | 18 |
19 |
20 |
21 |
22 | {% csrf_token %} 23 | 24 | {{ form }} 25 | 26 | 27 | 28 | 29 |
 
30 |
31 |
32 |
33 |
34 | 42 | 43 |
44 | 45 | 48 | {%endblock%} 49 | -------------------------------------------------------------------------------- /tasks/templates/tasks/my_notifications.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/profile.html" %} {% load static %} {% block main_content %} 2 | 90 | 91 |
92 |
93 |

Email:

94 |
95 |
96 | {% csrf_token %} 97 | 98 |
99 |
100 | 101 |
102 | 103 |
104 | 105 | 109 | 110 |

Discord:

111 |
112 |
113 | {% csrf_token %} 114 | 115 |
116 |
117 | 118 |
119 | 120 |
121 | 122 | 126 |
127 |
128 | 129 | 130 | 135 | {%endblock%} 136 | -------------------------------------------------------------------------------- /tasks/templates/tasks/my_teams.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/profile.html" %} {% load static %} {% block main_content%} 2 | 32 |
33 |

Course - Team Name: CE223 - Team-1

36 |
37 | 38 |
39 |
47 |
49 |

Arda Kestane

52 |
53 | 54 |
55 |
63 |
65 |

Emre Dülek

68 |
69 | 70 |
71 | 72 |
73 |

Course - Team Name: CE216 - Team-8

76 | 77 |
78 |
86 |
88 |

Melih Can Aşık

91 |
92 | 93 |
94 |
102 |
104 |

Kutsal Baran Özkurt

107 |
108 | 109 | {%endblock%} 110 |
111 |
112 | -------------------------------------------------------------------------------- /tasks/templates/tasks/password_success.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} 2 | {% load static %} 3 | 4 | 5 | {% block main_content %} 6 | 7 |

Password changed successfully.

8 |

Password changed successfully. Please continue..

9 | 10 | {% endblock%} -------------------------------------------------------------------------------- /tasks/templates/tasks/profile.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} {% load static %} {% block breadcrumbs %} 2 | 3 | 4 |

12 | 13 | Settings 14 |

15 | 16 | {% endblock %} {% block left_content %} 17 | 138 | 139 | 140 | 141 |
142 |
143 |
144 | 145 |
146 | 147 |
148 |
Edit
149 |
150 |
151 | 152 |
153 |
154 |
155 | 193 |
194 | My Details 201 |
202 |
203 | Password 206 |
207 | 208 |
209 | Email 210 |
211 |
212 | 213 | 214 | 215 | 216 | 217 | {% endblock %} 218 | -------------------------------------------------------------------------------- /tasks/templates/tasks/profile_lecturer.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} {% load static %} {% block breadcrumbs %} 2 | 3 |

4 | Change Password 5 |

6 | 7 | {% endblock %} {% block main_content %} 8 | 13 |

14 | CHANGE YOUR PASSWORD 15 |

16 |
17 |
18 |
19 | {% csrf_token %} 20 | 21 | {{ form }} 22 | 23 | 24 | 33 | 34 |
  25 | 32 |
35 |
36 |
37 | 40 | 41 | {% endblock %} 42 | -------------------------------------------------------------------------------- /tasks/templates/tasks/task_create.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} 2 | {% load static %} 3 | 4 | 5 | {% block left_content %} 6 |

Task Information

7 |

This task will be assigned to you ({{ user.get_full_name }}), for the current milestone ({{ milestone }}) due {{ milestone.due }}.

8 |

The task will be in "Proposed" state once it is created. This is the state in which your team members can comment on the task. If they make requests to the task, either accept the requests, or give a reason to reject them. Once your team approves it, the task moves to the "Open" state, and you should be working on it.

9 | {% endblock %} 10 | 11 | {% block main_content %} 12 | 13 |

Create New Task

14 | 15 |
16 | {% csrf_token %} 17 | 18 | {{ form }} 19 | 20 | 21 | 22 |
 
23 |
24 | 25 | {% endblock%} 26 | 27 | {% block right_content %} 28 |

Help

29 |

Description: Make sure you provide a clear description of the task. Let your team understand the task, so that they can comment on it.

30 |

Priority: This should be "Planned" most of the time. "Urgent" is reserved for the tasks that are running late; for example, a bug has been found and you have to fix it immediately. "Low" is reserved for the tasks that were not required, but now that you have time you want to work on it.

31 |

Promised Date: This is the date you promise to complete your task; if it is not complete the day after this date, then the task will be rejected. Beware, once the due date for the milestone passes({{milestone.due}}), all tasks that are not complete are rejected.

32 | 33 | {% endblock %} -------------------------------------------------------------------------------- /tasks/templates/tasks/task_edit.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} 2 | {% load static %} 3 | 4 | 5 | {% block left_content %} 6 |

Task Information

7 |

You may edit the task

8 | {% endblock %} 9 | 10 | {% block main_content %} 11 | 12 |

Edit Task

13 | 14 |
15 | {% csrf_token %} 16 | 17 | {{ form }} 18 | 19 | 20 | 21 |
 
22 |
23 | 24 | {% endblock %} 25 | 26 | {% block right_content %} 27 |

Help

28 |

Description: Make sure you provide a clear description of the task. Let your team understand the task, so that they can comment on it.

29 |

Priority: This should be "Planned" most of the time. "Urgent" is reserved for the tasks that are running late; for example, a bug has been found and you have to fix it immediately. "Low" is reserved for the tasks that were not required, but now that you have time you want to work on it.

30 |

Promised Date: This is the date you promise to complete your task; if it is not complete the day after this date, then the task will be rejected. Beware, once the due date for the milestone passes({{milestone.due}}), all tasks that are not complete are rejected.

31 | 32 | {% endblock %} -------------------------------------------------------------------------------- /tasks/templates/tasks/task_view.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} 2 | {% load static %} 3 | 4 | 5 | {% block main_left_content %} 6 |
7 |
{{mastertask}}
8 |
9 |
Assigned to {{mastertask.owner}}
10 |
Due {{ task.promised_date }}
11 |

{{task.description|linebreaksbr}}

12 | {% if not mytask %} 13 |
14 |

You can like 15 | 16 | or dislike 17 | 18 | this task and what has been done with it. Your response will be private, and can be updated anytime.

19 | {% endif %} 20 | {% if mytask and mastertask.status == 2 %} 21 |
22 |
23 | The task is now open. As the owner, you are expected to complete the task until due date. Once completed, come back 24 | and mark it as completed. 25 |
26 |
27 | {% csrf_token %} 28 | 29 | 30 | 31 | 38 | 39 | 40 |
Task is completed. It was 32 | 37 |
41 |
42 | {% endif %} 43 | {% if mastertask.status == 1 and mytask %} 44 |
45 |
46 | You can your own tasks 47 | in the {{ mastertask.getStatus }} state. 48 |
49 | {% endif %} 50 | {% if mytask and reopen %} 51 |
52 |
53 | The task requires revision. Please check the comments to improve your work on this task. You can reject the requests or work on 54 | the task once again. In either case, use the comment section to Update the task. This will 55 | clear the votes, and let your team to re-evaluate the task and vote again. 56 |
57 | {% endif %} 58 |
59 | 125 |
126 | 127 |

 

128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | {% load tz %} 138 | 139 | {% for log in logs %} 140 | 141 | 142 | 143 | 144 | 145 | {% endfor %} 146 | 147 |
DateTask StatusLog Message
{{log.tarih|localtime}}{{log.taskstatus}}{{log.log}}
148 | 149 | 179 | 180 | {% endblock%} 181 | 182 | {% block main_right_content %} 183 |

Comments

184 |
185 | {% csrf_token %} 186 | 187 | {{ form }} 188 | 189 | 190 | 201 | 202 |
  191 | {% if mytask and reopen %} 192 | 193 | {% endif %} 194 | 195 | {% if voted == 0 and not mytask and mastertask.status < 4 and mastertask.status is not 2 %} 196 | 197 | 198 | {% endif %} 199 | 200 |
203 |
204 | 205 |
206 | {% for comment in comments %} 207 |
208 |
209 | {{ comment.owner.get_full_name }} 210 | {% if comment.approved %} approves.{% elif comment.approved == False %} requests changes.{% endif %} 211 |
212 |
213 |

{{comment.body|linebreaksbr}}

214 | {% if comment.file_url %} 215 | {{comment.file_url}} 216 | {% endif %} 217 |
218 | 219 |
220 | {% endfor %} 221 | {% endblock %} -------------------------------------------------------------------------------- /tasks/templates/tasks/team_create.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} {% load static %} {% block left_content %} 2 |

Help!

3 | Help text here... {% endblock %} {% block main_content %} 4 | 5 |

Create Teams for...
7 | {{ course }} 

9 | 10 |
11 | {% csrf_token %} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 32 | 33 |
Team size:
Student List:
 
34 |
35 | 36 | {% endblock%} {% block right_content %} 37 | 38 |

Manual Team Creation

39 |
40 | 41 |
42 | {% csrf_token %} 43 | 44 | 52 | 53 | 60 | 61 |
45 | 51 |
62 |
63 |

64 | 65 | 66 | {% for key, value in t_d.items %} {% for dev in value %} 67 | 68 | 69 | 70 | 71 | 72 | {% endfor %} {% endfor %} 73 |
{{ dev.getName }}    {{ key }}
74 | 75 | {% endblock %} 76 | -------------------------------------------------------------------------------- /tasks/templates/tasks/team_edit_std.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} 2 | {% load static %} 3 | 4 | {% block main_content %} 5 | 6 |

Edit Team Information

7 | 8 |
9 | {% csrf_token %} 10 | 11 | {{ form }} 12 | 13 | 14 | 15 |
 
16 |
17 | 18 | {% endblock %} 19 | 20 | -------------------------------------------------------------------------------- /tasks/templates/tasks/team_success.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} 2 | {% load static %} 3 | 4 | 5 | {% block left_content %} 6 | Back to lecturer view 7 | {% endblock %} 8 | 9 | {% block main_content %} 10 | 11 |

Successfully created teams for...
{{ course }} 

12 | 13 | 14 | {% for key, value in t_d.items %} 15 | 16 | 17 | 18 | {% for dev in value %} 19 | 20 | 21 | 22 | 23 | {% endfor %} 24 | {% endfor %} 25 |
{{ key }}
{{ dev.user.username }} {{ dev.getName }}
26 | 27 | {% endblock%} -------------------------------------------------------------------------------- /tasks/templates/tasks/updates.html: -------------------------------------------------------------------------------- 1 | {% extends "tasks/base.html" %} 2 | {% load static %} 3 | 4 | 5 | {% block main_content %} 6 | 7 |

About TPS

8 | 9 |

10 | TPS has been in use since 2017, and has been running on setps.ieu.edu.tr since 2018. Several people have contributed to 11 | both implementation and ideas. They are listed as part of the TPS team. 12 |

13 | 14 |

TPS Team

15 |
    16 |
  • Kaya Oğuz
  • 17 |
  • İlker Korkmaz
  • 18 |
  • Thanks to Arda Kestane, Emre Dülek, Umut Karakuyu for their contributions during summer 2022.
  • 19 |
  • Thanks to Oğuz Sabitay, Utku Işıl, Doruk Maltepe for their contributions during 2020.
  • 20 |
  • Thanks to Kasım Muratoğlu for his contributions during his MSc thesis, 2019 to 2021.
  • 21 |
  • Thanks to Mert Akkanat for including TPS in his thesis studies, 2022. 22 |
23 | 24 |

Related Publications

25 |
    26 |
  • MSc Thesis, Mert Akkanat (2022), "Application of Agile Software Development Practices in Software Engineering Education".
  • 27 |
  • MSc Thesis, Kasım Muratoğlu (2021), "Assessment of Team and Individual Contribution in Computer and Software Engineering Education".
  • 28 |
  • Oguz D and Oguz K (2019), "Perspectives on the Gap Between the Software Industry and the Software Engineering Education", IEEE Access. Vol. 7, pp. 117527-117543.
  • 29 |
  • Oğuz K and Gül S (2017), "Yazılım Mühendisliği Eğitiminde Takım Projelerinin Yönetimi ve Değerlendirilmesi", In Proceedings of the 11th Turkish National Software Engineering Symposium, Alanya, Turkey, October 18-20, 2017, pp. 184-195.
  • 30 |
31 | 32 |

Updates

33 |
2022.10.17
34 | Thanks to Arda Kestane, Emre Dülek and Umut Karakuyu, this version contains the following new features: 35 |
    36 |
  • Email notifications are now possible,
  • 37 |
  • Support for multiple courses for a student,
  • 38 |
  • A brand new profile screen,
  • 39 |
  • Support for profile photographs,
  • 40 |
  • Additional features for the "lecturer" side of the software.
  • 41 |
42 |
2021.11.22, Monday
43 |
    44 |
  • Lecturer view updates...
  • 45 |
46 |
Before 2021.11.22
47 |
    48 |
  • Logs for tasks
  • 49 |
  • Bug fixes
  • 50 |
51 | 52 | {% endblock %} -------------------------------------------------------------------------------- /tasks/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /tasks/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | 3 | from . import views 4 | 5 | urlpatterns = [ 6 | path('', views.index, name='index'), 7 | path('updates/', views.update_view, name='view_updates'), 8 | path('lecturer/', views.lecturer_view, name='lecturer_view'), 9 | path('lecturer/course//', views.lecturer_course_view, name='lecturer_view_course'), 10 | path('lecturer/team//', views.lecturer_team_view, name='lecturer_view_team'), 11 | path('lecturer/task//', views.lecturer_task_view, name='lecturer_view_task'), 12 | path('courses/create/', views.create_master_course, name='create_mastercourse'), 13 | path('courses//milestone/create/', views.lecturer_create_milestone, name='create_milestone'), 14 | path('courses/milestone//edit/', views.lecturer_edit_milestone, name='edit_milestone'), 15 | path('courses/milestone//grade/', views.lecturer_grade_milestone, name='grade_milestone'), 16 | path('team//', views.team_view, name='team_view'), 17 | path('team//edit/', views.edit_team, name='edit_team'), 18 | path('team/create//', views.create_team, name='create_team'), 19 | path('tasks//create/', views.create_task, name='create_task'), 20 | path('tasks//', views.view_task, name='view_task'), 21 | path('tasks//edit/', views.edit_task, name='edit_task'), 22 | path('tasks//complete/', views.complete_task, name='complete_task'), 23 | path('tasks//liked//', views.like_task, name='like_task'), 24 | path('accounts/login/', views.tpslogin, name='login'), 25 | path('accounts/logout/', views.tpslogout, name='logout'), 26 | path('accounts/profile/', views.profile, name='profile'), 27 | path('accounts/profile/my-details', views.my_details, name='my_details'), 28 | path('accounts/profile/change-password', views.change_password, name='change_password'), 29 | path('accounts/profile/teams', views.my_teams, name='teams'), 30 | path('accounts/profile/email', views.my_email, name='email'), 31 | path('accounts/profile/notifications', views.my_notifications, name='notifications') 32 | ] 33 | -------------------------------------------------------------------------------- /tasks/views.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from difflib import diff_bytes 3 | from doctest import master 4 | from re import T 5 | from tokenize import group 6 | from django.contrib.auth import authenticate, login, logout, update_session_auth_hash 7 | from django.contrib.auth.models import Group, User 8 | from django.contrib.auth.forms import PasswordChangeForm 9 | from django.http.response import HttpResponse 10 | from django.shortcuts import render, redirect, get_object_or_404 11 | from django.contrib.auth.decorators import login_required, permission_required 12 | from django.core.exceptions import ObjectDoesNotExist 13 | from django.core.mail import send_mail 14 | from django.template.loader import render_to_string 15 | from django.utils.html import strip_tags 16 | 17 | 18 | from tasks.models import * 19 | from .forms import CommentForm, CourseForm, MasterCourseForm, MilestoneForm, PhotoURLChangeForm, TaskForm, TeamFormStd, EmailChangeForm 20 | 21 | 22 | # Create your views here. 23 | 24 | def saveLog(mt: MasterTask, message, gizli: bool = False): 25 | l = MasterTaskLog() 26 | l.mastertask = mt 27 | l.taskstatus = mt.getStatus() 28 | l.log = message 29 | l.gizli = gizli 30 | l.save() 31 | 32 | @login_required 33 | def index(request): 34 | from datetime import date 35 | bugun = date.today() 36 | for mt in MasterTask.objects.all(): 37 | task = mt.get_task() 38 | if mt.milestone.due < bugun and mt.status < 4: 39 | mt.status = 4 40 | mt.save() 41 | saveLog(mt, "Task is rejected because milestone is due.") 42 | if task.promised_date < bugun and mt.status < 4: 43 | mt.status = 4 44 | mt.save() 45 | saveLog(mt, "Task is rejected because due date has passed.") 46 | 47 | # redirect to another page for lecturer! 48 | try: 49 | d: Developer = Developer.objects.get(user=request.user) 50 | return redirect('team_view', d.team.all()[0].pk) 51 | except ObjectDoesNotExist: 52 | try: 53 | l: Lecturer = Lecturer.objects.get(user=request.user) 54 | return redirect('lecturer_view') 55 | except ObjectDoesNotExist: 56 | return redirect('logout') 57 | 58 | 59 | def update_view(request): 60 | return render(request, 'tasks/updates.html') 61 | 62 | 63 | @login_required 64 | def team_view(request, team_id): 65 | d: Developer = Developer.objects.get(user=request.user) 66 | teams: Team([]) = d.team.all() 67 | t = Team.objects.get(pk=team_id) 68 | 69 | if t in teams: 70 | devs = Developer.objects.all().filter(team=t) 71 | # TODO 72 | # Milestone.objects.all().filter(course=t.course).order_by('due')[0] 73 | milestone = t.course.get_current_milestone() 74 | mt = MasterTask.objects.all().filter( 75 | team=t).order_by('pk').reverse()[:10] 76 | developers = dict() 77 | 78 | for d in devs : 79 | developers[d] = list() 80 | developers[d].append(d.get_project_grade(team_id)) 81 | developers[d].append(d.get_milestone_list(t.pk)) 82 | 83 | context = { 84 | 'page_title': 'Team Home', 85 | 'tasks': mt, 86 | 'team': t, 87 | 'devs': devs, 88 | 'milestone': milestone, 89 | 'teams': teams, 90 | 'developers': developers, 91 | } 92 | return render(request, 'tasks/index.html', context) 93 | else: 94 | return redirect('team_view', d.team.all()[0].pk) 95 | 96 | 97 | @login_required 98 | def edit_task(request, task_id): 99 | mt: MasterTask = get_object_or_404(MasterTask, pk=task_id) 100 | t: Task = Task.objects.all().filter( 101 | masterTask=mt).order_by('pk').reverse()[0] 102 | d: Developer = Developer.objects.get(user=request.user) 103 | tm = mt.team 104 | if mt.owner != d: # return to team view if the owner of the task is not this user 105 | return redirect('team_view', tm.pk) 106 | # return to team view if the master task is not 1 (proposed) 107 | if mt.status != 1: 108 | return redirect('team_view', tm.pk) 109 | if request.method == 'POST': 110 | form = TaskForm(request.POST) 111 | if form.is_valid(): 112 | task: Task = form.save(commit=False) 113 | task.pk = None 114 | task.masterTask = mt 115 | task.version = task.version + 1 116 | task.save() 117 | 118 | devs = Developer.objects.all().filter(team=tm) 119 | 120 | receivers = [] 121 | 122 | for developer in devs: 123 | if developer != d: 124 | receivers.append(developer.user.email) 125 | 126 | subject = 'TPS:Notification || A task has been edited!' 127 | contentList = [ 128 | 'Edited by: ' + str(mt.owner), 129 | 'Title: ' + task.title, 130 | 'Description: ' + task.description, 131 | 'Priortiy: ' + task.getPriority(), 132 | 'Due date: ' + str(task.promised_date) 133 | ] 134 | url = request._current_scheme_host + "/tasks/" + \ 135 | str(tm.pk) + str(task.masterTask_id) 136 | 137 | html_message = render_to_string('tasks/email_template.html', 138 | {'title': 'A task has been edited.', 'contentList': contentList, 'url': url, 'background_color': '#003399'}) 139 | 140 | plain_message = strip_tags(html_message) 141 | from_email = 'tps@izmirekonomi.edu.tr' 142 | 143 | saveLog(mt, "Task is edited by " + str(d) + ".") 144 | send_mail(subject, plain_message, from_email, receivers, html_message=html_message) 145 | 146 | 147 | return redirect('view_task', task_id) 148 | else: 149 | return redirect('team_view', tm.pk) 150 | else: 151 | form = TaskForm(instance=t) 152 | context = { 153 | 'page_title': 'Edit task', 154 | 'form': form, 155 | 'mastertask': mt, 156 | 'team': tm 157 | } 158 | return render(request, "tasks/task_edit.html", context) 159 | 160 | @login_required 161 | def create_task(request, team_id): 162 | d = Developer.objects.get(user=request.user) 163 | t:Team = Team.objects.get(pk=team_id) 164 | milestone = t.course.get_current_milestone() #Milestone.objects.all().filter(course=t.course).order_by('due')[0] 165 | if request.method == 'POST': 166 | form = TaskForm(request.POST) 167 | if form.is_valid(): 168 | mastertask = MasterTask() 169 | mastertask.milestone = milestone 170 | mastertask.owner = d 171 | mastertask.team = t 172 | mastertask.save() 173 | task:Task = form.save(commit=False) 174 | task.masterTask = mastertask 175 | task.save() 176 | mastertask.team.developer_set 177 | 178 | devs = Developer.objects.all().filter(team=t) 179 | 180 | receivers = [] 181 | 182 | for developer in devs: 183 | if developer != d: 184 | receivers.append(developer.user.email) 185 | 186 | contentList = [ 187 | 'Creator: ' + str(mastertask.owner), 188 | 'Title: ' + task.title, 189 | 'Description: ' + task.description, 190 | 'Priority: ' + task.getPriority(), 191 | 'Due date: ' + str(task.promised_date) 192 | ] 193 | 194 | subject = 'TPS:Notification || A task has been created' 195 | 196 | url = request._current_scheme_host + "/tasks/" + str(task.masterTask_id) 197 | 198 | html_message = render_to_string('tasks/email_template.html', 199 | {'title':'A task has been created!', 'contentList':contentList, 'url': url, 'background_color': '#003399'}) 200 | 201 | plain_message = strip_tags(html_message) 202 | from_email = 'tps@izmirekonomi.edu.tr' 203 | 204 | saveLog(mastertask, "Task is created by " + str(d) + ".") 205 | send_mail(subject, plain_message, from_email, receivers, html_message=html_message) 206 | 207 | 208 | return redirect('team_view', team_id) 209 | else: 210 | context={'page_title': 'Create New Task', 'form': form, 'milestone': milestone} 211 | return render(request, "tasks/task_create.html", context) 212 | # return redirect('team_view') 213 | else: 214 | form = TaskForm() 215 | context = { 216 | 'page_title': 'Create New Task', 217 | 'form': form, 218 | 'milestone': milestone, 219 | 'team': t 220 | } 221 | return render(request, "tasks/task_create.html", context) 222 | 223 | @login_required 224 | def complete_task(request, task_id): 225 | mt:MasterTask = get_object_or_404(MasterTask, pk=task_id) 226 | t:Task = Task.objects.all().filter(masterTask=mt).order_by('pk').reverse()[0] 227 | d:Developer = Developer.objects.get(user=request.user) 228 | tm = mt.team 229 | if mt.owner != d: 230 | return redirect('team_view', tm.pk) 231 | if request.method == 'POST': 232 | mt:MasterTask = get_object_or_404(MasterTask, pk=task_id) 233 | t:Task = Task.objects.all().filter(masterTask=mt).order_by('pk').reverse()[0] 234 | mt.status = 3 235 | mt.difficulty = int(request.POST["difficulty"]) 236 | mt.completed = datetime.now() 237 | mt.save() 238 | 239 | difficulty = str 240 | if mt.difficulty == 1: 241 | difficulty = 'Easy' 242 | elif mt.difficulty == 2: 243 | difficulty = 'Normal' 244 | elif mt.difficulty == 3: 245 | difficulty = 'Difficult' 246 | 247 | devs = Developer.objects.all().filter(team=tm) 248 | 249 | receivers = [] 250 | 251 | for developer in devs: 252 | if developer != d: 253 | receivers.append(developer.user.email) 254 | 255 | subject = 'TPS:Notification || A task has been completed' 256 | 257 | contentList = [ 258 | 'Creator: ' + str(mt.owner), 259 | 'Title: ' + t.title, 260 | 'Description: ' + t.description, 261 | 'Priortiy: ' + t.getPriority(), 262 | 'Difficulty: ' + difficulty, 263 | 'Due date: '+ str(t.promised_date) 264 | ] 265 | 266 | url = request._current_scheme_host + "/tasks/" + str(t.masterTask_id) 267 | 268 | html_message = render_to_string('tasks/email_template.html', 269 | {'title':'A task has been completed!', 'contentList': contentList, 'url':url, 'background_color': '#003399'}) 270 | 271 | plain_message = strip_tags(html_message) 272 | from_email = 'tps@izmirekonomi.edu.tr' 273 | 274 | saveLog(mt, "Task is completed by " + str(d) + ".") 275 | send_mail(subject, plain_message, from_email, receivers, html_message=html_message) 276 | 277 | 278 | context = { 279 | 'team': tm 280 | } 281 | 282 | return redirect('view_task', task_id) 283 | else: 284 | return redirect('team_view', tm.pk) 285 | 286 | @login_required 287 | def edit_team(request, team_id): 288 | d:Developer = Developer.objects.get(user=request.user) 289 | t:Team = Team.objects.get(pk=team_id) 290 | print(t.name, t.github) 291 | if request.method == 'POST': 292 | form = TeamFormStd(request.POST) 293 | if form.is_valid(): 294 | tnew = form.save(commit=False) 295 | tnew.pk = t.pk 296 | tnew.supervisor = t.supervisor 297 | tnew.course = t.course 298 | tnew.save() 299 | return redirect('team_view', team_id) 300 | else: 301 | form = TeamFormStd(instance=t) 302 | context = { 303 | 'page_title': 'Edit Team Information', 304 | 'form': form, 305 | 'team': t 306 | } 307 | return render(request, "tasks/team_edit_std.html", context) 308 | 309 | 310 | @login_required 311 | def like_task(request,task_id, liked): 312 | mt:MasterTask = get_object_or_404(MasterTask, pk=task_id) 313 | d:Developer = Developer.objects.get(user=request.user) 314 | 315 | if mt.owner == d: 316 | return redirect('team_view', mt.team.pk) 317 | try: 318 | # if like object exists, toggle like 319 | like = Like.objects.get(owner=d, mastertask=mt) 320 | if liked == 1 and like.liked: 321 | like.delete() 322 | saveLog(mt, "Like removed by "+ str(d) + ".", True) 323 | elif liked == 0 and not like.liked: 324 | like.delete() 325 | saveLog(mt, "Dislike removed by "+ str(d) + ".", True) 326 | elif liked == 1 and not like.liked: 327 | like.liked = True 328 | like.save() 329 | saveLog(mt, "Task liked by "+ str(d) + ".", True) 330 | elif liked == 0 and like.liked: 331 | like.liked = False 332 | like.save() 333 | saveLog(mt, "Task disliked by "+ str(d) + ".", True) 334 | except ObjectDoesNotExist: 335 | like = Like() 336 | like.owner = d 337 | like.mastertask = mt 338 | if liked == 1: 339 | like.liked = True 340 | saveLog(mt, "Task liked by "+ str(d) + ".", True) 341 | else: 342 | like.liked = False 343 | saveLog(mt, "Task disliked by "+ str(d) + ".", True) 344 | like.save() 345 | return redirect('view_task', task_id) 346 | 347 | 348 | 349 | @login_required 350 | def view_task(request, task_id): 351 | mt:MasterTask = get_object_or_404(MasterTask, pk=task_id) 352 | t:Task = Task.objects.all().filter(masterTask=mt).order_by('pk').reverse()[0] 353 | d:Developer = Developer.objects.get(user=request.user) 354 | 355 | if mt.team in d.team.all(): 356 | tm = mt.team 357 | task_owner: Developer = mt.owner 358 | if mt.team != tm: 359 | return redirect('team_view', tm.pk) 360 | if request.method == 'POST': 361 | form = CommentForm(request.POST) 362 | if form.is_valid(): 363 | comment:Comment = form.save(commit=False) 364 | comment.owner = request.user 365 | comment.mastertask = mt 366 | comment.task = t 367 | if mt.owner == d and mt.status == 3 and request.POST['approve'] == "Update": 368 | Vote.objects.all().filter(task=t).filter(status=mt.status).delete() 369 | saveLog(mt, "Task is updated by"+ str(d) + ".") 370 | if len(Vote.objects.all().filter(task=t).filter(status=mt.status).filter(owner=d)) == 0: 371 | if request.POST['approve'] == "Yes": 372 | comment.approved = True 373 | vote = Vote() 374 | vote.owner = d 375 | vote.task = t 376 | vote.status = mt.status 377 | vote.vote = True 378 | vote.save() 379 | 380 | subject = 'TPS:Notification || The task you created has received an approve vote.' 381 | contentList = [ 382 | 'Your task called ' + t.title + ' has received an aprove vote.', 383 | 'Approver: ' + str(d), 384 | str(d) + '\'s comment: ' + comment.body, 385 | 'Priority: ' + t.getPriority(), 386 | 'Due date: ' + str(t.promised_date) 387 | ] 388 | 389 | url = request._current_scheme_host + "/tasks/" + str(t.masterTask_id) 390 | html_message = render_to_string('tasks/email_template.html', 391 | {'title': 'A task has received an approve vote!', 'contentList': contentList, 'url': url, 'background_color': '#5cb85c'}) 392 | 393 | plain_message = strip_tags(html_message) 394 | from_email = 'tps@izmirekonomi.edu.tr' 395 | saveLog(mt, "Task received an approve vote by "+ str(d) + ".") 396 | comment.save() 397 | send_mail(subject, plain_message, from_email, [task_owner.user.email], html_message=html_message) 398 | 399 | elif request.POST['approve'] == "No": 400 | comment.approved = False 401 | vote = Vote() 402 | vote.owner = d 403 | vote.task = t 404 | vote.status = mt.status 405 | vote.vote = False 406 | vote.save() 407 | 408 | subject = 'TPS:Notification || The task you created has received a revision request.' 409 | contentList = [ 410 | 'Your task called ' + t.title + ' has received a revision request.', 411 | 'Requested by: ' + str(d), 412 | str(d) + '\'s comment: ' + comment.body, 413 | 'Priority: ' + t.getPriority(), 414 | 'Due date: ' + str(t.promised_date) 415 | ] 416 | url = request._current_scheme_host + "/tasks/" + str(t.masterTask_id) 417 | html_message = render_to_string('tasks/email_template.html', 418 | {'title':'A task has received a revision request.', 'contentList': contentList, 'url':url, 'background_color': '#ff2400'}) 419 | 420 | plain_message = strip_tags(html_message) 421 | from_email = 'tps@izmirekonomi.edu.tr' 422 | 423 | saveLog(mt, "Task received a revision request by "+ str(d) + ".") 424 | comment.save() 425 | send_mail(subject, plain_message, from_email, [task_owner.user.email], html_message=html_message) 426 | comment.save() 427 | return redirect('view_task', task_id) 428 | 429 | form = CommentForm() 430 | comments = Comment.objects.all().filter(mastertask=mt).order_by('date').reverse() 431 | voted = len(Vote.objects.all().filter(task=t).filter(status=mt.status).filter(owner=d)) 432 | v_app = len(Vote.objects.all().filter(task=t).filter(status=mt.status).filter(vote=True)) 433 | v_den = len(Vote.objects.all().filter(task=t).filter(status=mt.status).filter(vote=False)) 434 | reopen = False 435 | if mt.status == 1 and v_app > (len(mt.team.developer_set.all()) - 1) / 2: 436 | mt.status = 2 437 | mt.opened = datetime.now() 438 | mt.save() 439 | 440 | subject = 'TPS:Notification || The task you created is now in open state.' 441 | 442 | contentList = [ 443 | 'Your task called ' + t.title + ' is now in open state.', 444 | 'Description: ' + t.description, 445 | 'Priority: ' + t.getPriority(), 446 | 'Due date: ' + str(t.promised_date) 447 | ] 448 | 449 | url = request._current_scheme_host + "/tasks/" + str(t.masterTask_id) 450 | 451 | html_message = render_to_string('tasks/email_template.html', 452 | {'title':'Your task is now in open state!','contentList': contentList, 'url':url, 'background_color': '#003399'}) 453 | 454 | plain_message = strip_tags(html_message) 455 | from_email = 'tps@izmirekonomi.edu.tr' 456 | 457 | saveLog(mt, "All approved. Task is now in open state.") 458 | send_mail(subject, plain_message, from_email, [task_owner.user.email], html_message=html_message) 459 | 460 | elif mt.status == 3 and v_app > (len(mt.team.developer_set.all()) - 1) / 2: 461 | mt.status = 5 462 | mt.save() 463 | 464 | subject = 'TPS:Notification || The task you created is now accepted.' 465 | url = request._current_scheme_host + "/tasks/" + str(t.masterTask_id) 466 | 467 | html_message = render_to_string('tasks/email_template.html', 468 | {'title':'Your task is accepted!', 'contentList': ['Your task called ' + t.title + ' is now accepted.'],'url':url, 'background_color': '#003399' }) 469 | 470 | plain_message = strip_tags(html_message) 471 | from_email = 'tps@izmirekonomi.edu.tr' 472 | 473 | saveLog(mt, "All approved. Task is now accepted!") 474 | send_mail(subject, plain_message, from_email, [task_owner.user.email], html_message=html_message) 475 | 476 | elif mt.status == 3 and v_den >= (len(mt.team.developer_set.all()) - 1) / 2: 477 | reopen = True 478 | 479 | try: 480 | liked = Like.objects.get(owner = d, mastertask = mt).liked 481 | except ObjectDoesNotExist: 482 | liked = None 483 | 484 | logs = MasterTaskLog.objects.all().filter(mastertask=mt).filter(gizli=False).order_by('tarih').reverse() 485 | 486 | context = { 487 | 'page_title': 'View Task', 488 | 'mastertask': mt, 489 | 'task': t, 490 | 'tp': mt.difficulty * t.priority, 491 | 'form': form, 492 | 'voted': voted, 493 | 'mytask': mt.owner == d, 494 | 'v_app': v_app, 495 | 'v_den': v_den, 496 | 'reopen': reopen, 497 | 'liked': liked, 498 | 'comments': comments, 499 | 'logs' : logs 500 | } 501 | return render(request, "tasks/task_view.html", context) 502 | else : 503 | return redirect('team_view', d.team.all()[0].pk) 504 | 505 | 506 | @login_required 507 | @permission_required('tasks.add_developer') # students don't have the right to do so... 508 | def lecturer_view(request): 509 | l:Lecturer = Lecturer.objects.get(user=request.user) 510 | mcourses = MasterCourse.objects.all() 511 | courses = Course.objects.all().filter(lecturer = l).order_by('pk').reverse() 512 | context = { 513 | 'page_title': 'Home', 514 | 'courses': courses, 515 | 'mcourses': mcourses 516 | } 517 | return render(request, 'tasks/lecturer_index.html', context) 518 | 519 | def tpslogin(request): 520 | if request.method == 'POST': 521 | userid = request.POST['universityid'] 522 | pwd = request.POST['tpspass'] 523 | 524 | user = authenticate(request, username=userid, password=pwd) 525 | if user is not None: 526 | login(request, user) 527 | return redirect('index') 528 | else: 529 | context = { 530 | 'page_title': 'Login', 531 | 'login_error': 'Login failed. Please contact Kaya Oğuz (kaya.oguz@ieu.edu.tr) if you are experiencing problems logging in.' 532 | } 533 | return render(request, 'tasks/login.html', context) 534 | else: 535 | context = { 536 | 'page_title': 'Login' 537 | } 538 | return render(request, 'tasks/login.html', context) 539 | 540 | def tpslogout(request): 541 | logout(request) 542 | return redirect('index') 543 | 544 | @login_required 545 | def profile (request): 546 | return render(request, 'tasks/profile.html', {'page_title': 'Profile'}) 547 | 548 | 549 | @login_required 550 | def my_details (request): 551 | u = request.user 552 | try: 553 | d: Developer = Developer.objects.get(user=u) 554 | if request.method == 'POST': 555 | form = PhotoURLChangeForm(request.POST) 556 | if form.is_valid(): 557 | dnew = form.save(commit=False) 558 | dnew.pk = d.pk 559 | dnew.user = d.user 560 | dnew.save() 561 | return render(request, 'tasks/my_details.html', {'page_title': 'My Details', 'dev': dnew, 'form': form }) 562 | else: 563 | return render(request, 'tasks/my_details.html', {'page_title': 'My Details', 'dev': d, 'form': form }) 564 | else: 565 | form = PhotoURLChangeForm(instance = u, initial={"photoURL": d.photoURL}) 566 | return render(request, 'tasks/my_details.html', {'page_title': 'My Details', 'dev': d, 'form': form }) 567 | except ObjectDoesNotExist: 568 | if request.method == 'POST': 569 | form = PasswordChangeForm(request.user, data=request.POST) 570 | if form.is_valid(): 571 | form.save() 572 | update_session_auth_hash(request, form.user) 573 | return render(request, 'tasks/password_success.html', { 574 | 'page_title': 'Password changed.' 575 | }) 576 | else: 577 | form = PasswordChangeForm(request.user) 578 | return render(request, 'tasks/profile_lecturer.html', {'form': form}) 579 | 580 | 581 | @login_required 582 | def change_password(request): 583 | u = request.user 584 | d: Developer = Developer.objects.get(user=u) 585 | if request.method == 'POST': 586 | form = PasswordChangeForm(request.user, data=request.POST) 587 | if form.is_valid(): 588 | form.save() 589 | update_session_auth_hash(request, form.user) 590 | return render(request, 'tasks/password_success.html', { 591 | 'page_title': 'Password changed.' 592 | }) 593 | else: 594 | return render( 595 | request, 596 | 'tasks/change_password.html', 597 | { 598 | 'page_title': 'Change Password', 599 | 'form': form, 600 | 'pass_error': 'Failed. Password not changed.', 601 | } 602 | ) 603 | else: 604 | form = PasswordChangeForm(request.user) 605 | return render(request, 'tasks/change_password.html', {'page_title': 'Change Password', 'form': form, 'dev':d}) 606 | 607 | 608 | @login_required 609 | def my_teams (request): 610 | return render(request, 'tasks/my_teams.html', {'page_title': 'My Details' }) 611 | 612 | @login_required 613 | def my_email (request): 614 | u = request.user 615 | d: Developer = Developer.objects.get(user=u) 616 | if request.method == 'POST': 617 | form = EmailChangeForm(request.POST) 618 | if form.is_valid(): 619 | unew = form.save(commit=False) 620 | unew.pk = u.pk 621 | unew.first_name = u.first_name 622 | unew.last_name = u.last_name 623 | unew.username = u.username 624 | unew.password = u.password 625 | unew.save() 626 | return render(request, 'tasks/my_email.html', { 'user': u, 'form': form, 'dev': d }) 627 | else: 628 | form = EmailChangeForm(instance = u) 629 | return render(request, 'tasks/my_email.html', {'user': u, 'form': form, 'dev': d}) 630 | 631 | 632 | @login_required 633 | def my_notifications (request): 634 | return render(request, 'tasks/my_notifications.html', {'page_title': 'My Details' }) 635 | 636 | @login_required 637 | @permission_required('tasks.add_mastercourse') 638 | def create_master_course(request): 639 | if request.method == 'POST': 640 | form = MasterCourseForm(request.POST) 641 | form_details = CourseForm(request.POST) 642 | if form.is_valid() and form_details.is_valid(): 643 | mastercourse = form.save() 644 | course:Course = form_details.save(commit=False) 645 | course.masterCourse = mastercourse 646 | course.lecturer = Lecturer.objects.get(user=request.user) 647 | course.save() 648 | return redirect('lecturer_view') 649 | else: 650 | form = MasterCourseForm() 651 | form_details = CourseForm() 652 | 653 | return render(request, 'tasks/mastercourse_create.html', { 654 | 'page_title': 'Create New Master Course', 655 | 'form': form, 656 | 'form_details': form_details 657 | }) 658 | 659 | @login_required 660 | @permission_required('tasks.add_team') 661 | @permission_required('tasks.add_developer') 662 | def create_team(request, course_id): 663 | c = Course.objects.get(pk = course_id) 664 | lecturer = Lecturer.objects.get(user = request.user) 665 | teams: Team([]) = Team.objects.all().filter(course = c) 666 | 667 | team_names = [] 668 | for t in teams: 669 | team_names.append(t.name) 670 | 671 | team_no = len(teams) + 1 672 | 673 | if request.method == 'POST': 674 | stdlist = request.POST["stdlist"].split('\r\n') 675 | 676 | devs = [] 677 | for std in stdlist: 678 | fields = std.split('\t') 679 | uniId = fields[1].strip() 680 | fullname = fields[2].strip() + " " + fields[3].strip() 681 | u:User = User.objects.filter(username = uniId) 682 | if not u.exists(): 683 | us = User.objects.create_user(uniId, None, uniId) 684 | us.first_name = fields[2].strip() 685 | us.last_name = fields[3].strip() 686 | group = Group.objects.get(name="student") 687 | us.groups.add(group) 688 | us.save() 689 | d = Developer() 690 | d.user = us 691 | d.save() 692 | 693 | u:User = User(User.objects.get(username = uniId)) 694 | dev: Developer = Developer.objects.get(user = u.pk) 695 | 696 | t:Team = dev.team.all().filter(course = c) 697 | if t.exists(): 698 | continue 699 | else: 700 | devs.append(dev) 701 | 702 | if 'auto' in request.POST: 703 | from random import shuffle 704 | shuffle(devs) 705 | 706 | team_size = int(request.POST["team_size"]) 707 | team_std_count = 0 708 | 709 | for d in devs: 710 | team_name = "Team" + " " + str(team_no) 711 | if team_name not in team_names: 712 | t = Team() 713 | team_std_count = 0 714 | t.course = c 715 | t.name = team_name 716 | t.github = "ENTER YOUT GIT REP ADDRESS HERE" 717 | t.supervisor = lecturer 718 | t.save() 719 | team_names.append(team_name) 720 | 721 | team_std_count += 1 722 | if team_std_count == team_size: 723 | team_no+=1 724 | t: Team = Team.objects.all().get(name = team_name, course = c) 725 | d.team.add(t) 726 | d.save() 727 | 728 | teams: Team([]) = Team.objects.all().filter(course = c) 729 | 730 | t_d = {} 731 | for t in teams: 732 | devs: Developer([]) = list(Developer.objects.all().filter(team = t)) 733 | t_d[t.name] = [] 734 | for d in devs: 735 | t_d[t.name].append(d) 736 | 737 | return render(request, 'tasks/team_success.html', { 738 | 'page_title': 'Results', 739 | 't_d': t_d, 740 | }) 741 | 742 | elif 'manuel' in request.POST: 743 | if devs: 744 | team_name = "Team" + " " + str(team_no) 745 | t = Team() 746 | t.course = c 747 | t.name = team_name 748 | t.github = "ENTER YOUT GIT REP ADDRESS HERE" 749 | t.supervisor = lecturer 750 | t.save() 751 | for d in devs: 752 | team: Team = Team.objects.all().get(name = team_name, course = c) 753 | d.team.add(team) 754 | d.save() 755 | team_no+=1 756 | 757 | teams: Team([]) = Team.objects.all().filter(course = c) 758 | t_d = {} 759 | for t in teams: 760 | devs: Developer([]) = list(Developer.objects.all().filter(team = t)) 761 | t_d[t.name] = [] 762 | for d in devs: 763 | t_d[t.name].append(d) 764 | 765 | return render(request, 'tasks/team_create.html', { 766 | 'page_title': 'Create Teams', 767 | 'course': c, 768 | 'team_no': team_no, 769 | 't_d': t_d 770 | }) 771 | else: 772 | teams: Team([]) = Team.objects.all().filter(course = c) 773 | t_d = {} 774 | for t in teams: 775 | devs: Developer([]) = list(Developer.objects.all().filter(team = t)) 776 | t_d[t.name] = [] 777 | for d in devs: 778 | t_d[t.name].append(d) 779 | return render(request, 'tasks/team_create.html', { 780 | 'page_title': 'Create Teams', 781 | 'course': c, 782 | 'team_no': team_no, 783 | 't_d': t_d 784 | }) 785 | 786 | @login_required 787 | @permission_required('tasks.add_team') 788 | def lecturer_course_view(request, course_id): 789 | course = Course.objects.get(pk=course_id) 790 | milestones = course.milestone_set.all() 791 | teams = course.team_set.all() 792 | tasks = list() 793 | for team in teams: 794 | for task in team.mastertask_set.all().order_by('pk').reverse(): 795 | tasks.append(task) 796 | context = { 797 | 'page_title': 'Lecturer Course View', 798 | 'course': course, 799 | 'teams': teams, 800 | 'milestones': milestones, 801 | 'tasks': tasks 802 | } 803 | 804 | return render(request, 'tasks/lecturer_course_view.html', context) 805 | 806 | @login_required 807 | @permission_required('tasks.add_team') 808 | def lecturer_team_view(request, team_id): 809 | team = Team.objects.get(pk=team_id) 810 | devs = team.developer_set.all() 811 | developers = dict() 812 | 813 | for d in devs : 814 | developers[d] = list() 815 | developers[d].append(d.get_project_grade(team_id)) 816 | developers[d].append(d.get_milestone_list(team.pk)) 817 | 818 | tasks = team.mastertask_set.all().order_by('pk').reverse() 819 | context = { 820 | 'page_title': 'Lecturer Team View', 821 | 'team': team, 822 | 'course': team.course, 823 | 'devs': devs, 824 | 'tasks': tasks, 825 | 'developers' : developers 826 | } 827 | 828 | return render(request, 'tasks/lecturer_team_view.html', context) 829 | 830 | 831 | @login_required 832 | @permission_required('tasks.add_milestone') 833 | def lecturer_create_milestone(request, course_id): 834 | course = Course.objects.get(pk=course_id) 835 | if request.method == 'POST': 836 | form = MilestoneForm(request.POST) 837 | if form.is_valid(): 838 | milestone:Milestone = form.save(commit=False) 839 | milestone.course = course 840 | milestone.save() 841 | return redirect('lecturer_view_course', course_id) 842 | form = MilestoneForm 843 | context = { 844 | 'page_title': 'Create New Milestone', 845 | 'course': course, 846 | 'form': form 847 | } 848 | return render(request, "tasks/milestone_create.html", context) 849 | 850 | @login_required 851 | @permission_required('tasks.add_milestone') 852 | def lecturer_grade_milestone(request, milestone_id): 853 | milestone:Milestone = Milestone.objects.get(pk=milestone_id) 854 | course:Course = milestone.course 855 | teams = course.team_set.all() 856 | if request.method == 'POST': 857 | for team in teams: 858 | # print(team.name + '->' + request.POST['grade['+ str(team.pk) +']']) 859 | q:TeamMilestoneGrade = TeamMilestoneGrade.objects.all().filter(team=team).filter(milestone=milestone) 860 | if len(q) == 0: 861 | tp:TeamMilestoneGrade = TeamMilestoneGrade() 862 | tp.milestone = milestone 863 | tp.team = team 864 | tp.grade = request.POST['grade[' + str(team.pk) + ']'] 865 | tp.save() 866 | else: 867 | q[0].grade = request.POST['grade[' + str(team.pk) + ']'] 868 | q[0].save() 869 | return redirect('lecturer_view_course', course.pk) 870 | grades = dict() 871 | for team in teams: 872 | q:TeamMilestoneGrade = TeamMilestoneGrade.objects.all().filter(team=team).filter(milestone=milestone) 873 | if len(q) == 0: 874 | grades[team.name] = [team.pk, 0] 875 | else: 876 | grades[team.name] = [team.pk, q[0].grade] 877 | context = { 878 | 'page_title': 'Update Grades', 879 | 'milestone': milestone, 880 | 'course': course, 881 | 'teams': teams, 882 | 'grades': grades 883 | } 884 | return render(request, "tasks/milestone_grade.html", context) 885 | 886 | @login_required 887 | @permission_required('tasks.add_milestone') 888 | def lecturer_edit_milestone(request, milestone_id): 889 | milestone:Milestone = Milestone.objects.get(pk=milestone_id) 890 | if request.method == 'POST': 891 | form = MilestoneForm(request.POST) 892 | if form.is_valid(): 893 | mform:Milestone = form.save(commit=False) 894 | mform.course = milestone.course 895 | mform.pk = milestone.pk 896 | mform.save() 897 | return redirect('lecturer_view_course', mform.course.pk) 898 | form = MilestoneForm(instance=milestone) 899 | context = { 900 | 'page_title': 'Edit Milestone', 901 | 'milestone': milestone, 902 | 'form': form 903 | } 904 | return render(request, "tasks/milestone_edit.html", context) 905 | 906 | 907 | @login_required 908 | @permission_required('tasks.add_team') 909 | def lecturer_task_view(request, task_id): 910 | mt:MasterTask = MasterTask.objects.get(pk=task_id) 911 | t:Task = Task.objects.all().filter(masterTask=mt).order_by('pk').reverse()[0] 912 | course = mt.team.course 913 | 914 | if request.method == 'POST': 915 | form = CommentForm(request.POST) 916 | if form.is_valid(): 917 | comment:Comment = form.save(commit=False) 918 | comment.owner = request.user 919 | comment.mastertask = mt 920 | comment.task = t 921 | comment.save() 922 | return redirect('lecturer_view_task', task_id) 923 | form = CommentForm() 924 | comments = Comment.objects.all().filter(mastertask=mt).order_by('date').reverse() 925 | v_app = len(Vote.objects.all().filter(task=t).filter(status=mt.status).filter(vote=True)) 926 | v_den = len(Vote.objects.all().filter(task=t).filter(status=mt.status).filter(vote=False)) 927 | if mt.status == 1 and v_app > len(mt.team.developer_set.all())/2 : 928 | mt.status = 2 929 | mt.save() 930 | elif mt.status == 3 and v_app > len(mt.team.developer_set.all())/2 : 931 | mt.status = 5 932 | mt.save() 933 | 934 | logs = MasterTaskLog.objects.all().filter(mastertask=mt).order_by('tarih').reverse() 935 | 936 | context = { 937 | 'page_title': 'Lecturer Task View', 938 | 'mastertask': mt, 939 | 'task': t, 940 | 'tp': mt.difficulty * t.priority, 941 | 'form': form, 942 | 'v_app': v_app, 943 | 'v_den': v_den, 944 | 'comments': comments, 945 | 'course': course, 946 | 'logs': logs 947 | } 948 | return render(request, "tasks/lecturer_task_view.html", context) 949 | -------------------------------------------------------------------------------- /tps/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koguz/TaskPointSystem/1996f577e98035fd50df66c72e6a487f333d0b2e/tps/__init__.py -------------------------------------------------------------------------------- /tps/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for tps project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tps.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /tps/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for tps project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.2.6. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.2/ref/settings/ 11 | """ 12 | 13 | from pathlib import Path 14 | from re import T 15 | 16 | # Build paths inside the project like this: BASE_DIR / 'subdir'. 17 | BASE_DIR = Path(__file__).resolve().parent.parent 18 | 19 | 20 | # Quick-start development settings - unsuitable for production 21 | # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ 22 | 23 | # SECURITY WARNING: keep the secret key used in production secret! 24 | SECRET_KEY = 'django-insecure-z-t^6m!qh8=lbw6la(sdvy!#wmeausu_5w&h-x1rq(6u8yup3q' 25 | 26 | # SECURITY WARNING: don't run with debug turned on in production! 27 | DEBUG = True 28 | 29 | ALLOWED_HOSTS = [] 30 | 31 | 32 | # Application definition 33 | 34 | INSTALLED_APPS = [ 35 | 'tasks.apps.TasksConfig', 36 | 'django.contrib.admin', 37 | 'django.contrib.auth', 38 | 'django.contrib.contenttypes', 39 | 'django.contrib.sessions', 40 | 'django.contrib.messages', 41 | 'django.contrib.staticfiles', 42 | ] 43 | 44 | 45 | MIDDLEWARE = [ 46 | 'django.middleware.security.SecurityMiddleware', 47 | 'django.contrib.sessions.middleware.SessionMiddleware', 48 | 'django.middleware.common.CommonMiddleware', 49 | 'django.middleware.csrf.CsrfViewMiddleware', 50 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 51 | 'django.contrib.messages.middleware.MessageMiddleware', 52 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 53 | ] 54 | 55 | ROOT_URLCONF = 'tps.urls' 56 | 57 | TEMPLATES = [ 58 | { 59 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 60 | 'DIRS': [], 61 | 'APP_DIRS': True, 62 | 'OPTIONS': { 63 | 'context_processors': [ 64 | 'django.template.context_processors.debug', 65 | 'django.template.context_processors.request', 66 | 'django.contrib.auth.context_processors.auth', 67 | 'django.contrib.messages.context_processors.messages', 68 | ], 69 | }, 70 | }, 71 | ] 72 | 73 | WSGI_APPLICATION = 'tps.wsgi.application' 74 | 75 | 76 | # Database 77 | # https://docs.djangoproject.com/en/3.2/ref/settings/#databases 78 | 79 | DATABASES = { 80 | 'default': { 81 | 'ENGINE': 'django.db.backends.sqlite3', 82 | 'NAME': BASE_DIR / 'db.sqlite3', 83 | } 84 | } 85 | 86 | 87 | # Password validation 88 | # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators 89 | 90 | AUTH_PASSWORD_VALIDATORS = [ 91 | { 92 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 93 | }, 94 | { 95 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 96 | }, 97 | { 98 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 99 | }, 100 | { 101 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 102 | }, 103 | ] 104 | 105 | 106 | # Internationalization 107 | # https://docs.djangoproject.com/en/3.2/topics/i18n/ 108 | 109 | LANGUAGE_CODE = 'en-us' 110 | 111 | TIME_ZONE = 'Europe/Istanbul' 112 | 113 | USE_I18N = True 114 | 115 | USE_L10N = True 116 | 117 | USE_TZ = True 118 | 119 | 120 | # Static files (CSS, JavaScript, Images) 121 | # https://docs.djangoproject.com/en/3.2/howto/static-files/ 122 | 123 | STATIC_URL = '/static/' 124 | 125 | # Default primary key field type 126 | # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field 127 | 128 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' 129 | 130 | 131 | EMAIL_HOST = 'rd-merlin.panel-giris.com' 132 | EMAIL_PORT = 465 133 | EMAIL_HOST_USER = 'no-reply@tps.info.tr' 134 | EMAIL_HOST_PASSWORD = 'fGPhcCy&OS)w?;Gp' 135 | EMAIL_USE_TLS = False 136 | EMAIL_USE_SSL = True -------------------------------------------------------------------------------- /tps/urls.py: -------------------------------------------------------------------------------- 1 | """tps URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.2/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import include, path 18 | 19 | urlpatterns = [ 20 | path('', include('tasks.urls')), 21 | path('admin/', admin.site.urls), 22 | #path('accounts/', include('django.contrib.auth.urls')), 23 | ] 24 | -------------------------------------------------------------------------------- /tps/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for tps project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tps.settings') 15 | 16 | application = get_wsgi_application() 17 | --------------------------------------------------------------------------------