| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <meta http-equiv="X-UA-Compatible" content="ie=edge" />
- <link href="https://rsms.me/inter/inter.css" rel="stylesheet" />
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.full.js"></script>
- <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.css" rel="stylesheet" />
- <link href="/2u/style" rel="stylesheet"/>
- <title>Module 12 SQL Challenge Rubric</title>
- <style>
- *,
- *::before,
- *::after {
- box-sizing: border-box;
- }
- html,
- body {
- margin: 0;
- padding: 0;
- line-height: 1.15;
- font-size: 100%;
- color: #fefefe;
- transition: all 0.4s;
- }
- body {
- background-color: #fbfcfd;
- font-family: "Inter", sans-serif;
- color: #4a4a4a;
- }
- #app.dark {
- background-color: #121212;
- color: #e2e2e2;
- }
- h1 {
- font-size: 1.9rem;
- }
- h2 {
- font-size: 1.6rem;
- }
- h3 {
- font-size: 1.2rem;
- }
- h4 {
- font-size: 0.9rem;
- }
- p,
- legend {
- font-size: 1.2rem;
- }
- label {
- font-size: 0.9rem;
- line-height: 2;
- }
- fieldset {
- border: none;
- padding: 0;
- margin-top: 0.9rem;
- }
- input[type="radio"],
- input[type="checkbox"] {
- position: absolute !important;
- height: 1px;
- width: 1px;
- overflow: hidden;
- clip: rect(1px 1px 1px 1px);
- clip: rect(1px, 1px, 1px, 1px);
- white-space: nowrap;
- }
- .select-lg,
- .select-lg option {
- font-family: "Inter", sans-serif;
- padding: 10px;
- }
- .narrow {
- width: 800px;
- }
- #app {
- padding: 3%;
- transition: all 0.4s;
- }
- #app h1 {
- font-size: 1.9rem;
- font-weight: 700;
- line-height: 1.3;
- }
- header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .switch-group {
- display: flex;
- align-items: center;
- height: 2.25rem;
- width: 4.5rem;
- }
- input[type="checkbox"]+.toggle {
- height: 100%;
- width: 100%;
- background-color: #77a1db;
- border-radius: 1.9rem;
- cursor: pointer;
- display: flex;
- align-items: center;
- padding: 0.35rem;
- cursor: pointer;
- overflow: hidden;
- background-position: 25% 125%;
- transition: all 0.5s;
- }
- input[type="checkbox"]:focus+.toggle {
- outline: rgb(59, 153, 252) auto 5px;
- }
- input[type="checkbox"]:checked+.toggle {
- background-color: rgb(85, 89, 204);
- background-size: 1rem;
- background-repeat: no-repeat;
- background-position: 25%;
- background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMSIgY3k9IjgiIHI9IjEiIGZpbGw9IndoaXRlIi8+CjxjaXJjbGUgY3g9IjgiIGN5PSI3IiByPSIxIiBmaWxsPSJ3aGl0ZSIvPgo8Y2lyY2xlIGN4PSI1IiBjeT0iMTMiIHI9IjEiIGZpbGw9IndoaXRlIi8+CjxjaXJjbGUgY3g9IjUiIGN5PSIyIiByPSIyIiBmaWxsPSJ3aGl0ZSIvPgo8Y2lyY2xlIGN4PSIxMyIgY3k9IjMiIHI9IjEiIGZpbGw9IndoaXRlIi8+CjxjaXJjbGUgY3g9IjEyLjUiIGN5PSI5LjUiIHI9IjEuNSIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==");
- transition: all 0.5s;
- }
- input[type="checkbox"]+.toggle::after {
- content: "";
- display: block;
- height: 1.7rem;
- width: 1.7rem;
- border-radius: 50%;
- cursor: pointer;
- border: 4px solid #e1be64;
- background-color: #fddf74;
- transform: translateX(0rem);
- transition: all 0.5s;
- background-position: center bottom;
- }
- input[type="checkbox"]:hover+.toggle::after {
- transform: translateX(0rem) scale(1.1);
- }
- input[type="checkbox"]:checked+.toggle::after {
- border: 4px solid #ffffff;
- background-color: rgba(255, 255, 255, 0.4);
- transform: translateX(2.1rem);
- transition: all 0.5s;
- background-position: center;
- background-size: 60%;
- background-repeat: no-repeat;
- background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHZpZXdCb3g9IjAgMCAxOSAxOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE4LjUgMTAuMjlDMTguMzQyNyAxMS45OTIyIDE3LjcwMzkgMTMuNjE0NCAxNi42NTgyIDE0Ljk2NjhDMTUuNjEyNiAxNi4zMTkyIDE0LjIwMzUgMTcuMzQ1OCAxMi41OTU3IDE3LjkyNjVDMTAuOTg3OSAxOC41MDczIDkuMjQ3OTggMTguNjE4MSA3LjU3OTUgMTguMjQ2MUM1LjkxMTAyIDE3Ljg3NDEgNC4zODI5OSAxNy4wMzQ1IDMuMTc0MjMgMTUuODI1OEMxLjk2NTQ2IDE0LjYxNyAxLjEyNTk0IDEzLjA4OSAwLjc1MzkwNyAxMS40MjA1QzAuMzgxODc1IDkuNzUyMDIgMC40OTI3MTYgOC4wMTIwOCAxLjA3MzQ2IDYuNDA0M0MxLjY1NDIgNC43OTY1MSAyLjY4MDgzIDMuMzg3MzcgNC4wMzMyMSAyLjM0MTc1QzUuMzg1NTkgMS4yOTYxNCA3LjAwNzggMC42NTczMDUgOC43MSAwLjVDNy43MTM0MSAxLjg0ODI3IDcuMjMzODUgMy41MDk0NSA3LjM1ODUzIDUuMTgxNDFDNy40ODMyMSA2Ljg1MzM4IDguMjAzODYgOC40MjUwNiA5LjM4OTQgOS42MTA2QzEwLjU3NDkgMTAuNzk2MSAxMi4xNDY2IDExLjUxNjggMTMuODE4NiAxMS42NDE1QzE1LjQ5MDYgMTEuNzY2MiAxNy4xNTE3IDExLjI4NjYgMTguNSAxMC4yOVYxMC4yOVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=");
- }
- input[type="checkbox"]:checked:hover+.toggle::after {
- transform: translateX(2.1rem) scale(1.075);
- }
- .card {
- background-color: #fff;
- border-radius: 6px;
- border-width: 0;
- box-shadow: rgba(155, 155, 155, 0.45) 0 0 30px -5px;
- font-size: 1.1rem;
- height: 100%;
- line-height: 1.8rem;
- padding: 1.5rem 2rem;
- width: 100%;
- margin-bottom: 1.9rem;
- }
- .dark .card {
- background-color: #333333;
- box-shadow: none;
- }
- .card h1,
- .card h2,
- .card h3,
- .card h4,
- .card h5,
- .card h6 {
- color: #4a4a4a;
- }
- .dark .card h1,
- .dark .card h2,
- .dark .card h3,
- .dark .card h4,
- .dark .card h5,
- .dark .card h6 {
- color: #e2e2e2;
- }
- .card-header h2 {
- display: inline-block;
- }
- .card .cat-score {
- margin-left: 20px;
- font-size: smaller;
- }
- .card h3 {
- font-size: 1.2rem;
- font-weight: 700;
- line-height: 1.8em;
- margin: 0;
- padding: 0;
- }
- .card p,
- .card label,
- .card legend {
- color: #7a869c;
- border-width: 0;
- display: block;
- font-size: 1.1rem;
- font-weight: 300;
- line-height: 1.8em;
- margin: 0;
- padding: 0;
- }
- .card legend {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- }
- .card legend .score {
- font-size: smaller;
- margin-left: 20px;
- font-weight: 100;
- min-width: 5%;
- }
- .dark .card p,
- .dark .card label,
- .dark .card legend {
- color: #e2e2e2;
- }
- .card label {
- display: inline-block;
- }
- .card input[type="radio"]+label::before {
- content: "";
- height: 0.9rem;
- width: 0.9rem;
- margin-right: 0.7rem;
- border-radius: 50%;
- border: 1px solid rgb(74, 74, 74);
- background-color: #ffffff;
- display: inline-block;
- cursor: pointer;
- position: relative;
- top: 0.09rem;
- }
- .dark .card input[type="radio"]+label::before {
- border: 1px solid #e2e2e2;
- background-color: inherit;
- }
- .card input[type="radio"]:checked+label::before {
- background-color: rgb(47, 106, 189);
- border-color: rgb(47, 106, 189);
- }
- .dark .card input[type="radio"]:checked+label::before {
- background-color: #d9d9d9;
- border-color: #d9d9d9;
- }
- .card input[type="radio"]:checked+label {
- font-weight: bold;
- color: #4a4a4a;
- }
- .dark input[type="radio"]:checked+label {
- color: #e2e2e2;
- }
- .card input[type="radio"]:focus+label::before {
- outline: rgb(59, 153, 252) auto 5px;
- }
- .card legend {
- margin-bottom: 0.4rem;
- }
- .totals {
- font-size: 1.6rem;
- }
- .totals+h2 {
- font-size: 1.9rem;
- margin-top: 0;
- }
- .grade {
- font-size: 1.9rem;
- }
- button {
- background-color: #fff;
- border: 1px solid #4a4a4a;
- border-radius: 6px;
- box-shadow: rgba(155, 155, 155, 0.5) 1px 2px 3px 0;
- color: #4a4a4a;
- cursor: pointer;
- display: inline-block;
- font-size: 1rem;
- font-weight: 500;
- letter-spacing: 0.04em;
- line-height: 1.8em;
- margin: 0.75rem 1.1rem 1.1rem 0;
- outline: none;
- padding: 0.5rem 1.4rem;
- text-transform: uppercase;
- transition-delay: 0s;
- transition-duration: 0.25s;
- transition-property: all;
- transition-timing-function: ease-out;
- width: fit-content;
- }
- .dark button {
- background: #d9d9d9;
- color: #121212;
- box-shadow: none;
- }
- button:hover {
- border-color: #dbdbdb;
- color: #dbdbdb;
- }
- .dark button:hover {
- color: #121212;
- }
- button.copy {
- margin-left: 0.4rem;
- font-size: .8rem;
- }
- button:focus {
- border-color: rgb(56, 56, 56);
- box-shadow: rgb(219, 219, 219) 0px 0px 0px 3px;
- color: rgb(56, 56, 56);
- }
- div[role="alert"] {
- color: #4a4a4a;
- font-size: 1.2rem;
- margin-bottom: 1.2rem;
- }
- .dark div[role="alert"] {
- color: #e2e2e2;
- }
- .summary {
- font-size: 1.2rem;
- border: none;
- font-family: monospace;
- background-color: #d5d9de;
- padding: 0.9rem;
- border-radius: 6px;
- line-height: 1.5;
- width: 100%;
- }
- .summary h2,
- .dark .summary h2 {
- font-size: 1.2rem;
- font-family: "Inter", sans-serif;
- margin-top: 35px;
- margin-bottom: 5px;
- }
- .summary h2:first-of-type,
- .dark .summary h2:first-of-type {
- margin-top: 15px;
- }
- .dark .summary {
- background: #6b6a6a;
- color: #e2e2e2;
- }
- .summary pre,
- .dark .summary pre {
- white-space: pre-wrap;
- border-radius: 5px;
- padding: 15px;
- border: solid 2px rgba(0, 0, 0, .4);
- }
- .summary pre:empty {
- display: none;
- }
- .summary pre:empty+button {
- display: none;
- }
- .d-none {
- display: none;
- }
- @media (max-width: 450px) {
- .btn-container {
- text-align: center;
- }
- button {
- width: 100%;
- margin: 0.5rem;
- }
- input[type="checkbox"]:checked+.toggle::after {
- transform: translateX(1.3rem);
- background-size: 50%;
- }
- input[type="checkbox"]:checked:hover+.toggle::after {
- transform: translateX(1.3rem) scale(1.1);
- background-size: 50%;
- }
- }
- @media (max-width: 515px) {
- input[type="checkbox"]:checked+.toggle::after {
- transform: translateX(1.7rem);
- }
- input[type="checkbox"]:checked:hover+.toggle::after {
- transform: translateX(1.7rem) scale(1.1);
- }
- }
- @media (max-width: 460px) {
- input[type="checkbox"]:checked+.toggle::after {
- transform: translateX(1.4rem);
- }
- input[type="checkbox"]:checked:hover+.toggle::after {
- transform: translateX(1.4rem) scale(1.1);
- }
- }
- @media (max-width: 400px) {
- #app h1 {
- font-size: 1.6rem;
- }
- input[type="checkbox"]:checked+.toggle::after {
- transform: translateX(1.3rem);
- }
- input[type="checkbox"]:checked:hover+.toggle::after {
- transform: translateX(1.3rem) scale(1.1);
- }
- }
- @media (max-width: 340px) {
- input[type="checkbox"]:checked+.toggle::after {
- transform: translateX(0.9rem);
- }
- input[type="checkbox"]:checked:hover+.toggle::after {
- transform: translateX(0.9rem) scale(1.075);
- }
- }
- </style>
- <script>
- $(function () {
- let $select2 = $('.select2').select2({
- containerCssClass: "wrap"
- })
- function triggerEvent(name, val) {
- let selected = $("select[name='" + name + "']")
- let change = new Event('change', { bubbles: true })
- selected[0].dispatchEvent(change)
- }
- $('.select2').on('select2:select', function (e) {
- triggerEvent(e.target.name, e.target.value)
- });
- })
- </script>
- </head>
- <body>
- <div id="app"></div>
- <script>
- (function (window) {
- "use strict";
- function Model() {
- this.title = `Module 12 SQL Challenge Rubric (Coding)`;
- this.categories = [
- {
- title: "Deliverables",
- subtitle: null,
- score: 0,
- questions: [
- {
- title: "Student submitted GitHub Repo containing application code",
- score: 10,
- type: "true false",
- message: "GitHub repo is empty",
- status: false
- }
- ]
- },
- {
- title: "Walkthrough Video",
- subtitle: null,
- score: 0,
- questions: [
- {
- title:
- "Student includes link to walkthrough video in README",
- score: 4,
- type: "true false",
- message:
- "Student does not include link to walkthrough video in README",
- status: false
- },
- {
- title: "Walkthrough video shows all of the technical acceptance criteria being met",
- score: 16,
- type: "likert",
- options: [
- {
- message: "Walkthrough video doesn't show any of the 8 technical acceptance criteria listed in the next section being met",
- score: 0
- },
- {
- message: "Walkthrough video only shows 1 of the 8 technical acceptance criteria listed in the next section being met",
- score: 2
- },
- {
- message: "Walkthrough video only shows 2 of the 8 technical acceptance criteria listed in the next section being met",
- score: 4
- },
- {
- message: "Walkthrough video only shows 3 of the 8 technical acceptance criteria listed in the next section being met",
- score: 6
- },
- {
- message: "Walkthrough video only shows 4 of the 8 technical acceptance criteria listed in the next section being met",
- score: 8
- },
- {
- message: "Walkthrough video only shows 5 of the 8 technical acceptance criteria listed in the next section being met",
- score: 10
- },
- {
- message: "Walkthrough video only shows 6 of the 8 technical acceptance criteria listed in the next section being met",
- score: 12
- },
- {
- message: "Walkthrough video only shows 7 of the 8 technical acceptance criteria listed in the next section being met",
- score: 14
- },
- {
- message: "Walkthrough video shows all of the 8 technical acceptance criteria listed in the next section being met",
- score: 16
- }
- ],
- message: "",
- status: false
- },
- {
- title:
- "Walkthrough video demonstrates how to invoke the application",
- score: 3,
- type: "true false",
- message: "Walkthrough video does not demonstrate how to invoke the application",
- status: false
- },
- {
- title:
- "Walkthrough video demonstrates a functional menu",
- score: 4,
- type: "true false",
- message: "Walkthrough video does not demonstrate a functional menu",
- status: false
- }
- ]
- },
- {
- title: "Technical Acceptance Criteria",
- subtitle:
- "Watch out for errors in the console from this point forward.",
- score: 0,
- questions: [
- {
- title:
- "Application follows table schema outlined in Challenge instructions",
- score: 5,
- type: "true false",
- message: "Application doesn't follow table schema outlined in Challenge instructions",
- status: false
- },
- {
- title:
- "Application allows users to add departments",
- score: 5,
- type: "true false",
- message:
- "Application doesn't allow users to add departments",
- status: false
- },
- {
- title:
- "Application allows users to add roles",
- score: 5,
- type: "true false",
- message:
- "Application doesn't allow users to add roles",
- status: false
- },
- {
- title:
- "Application allows users to add employees",
- score: 5,
- type: "true false",
- message:
- "Application doesn't allow users to add employees",
- status: false
- },
- {
- title: "Application allows users to view departments",
- score: 5,
- type: "true false",
- message: "Application doesn't allow users to view departments",
- status: false
- },
- {
- title: "Application allows users to view roles",
- score: 5,
- type: "true false",
- message: "Application doesn't allow users to view roles",
- status: false
- },
- {
- title: "Application allows users to view employees",
- score: 5,
- type: "true false",
- message: "Application doesn't allow users to view employees",
- status: false
- },
- {
- title: "Application allows users to update employee roles",
- score: 5,
- type: "true false",
- message: "Application doesn't allow users to update employee roles",
- status: false
- }
- ]
- },
- {
- title: "Repository Quality",
- subtitle: null,
- score: 0,
- questions: [
- {
- title: "Repository has a unique name",
- score: 2,
- type: "true false",
- message: "Repo doesn't have a unique name",
- status: false
- },
- {
- title:
- "Repository follows best practices for file structure and naming conventions",
- score: 2,
- type: "true false",
- message:
- "Code doesn't follow recommended file/folder structure",
- status: false
- },
- {
- title:
- "Repository follows best practices for class/id naming conventions, indentation, quality comments, etc.",
- score: 2,
- type: "true false",
- message:
- "Code doesn't follow good practices for class/id names, indentation, lacks quality comments",
- status: false
- },
- {
- title:
- "Repository contains multiple descriptive commit messages",
- score: 2,
- type: "true false",
- message:
- "Repo doesn't contain multiple descriptive commit messages",
- status: false
- },
- {
- title: "Repository contains quality README with description and a link to walkthrough video",
- score: 5,
- type: "likert",
- options: [
- {
- message: "Repo doesn't contain a quality README with description and a link to walkthrough video",
- score: 0
- },
- {
- message: "Repository README is missing either the description or the link to the walkthrough video",
- score: 2
- },
- {
- message: "Repository contains quality README with description and a link to walkthrough video",
- score: 5
- }
- ],
- message: "",
- status: false
- }
- ]
- },
- {
- title: "Application Quality",
- subtitle: null,
- score: 0,
- questions: [
- {
- title: "Application user experience is intuitive and easy to navigate",
- score: 10,
- type: "likert",
- options: [
- {
- message: "Application user experience is not intuitive and easy to navigate",
- score: 0
- },
- {
- message: "Application user experience could be much more intuitive and easy to navigate",
- score: 4
- },
- {
- message: "Application user experience could be a lot more intuitive and easy to navigate",
- score: 8
- },
- {
- message: "Application user experience is intuitive and easy to navigate",
- score: 10
- }
- ],
- message: "",
- status: false
- }
- ]
- },
- {
- title: "Bonus",
- subtitle: null,
- score: 0,
- questions: [
- {
- title: "Application allows users to update an employee's managers",
- score: 2,
- type: "true false",
- message: "Application allows users to update an employee's managers",
- status: false
- },
- {
- title: "Application allows users to view employees by manager",
- score: 2,
- type: "true false",
- message: "Application allows users to view employees by manager",
- status: false
- },
- {
- title: "Application allows users to view employees by department",
- score: 2,
- type: "true false",
- message: "Application allows users to view employees by department",
- status: false
- },
- {
- title: "Application allows users to delete departments",
- score: 2,
- type: "true false",
- message: "Application allows users to delete departments",
- status: false
- },
- {
- title: "Application allows users to delete roles",
- score: 2,
- type: "true false",
- message: "Application allows users to delete roles",
- status: false
- },
- {
- title: "Application allows users to delete employees",
- score: 2,
- type: "true false",
- message: "Application allows users to delete employees",
- status: false
- },
- {
- title: "Application allows users to view the total utilized budget of a department (the combined salaries of all employees in that department)",
- score: 8,
- type: "true false",
- message: "Application allows users to view the total utilized budget of a department (the combined salaries of all employees in that department)",
- status: false
- }
- ]
- },
- {
- title: "Academic Integrity",
- subtitle:
- "If any of of the following are true, partner with your instructor to investigate plagiarism. Contact your SSM if you believe plagiarism has occurred.",
- score: 0,
- questions: [
- {
- title: "Application contains a low number of commits",
- score: 0,
- type: "true false",
- message: null,
- status: false
- },
- {
- title:
- "Application codebase appears advanced for the student, at this point in the course, or in general",
- score: 0,
- type: "true false",
- message: null,
- status: false
- },
- {
- title:
- "Application package.json file references a different author and/or repository",
- score: 0,
- type: "true false",
- message: null,
- status: false
- },
- {
- title:
- "Application package.json file references much older versions of npm packages",
- score: 0,
- type: "true false",
- message: null,
- status: false
- }
- ]
- }
- ];
- this.initStorage();
- }
- Model.prototype.initStorage = function () {
- this.score = 0;
- this.questions = [];
- this.messages = new Set();
- this.flagged = new Set();
- this.isDarkMode =
- JSON.parse(localStorage.getItem("isDarkMode")) || false;
- this.categories
- .forEach(category => {
- category.score = 0;
- category.questions.forEach(question => {
- question.category = category.title;
- question.status = false;
- question.id = this.questions.length;
- question.flagged = category.title === "Academic Integrity";
- question.bonus = category.title === "Bonus";
- if (question.type === "likert") {
- question.message = question.options[0].message.split(" - ").pop();
- };
- let messageObj = {
- message: question.message,
- category: question.category
- };
- question.message && !question.bonus && this.messages.add(messageObj);
- this.questions.push(question);
- category.score += question.score;
- });
- });
- };
- Model.prototype.toggleDarkMode = function () {
- this.isDarkMode = !this.isDarkMode;
- localStorage.setItem("isDarkMode", this.isDarkMode);
- };
- Model.prototype.toggleRadio = function (radio) {
- const id = Number(radio.getAttribute("name"));
- const question = this.questions[id];
- const questionScore = document.querySelector("span[data-id='" + id + "']");
- const category = question.category;
- const categoryScore = document.querySelector("span[data-cat='" + category + "']");
- const resultsCategoryScore = document.querySelector("span[data-res-cat='" + category + "']");
- question.status = !question.status;
- if (question.status === true) {
- if (!question.bonus) {
- this.messages.forEach(message => {
- if (message.message === question.message) {
- this.messages.delete(message);
- }
- })
- } else {
- let messageObj = {
- message: question.message,
- category: category
- }
- this.messages.add(messageObj);
- }
- this.score += question.score;
- if (question.flagged) {
- this.flagged.add(question.id);
- }
- } else {
- if (question.flagged) {
- this.flagged.delete(question.id);
- }
- if (!question.bonus) {
- if (question.message) {
- let messageObj = {
- message: question.message,
- category: category
- }
- this.messages.add(messageObj);
- }
- } else {
- this.messages.forEach(message => {
- if (message.message === question.message) {
- this.messages.delete(message);
- }
- })
- }
- this.score -= question.score;
- }
- if (category !== "Academic Integrity") {
- if (question.status) {
- questionScore.textContent = question.score;
- } else {
- questionScore.textContent = 0;
- }
- const catQuestions = this.categories.filter(cat => cat.title === category)[0].questions;
- let categoryTotal = 0;
- catQuestions.forEach(question => {
- if (question.type === "true false") {
- if (question.status) {
- categoryTotal += question.score;
- }
- } else {
- let score = document.querySelector("select[name='" + question.id + "']").value;
- categoryTotal += parseInt(score);
- }
- })
- categoryScore.textContent = categoryTotal;
- resultsCategoryScore.textContent = categoryTotal;
- }
- };
- Model.prototype.handleSelect = function (select) {
- const id = Number(select.getAttribute("name"));
- const question = this.questions[id];
- const questionScore = document.querySelector("span[data-id='" + id + "']");
- const oldScore = questionScore.textContent;
- const category = question.category;
- const categoryScore = document.querySelector("span[data-cat='" + category + "']");
- const resultsCategoryScore = document.querySelector("span[data-res-cat='" + category + "']");
- let newMessage = select.selectedOptions[0].text.split(" - ").pop();
- if (newMessage === "Open this menu") {
- newMessage = select[1].text.split(" - ").pop();
- };
- if (question.type === "likert") {
- this.messages.forEach(item => {
- if (item.message === question.message) {
- this.messages.delete(item)
- }
- })
- question.message = newMessage;
- let messageObj = {
- message: newMessage,
- category: category
- }
- this.messages.add(messageObj);
- };
- this.score -= parseInt(oldScore);
- this.score += parseInt(select.value);
- questionScore.textContent = select.value;
- const catQuestions = this.categories.filter(cat => cat.title === category)[0].questions;
- let categoryTotal = 0;
- catQuestions.forEach(question => {
- if (question.type === "true false") {
- if (question.status) {
- categoryTotal += question.score;
- }
- } else {
- let score = document.querySelector("select[name='" + question.id + "']").value;
- categoryTotal += parseInt(score);
- }
- })
- categoryScore.textContent = categoryTotal;
- resultsCategoryScore.textContent = categoryTotal;
- };
- Model.prototype.calcGrade = function () {
- const roundedScore = Math.min(100, Math.ceil(this.score));
- let letterGrade = "";
- if (roundedScore >= 99.5) {
- letterGrade = "A+";
- } else if (roundedScore >= 94.5 && roundedScore <= 99.4) {
- letterGrade = "A";
- } else if (roundedScore >= 91.5 && roundedScore <= 94.4) {
- letterGrade = "A-";
- } else if (roundedScore >= 87.5 && roundedScore <= 91.4) {
- letterGrade = "B+";
- } else if (roundedScore >= 84.5 && roundedScore <= 87.4) {
- letterGrade = "B";
- } else if (roundedScore >= 81.5 && roundedScore <= 84.4) {
- letterGrade = "B-";
- } else if (roundedScore >= 77.5 && roundedScore <= 81.4) {
- letterGrade = "C+";
- } else if (roundedScore >= 74.5 && roundedScore <= 77.4) {
- letterGrade = "C";
- } else if (roundedScore >= 71.5 && roundedScore <= 74.4) {
- letterGrade = "C-";
- } else if (roundedScore >= 69.5 && roundedScore <= 71.4) {
- letterGrade = "D+";
- } else if (roundedScore >= 64.5 && roundedScore <= 69.4) {
- letterGrade = "D";
- } else if (roundedScore >= 61.5 && roundedScore <= 64.4) {
- letterGrade = "D-";
- } else {
- letterGrade = "F";
- }
- return letterGrade;
- };
- Model.prototype.hasFlags = function () {
- return this.flagged.size > 0;
- };
- function View(model) {
- this.model = model;
- this.generateHTML();
- this.cacheDom();
- }
- View.prototype.cacheDom = function () {
- this.darkModeToggle = document.querySelector("#dark-mode");
- this.radios = Array.from(
- document.querySelectorAll("input[type='radio']")
- );
- this.selects = Array.from(
- document.querySelectorAll("select")
- );
- this.totals = document.querySelector(".totals");
- this.grade = document.querySelector(".grade");
- this.alert = document.querySelector("div[role='alert']");
- this.summaryHeading = document.querySelector(".summary-heading");
- this.summary = document.querySelector(".summary");
- this.model.categories
- .filter(category => category.title !== "Academic Integrity")
- .map(category => {
- let summary = category.title.replace(/\s+/g, '-').toLowerCase();
- let summaryName = summary + "-summary";
- return this[summaryName] = document.querySelector("." + summary);
- })
- this.resetButton = document.querySelector(".reset");
- this.model.categories
- .filter(category => category.title !== "Academic Integrity")
- .map(category => {
- let button = category.title.replace(/\s+/g, '-').toLowerCase();
- let buttonName = "copyButton-" + button;
- return this[buttonName] = document.querySelector(".copy-" + button);
- })
- };
- View.prototype.createFieldset = function ({ title, id, score, status, category, type, options }) {
- return `<fieldset class="input-group">
- <legend>
- <span class="title">${title}</span> ${category === "Academic Integrity" ? "" : "<span class='score'><span data-id='" + id + "' class='current-score'>0</span> / " + score + "</span>"}
- </legend>
- ${type === "true false" ?
- `<div class="radio-group">
- <input type="radio" name="${id}" id="${id}-true" value="true">
- <label for="${id}-true">True</label>
- </div>
- <div class="radio-group">
- <input type="radio" name="${id}" id="${id}-false" value="false" checked>
- <label for="${id}-false">False</label>
- </div>` :
- `<div class="select-group">
- <select name="${id}" class="select-lg select2 narrow wrap">
- <option value="0" selected>Open this menu</option>
- ${options.map(option => `<option value="${option.score}">${option.score} - ${option.message}</option>`)}
- </select>
- </div>`
- }
- </fieldset>`;
- };
- View.prototype.createCard = function ({ title, subtitle, questions, score }) {
- return `<div class="card">
- <div class="card-header"><h2>${title}</h2> ${title !== "Academic Integrity" ? "<span class='cat-score'><span data-cat='" + title + "'>0</span> / " + score + "</span>" : ""}</div>
- ${subtitle ? `<h3>${subtitle}</h3>` : ""}
- ${questions.map(child => this.createFieldset(child)).join("")}
- </div>`;
- };
- View.prototype.createResults = function () {
- return `<div class="card">
- <h2>Recommended Grade: <span class="grade">F</span></h2>
- <h2 class="totals">Total: (0/100)</h2>
- <div class="d-none" role="alert">
- You've selected <strong>True</strong> for one of more Academic
- Integrity prompts and are advised to investigate plagiarism before
- issuing a grade.
- </div>
- <div class="summary" aria-label="summary">
- ${this.model.categories
- .filter(category => category.title !== "Academic Integrity")
- .map(category => {
- let score = category.score;
- let title = category.title;
- let catClass = title.replace(/\s+/g, '-').toLowerCase();
- return "<h2>" + title + "<span class='cat-score'><span data-res-cat='" + title + "'>0</span> / " + score + "</span></h2><pre class='" + catClass + "'>" + [...this.model.messages]
- .filter(messageObj => messageObj.category === category.title)
- .map(messageObj => `* ${messageObj.message}\n`)
- .join("") + "</pre><button class='copy copy-" + catClass + "'>Copy To Clipboard</button>"
- })
- .join("")}
- </div>
- <div class="btn-container">
- <button class="reset">Reset Form</button>
- </div>
- </div>`;
- };
- View.prototype.createHeader = function (title, isDarkMode = false) {
- return `<header>
- <h1>${title}</h1>
- <div class="switch-group">
- <input type="checkbox" name="dark-mode" id="dark-mode" ${isDarkMode ? "checked" : ""
- }>
- <label aria-label="dark mode" for="dark-mode" class="toggle">
- </label>
- </div>
- </header>`;
- };
- View.prototype.generateHTML = function () {
- this.wrapper = document.querySelector("#app");
- if (this.model.isDarkMode) {
- this.wrapper.classList.add("dark");
- }
- const survey = this.model.categories.reduce((final, current) => {
- final += this.createCard(current);
- return final;
- }, "");
- const results = this.createResults();
- const header = this.createHeader(
- this.model.title,
- this.model.isDarkMode
- );
- this.wrapper.innerHTML = header + survey + results;
- };
- View.prototype.update = function () {
- const roundedScore = Math.min(100, Math.ceil(this.model.score));
- this.totals.textContent = `Total: (${roundedScore}/ 100)`;
- const letterGrade = this.model.calcGrade();
- this.grade.textContent = letterGrade;
- if (this.model.hasFlags()) {
- this.alert.classList.remove("d-none");
- } else {
- this.alert.classList.add("d-none");
- }
- if (this.model.isDarkMode) {
- this.wrapper.classList.add("dark");
- } else {
- this.wrapper.classList.remove("dark");
- }
- this.model.categories
- .filter(category => category.title !== "Academic Integrity")
- .forEach(category => {
- let catClass = category.title.replace(/\s+/g, '-').toLowerCase();
- this[catClass + "-summary"].innerHTML = [...this.model.messages]
- .filter(messageObj => messageObj.category === category.title)
- .map(messageObj => `* ${messageObj.message}\n`)
- .join("")
- })
- };
- function Controller(model, view) {
- this.model = model;
- this.view = view;
- this.addEventListeners();
- }
- Controller.prototype.addEventListeners = function () {
- this.view.wrapper.addEventListener("change", event => {
- const { target } = event;
- if (target.name !== "dark-mode") {
- if (!target.matches("input[type='radio']")) {
- this.model.handleSelect(target);
- } else {
- this.model.toggleRadio(target);
- }
- }
- this.view.update();
- });
- this.view.resetButton.addEventListener("click", () => {
- this.model.initStorage();
- this.view.radios.forEach(
- radio => (radio.checked = radio.hasAttribute("checked"))
- );
- this.view.selects.forEach(
- select => select.selectedIndex = null
- )
- this.model.questions
- .filter(question => question.category !== "Academic Integrity")
- .forEach(question => {
- const id = question.id;
- const questionScore = document.querySelector("span[data-id='" + id + "']");
- questionScore.textContent = 0;
- });
- this.model.categories
- .filter(category => category.title !== "Academic Integrity")
- .forEach(category => {
- const title = category.title
- const categoryScore = document.querySelector("span[data-cat='" + title + "']");
- const resultsCategoryScore = document.querySelector("span[data-res-cat='" + title + "']");
- categoryScore.textContent = 0;
- resultsCategoryScore.textContent = 0;
- });
- this.view.update();
- window.scrollTo(0, 0);
- });
- this.model.categories
- .filter(category => category.title !== "Academic Integrity")
- .forEach(category => {
- let title = category.title.replace(/\s+/g, '-').toLowerCase();
- let buttonName = "copyButton-" + title;
- let summaryName = title + "-summary";
- this.view[buttonName].addEventListener("click", () => {
- const selection = window.getSelection();
- const range = document.createRange();
- range.selectNodeContents(this.view[summaryName]);
- selection.removeAllRanges();
- selection.addRange(range);
- document.execCommand("copy");
- });
- });
- this.view.darkModeToggle.addEventListener("change", () => {
- this.model.toggleDarkMode();
- this.view.update();
- });
- };
- function App(Model, View, Controller) {
- this.model = new Model();
- this.view = new View(this.model);
- this.controller = new Controller(this.model, this.view);
- }
- return new App(Model, View, Controller);
- })(window);
- </script>
- </body>
- </html>
|