mod12.html 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  7. <link href="https://rsms.me/inter/inter.css" rel="stylesheet" />
  8. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
  9. <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.full.js"></script>
  10. <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.css" rel="stylesheet" />
  11. <title>Module 12 SQL Challenge Rubric</title>
  12. <style>
  13. *,
  14. *::before,
  15. *::after {
  16. box-sizing: border-box;
  17. }
  18. html,
  19. body {
  20. margin: 0;
  21. padding: 0;
  22. line-height: 1.15;
  23. font-size: 100%;
  24. color: #fefefe;
  25. transition: all 0.4s;
  26. }
  27. body {
  28. background-color: #fbfcfd;
  29. font-family: "Inter", sans-serif;
  30. color: #4a4a4a;
  31. }
  32. #app.dark {
  33. background-color: #121212;
  34. color: #e2e2e2;
  35. }
  36. h1 {
  37. font-size: 1.9rem;
  38. }
  39. h2 {
  40. font-size: 1.6rem;
  41. }
  42. h3 {
  43. font-size: 1.2rem;
  44. }
  45. h4 {
  46. font-size: 0.9rem;
  47. }
  48. p,
  49. legend {
  50. font-size: 1.2rem;
  51. }
  52. label {
  53. font-size: 0.9rem;
  54. line-height: 2;
  55. }
  56. fieldset {
  57. border: none;
  58. padding: 0;
  59. margin-top: 0.9rem;
  60. }
  61. input[type="radio"],
  62. input[type="checkbox"] {
  63. position: absolute !important;
  64. height: 1px;
  65. width: 1px;
  66. overflow: hidden;
  67. clip: rect(1px 1px 1px 1px);
  68. clip: rect(1px, 1px, 1px, 1px);
  69. white-space: nowrap;
  70. }
  71. .select-lg,
  72. .select-lg option {
  73. font-family: "Inter", sans-serif;
  74. padding: 10px;
  75. }
  76. .narrow {
  77. width: 800px;
  78. }
  79. #app {
  80. padding: 3%;
  81. transition: all 0.4s;
  82. }
  83. #app h1 {
  84. font-size: 1.9rem;
  85. font-weight: 700;
  86. line-height: 1.3;
  87. }
  88. header {
  89. display: flex;
  90. justify-content: space-between;
  91. align-items: center;
  92. }
  93. .switch-group {
  94. display: flex;
  95. align-items: center;
  96. height: 2.25rem;
  97. width: 4.5rem;
  98. }
  99. input[type="checkbox"]+.toggle {
  100. height: 100%;
  101. width: 100%;
  102. background-color: #77a1db;
  103. border-radius: 1.9rem;
  104. cursor: pointer;
  105. display: flex;
  106. align-items: center;
  107. padding: 0.35rem;
  108. cursor: pointer;
  109. overflow: hidden;
  110. background-position: 25% 125%;
  111. transition: all 0.5s;
  112. }
  113. input[type="checkbox"]:focus+.toggle {
  114. outline: rgb(59, 153, 252) auto 5px;
  115. }
  116. input[type="checkbox"]:checked+.toggle {
  117. background-color: rgb(85, 89, 204);
  118. background-size: 1rem;
  119. background-repeat: no-repeat;
  120. background-position: 25%;
  121. background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMSIgY3k9IjgiIHI9IjEiIGZpbGw9IndoaXRlIi8+CjxjaXJjbGUgY3g9IjgiIGN5PSI3IiByPSIxIiBmaWxsPSJ3aGl0ZSIvPgo8Y2lyY2xlIGN4PSI1IiBjeT0iMTMiIHI9IjEiIGZpbGw9IndoaXRlIi8+CjxjaXJjbGUgY3g9IjUiIGN5PSIyIiByPSIyIiBmaWxsPSJ3aGl0ZSIvPgo8Y2lyY2xlIGN4PSIxMyIgY3k9IjMiIHI9IjEiIGZpbGw9IndoaXRlIi8+CjxjaXJjbGUgY3g9IjEyLjUiIGN5PSI5LjUiIHI9IjEuNSIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==");
  122. transition: all 0.5s;
  123. }
  124. input[type="checkbox"]+.toggle::after {
  125. content: "";
  126. display: block;
  127. height: 1.7rem;
  128. width: 1.7rem;
  129. border-radius: 50%;
  130. cursor: pointer;
  131. border: 4px solid #e1be64;
  132. background-color: #fddf74;
  133. transform: translateX(0rem);
  134. transition: all 0.5s;
  135. background-position: center bottom;
  136. }
  137. input[type="checkbox"]:hover+.toggle::after {
  138. transform: translateX(0rem) scale(1.1);
  139. }
  140. input[type="checkbox"]:checked+.toggle::after {
  141. border: 4px solid #ffffff;
  142. background-color: rgba(255, 255, 255, 0.4);
  143. transform: translateX(2.1rem);
  144. transition: all 0.5s;
  145. background-position: center;
  146. background-size: 60%;
  147. background-repeat: no-repeat;
  148. background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHZpZXdCb3g9IjAgMCAxOSAxOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE4LjUgMTAuMjlDMTguMzQyNyAxMS45OTIyIDE3LjcwMzkgMTMuNjE0NCAxNi42NTgyIDE0Ljk2NjhDMTUuNjEyNiAxNi4zMTkyIDE0LjIwMzUgMTcuMzQ1OCAxMi41OTU3IDE3LjkyNjVDMTAuOTg3OSAxOC41MDczIDkuMjQ3OTggMTguNjE4MSA3LjU3OTUgMTguMjQ2MUM1LjkxMTAyIDE3Ljg3NDEgNC4zODI5OSAxNy4wMzQ1IDMuMTc0MjMgMTUuODI1OEMxLjk2NTQ2IDE0LjYxNyAxLjEyNTk0IDEzLjA4OSAwLjc1MzkwNyAxMS40MjA1QzAuMzgxODc1IDkuNzUyMDIgMC40OTI3MTYgOC4wMTIwOCAxLjA3MzQ2IDYuNDA0M0MxLjY1NDIgNC43OTY1MSAyLjY4MDgzIDMuMzg3MzcgNC4wMzMyMSAyLjM0MTc1QzUuMzg1NTkgMS4yOTYxNCA3LjAwNzggMC42NTczMDUgOC43MSAwLjVDNy43MTM0MSAxLjg0ODI3IDcuMjMzODUgMy41MDk0NSA3LjM1ODUzIDUuMTgxNDFDNy40ODMyMSA2Ljg1MzM4IDguMjAzODYgOC40MjUwNiA5LjM4OTQgOS42MTA2QzEwLjU3NDkgMTAuNzk2MSAxMi4xNDY2IDExLjUxNjggMTMuODE4NiAxMS42NDE1QzE1LjQ5MDYgMTEuNzY2MiAxNy4xNTE3IDExLjI4NjYgMTguNSAxMC4yOVYxMC4yOVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=");
  149. }
  150. input[type="checkbox"]:checked:hover+.toggle::after {
  151. transform: translateX(2.1rem) scale(1.075);
  152. }
  153. .card {
  154. background-color: #fff;
  155. border-radius: 6px;
  156. border-width: 0;
  157. box-shadow: rgba(155, 155, 155, 0.45) 0 0 30px -5px;
  158. font-size: 1.1rem;
  159. height: 100%;
  160. line-height: 1.8rem;
  161. padding: 1.5rem 2rem;
  162. width: 100%;
  163. margin-bottom: 1.9rem;
  164. }
  165. .dark .card {
  166. background-color: #333333;
  167. box-shadow: none;
  168. }
  169. .card h1,
  170. .card h2,
  171. .card h3,
  172. .card h4,
  173. .card h5,
  174. .card h6 {
  175. color: #4a4a4a;
  176. }
  177. .dark .card h1,
  178. .dark .card h2,
  179. .dark .card h3,
  180. .dark .card h4,
  181. .dark .card h5,
  182. .dark .card h6 {
  183. color: #e2e2e2;
  184. }
  185. .card-header h2 {
  186. display: inline-block;
  187. }
  188. .card .cat-score {
  189. margin-left: 20px;
  190. font-size: smaller;
  191. }
  192. .card h3 {
  193. font-size: 1.2rem;
  194. font-weight: 700;
  195. line-height: 1.8em;
  196. margin: 0;
  197. padding: 0;
  198. }
  199. .card p,
  200. .card label,
  201. .card legend {
  202. color: #7a869c;
  203. border-width: 0;
  204. display: block;
  205. font-size: 1.1rem;
  206. font-weight: 300;
  207. line-height: 1.8em;
  208. margin: 0;
  209. padding: 0;
  210. }
  211. .card legend {
  212. display: flex;
  213. justify-content: flex-start;
  214. align-items: center;
  215. }
  216. .card legend .score {
  217. font-size: smaller;
  218. margin-left: 20px;
  219. font-weight: 100;
  220. min-width: 5%;
  221. }
  222. .dark .card p,
  223. .dark .card label,
  224. .dark .card legend {
  225. color: #e2e2e2;
  226. }
  227. .card label {
  228. display: inline-block;
  229. }
  230. .card input[type="radio"]+label::before {
  231. content: "";
  232. height: 0.9rem;
  233. width: 0.9rem;
  234. margin-right: 0.7rem;
  235. border-radius: 50%;
  236. border: 1px solid rgb(74, 74, 74);
  237. background-color: #ffffff;
  238. display: inline-block;
  239. cursor: pointer;
  240. position: relative;
  241. top: 0.09rem;
  242. }
  243. .dark .card input[type="radio"]+label::before {
  244. border: 1px solid #e2e2e2;
  245. background-color: inherit;
  246. }
  247. .card input[type="radio"]:checked+label::before {
  248. background-color: rgb(47, 106, 189);
  249. border-color: rgb(47, 106, 189);
  250. }
  251. .dark .card input[type="radio"]:checked+label::before {
  252. background-color: #d9d9d9;
  253. border-color: #d9d9d9;
  254. }
  255. .card input[type="radio"]:checked+label {
  256. font-weight: bold;
  257. color: #4a4a4a;
  258. }
  259. .dark input[type="radio"]:checked+label {
  260. color: #e2e2e2;
  261. }
  262. .card input[type="radio"]:focus+label::before {
  263. outline: rgb(59, 153, 252) auto 5px;
  264. }
  265. .card legend {
  266. margin-bottom: 0.4rem;
  267. }
  268. .totals {
  269. font-size: 1.6rem;
  270. }
  271. .totals+h2 {
  272. font-size: 1.9rem;
  273. margin-top: 0;
  274. }
  275. .grade {
  276. font-size: 1.9rem;
  277. }
  278. button {
  279. background-color: #fff;
  280. border: 1px solid #4a4a4a;
  281. border-radius: 6px;
  282. box-shadow: rgba(155, 155, 155, 0.5) 1px 2px 3px 0;
  283. color: #4a4a4a;
  284. cursor: pointer;
  285. display: inline-block;
  286. font-size: 1rem;
  287. font-weight: 500;
  288. letter-spacing: 0.04em;
  289. line-height: 1.8em;
  290. margin: 0.75rem 1.1rem 1.1rem 0;
  291. outline: none;
  292. padding: 0.5rem 1.4rem;
  293. text-transform: uppercase;
  294. transition-delay: 0s;
  295. transition-duration: 0.25s;
  296. transition-property: all;
  297. transition-timing-function: ease-out;
  298. width: fit-content;
  299. }
  300. .dark button {
  301. background: #d9d9d9;
  302. color: #121212;
  303. box-shadow: none;
  304. }
  305. button:hover {
  306. border-color: #dbdbdb;
  307. color: #dbdbdb;
  308. }
  309. .dark button:hover {
  310. color: #121212;
  311. }
  312. button.copy {
  313. margin-left: 0.4rem;
  314. font-size: .8rem;
  315. }
  316. button:focus {
  317. border-color: rgb(56, 56, 56);
  318. box-shadow: rgb(219, 219, 219) 0px 0px 0px 3px;
  319. color: rgb(56, 56, 56);
  320. }
  321. div[role="alert"] {
  322. color: #4a4a4a;
  323. font-size: 1.2rem;
  324. margin-bottom: 1.2rem;
  325. }
  326. .dark div[role="alert"] {
  327. color: #e2e2e2;
  328. }
  329. .summary {
  330. font-size: 1.2rem;
  331. border: none;
  332. font-family: monospace;
  333. background-color: #d5d9de;
  334. padding: 0.9rem;
  335. border-radius: 6px;
  336. line-height: 1.5;
  337. width: 100%;
  338. }
  339. .summary h2,
  340. .dark .summary h2 {
  341. font-size: 1.2rem;
  342. font-family: "Inter", sans-serif;
  343. margin-top: 35px;
  344. margin-bottom: 5px;
  345. }
  346. .summary h2:first-of-type,
  347. .dark .summary h2:first-of-type {
  348. margin-top: 15px;
  349. }
  350. .dark .summary {
  351. background: #6b6a6a;
  352. color: #e2e2e2;
  353. }
  354. .summary pre,
  355. .dark .summary pre {
  356. white-space: pre-wrap;
  357. border-radius: 5px;
  358. padding: 15px;
  359. border: solid 2px rgba(0, 0, 0, .4);
  360. }
  361. .summary pre:empty {
  362. display: none;
  363. }
  364. .summary pre:empty+button {
  365. display: none;
  366. }
  367. .d-none {
  368. display: none;
  369. }
  370. @media (max-width: 450px) {
  371. .btn-container {
  372. text-align: center;
  373. }
  374. button {
  375. width: 100%;
  376. margin: 0.5rem;
  377. }
  378. input[type="checkbox"]:checked+.toggle::after {
  379. transform: translateX(1.3rem);
  380. background-size: 50%;
  381. }
  382. input[type="checkbox"]:checked:hover+.toggle::after {
  383. transform: translateX(1.3rem) scale(1.1);
  384. background-size: 50%;
  385. }
  386. }
  387. @media (max-width: 515px) {
  388. input[type="checkbox"]:checked+.toggle::after {
  389. transform: translateX(1.7rem);
  390. }
  391. input[type="checkbox"]:checked:hover+.toggle::after {
  392. transform: translateX(1.7rem) scale(1.1);
  393. }
  394. }
  395. @media (max-width: 460px) {
  396. input[type="checkbox"]:checked+.toggle::after {
  397. transform: translateX(1.4rem);
  398. }
  399. input[type="checkbox"]:checked:hover+.toggle::after {
  400. transform: translateX(1.4rem) scale(1.1);
  401. }
  402. }
  403. @media (max-width: 400px) {
  404. #app h1 {
  405. font-size: 1.6rem;
  406. }
  407. input[type="checkbox"]:checked+.toggle::after {
  408. transform: translateX(1.3rem);
  409. }
  410. input[type="checkbox"]:checked:hover+.toggle::after {
  411. transform: translateX(1.3rem) scale(1.1);
  412. }
  413. }
  414. @media (max-width: 340px) {
  415. input[type="checkbox"]:checked+.toggle::after {
  416. transform: translateX(0.9rem);
  417. }
  418. input[type="checkbox"]:checked:hover+.toggle::after {
  419. transform: translateX(0.9rem) scale(1.075);
  420. }
  421. }
  422. </style>
  423. <script>
  424. $(function () {
  425. let $select2 = $('.select2').select2({
  426. containerCssClass: "wrap"
  427. })
  428. function triggerEvent(name, val) {
  429. let selected = $("select[name='" + name + "']")
  430. let change = new Event('change', { bubbles: true })
  431. selected[0].dispatchEvent(change)
  432. }
  433. $('.select2').on('select2:select', function (e) {
  434. triggerEvent(e.target.name, e.target.value)
  435. });
  436. })
  437. </script>
  438. </head>
  439. <body>
  440. <div id="app"></div>
  441. <script>
  442. (function (window) {
  443. "use strict";
  444. function Model() {
  445. this.title = `Module 12 SQL Challenge Rubric (Coding)`;
  446. this.categories = [
  447. {
  448. title: "Deliverables",
  449. subtitle: null,
  450. score: 0,
  451. questions: [
  452. {
  453. title: "Student submitted GitHub Repo containing application code",
  454. score: 10,
  455. type: "true false",
  456. message: "GitHub repo is empty",
  457. status: false
  458. }
  459. ]
  460. },
  461. {
  462. title: "Walkthrough Video",
  463. subtitle: null,
  464. score: 0,
  465. questions: [
  466. {
  467. title:
  468. "Student includes link to walkthrough video in README",
  469. score: 4,
  470. type: "true false",
  471. message:
  472. "Student does not include link to walkthrough video in README",
  473. status: false
  474. },
  475. {
  476. title: "Walkthrough video shows all of the technical acceptance criteria being met",
  477. score: 16,
  478. type: "likert",
  479. options: [
  480. {
  481. message: "Walkthrough video doesn't show any of the 8 technical acceptance criteria listed in the next section being met",
  482. score: 0
  483. },
  484. {
  485. message: "Walkthrough video only shows 1 of the 8 technical acceptance criteria listed in the next section being met",
  486. score: 2
  487. },
  488. {
  489. message: "Walkthrough video only shows 2 of the 8 technical acceptance criteria listed in the next section being met",
  490. score: 4
  491. },
  492. {
  493. message: "Walkthrough video only shows 3 of the 8 technical acceptance criteria listed in the next section being met",
  494. score: 6
  495. },
  496. {
  497. message: "Walkthrough video only shows 4 of the 8 technical acceptance criteria listed in the next section being met",
  498. score: 8
  499. },
  500. {
  501. message: "Walkthrough video only shows 5 of the 8 technical acceptance criteria listed in the next section being met",
  502. score: 10
  503. },
  504. {
  505. message: "Walkthrough video only shows 6 of the 8 technical acceptance criteria listed in the next section being met",
  506. score: 12
  507. },
  508. {
  509. message: "Walkthrough video only shows 7 of the 8 technical acceptance criteria listed in the next section being met",
  510. score: 14
  511. },
  512. {
  513. message: "Walkthrough video shows all of the 8 technical acceptance criteria listed in the next section being met",
  514. score: 16
  515. }
  516. ],
  517. message: "",
  518. status: false
  519. },
  520. {
  521. title:
  522. "Walkthrough video demonstrates how to invoke the application",
  523. score: 3,
  524. type: "true false",
  525. message: "Walkthrough video does not demonstrate how to invoke the application",
  526. status: false
  527. },
  528. {
  529. title:
  530. "Walkthrough video demonstrates a functional menu",
  531. score: 4,
  532. type: "true false",
  533. message: "Walkthrough video does not demonstrate a functional menu",
  534. status: false
  535. }
  536. ]
  537. },
  538. {
  539. title: "Technical Acceptance Criteria",
  540. subtitle:
  541. "Watch out for errors in the console from this point forward.",
  542. score: 0,
  543. questions: [
  544. {
  545. title:
  546. "Application follows table schema outlined in Challenge instructions",
  547. score: 5,
  548. type: "true false",
  549. message: "Application doesn't follow table schema outlined in Challenge instructions",
  550. status: false
  551. },
  552. {
  553. title:
  554. "Application allows users to add departments",
  555. score: 5,
  556. type: "true false",
  557. message:
  558. "Application doesn't allow users to add departments",
  559. status: false
  560. },
  561. {
  562. title:
  563. "Application allows users to add roles",
  564. score: 5,
  565. type: "true false",
  566. message:
  567. "Application doesn't allow users to add roles",
  568. status: false
  569. },
  570. {
  571. title:
  572. "Application allows users to add employees",
  573. score: 5,
  574. type: "true false",
  575. message:
  576. "Application doesn't allow users to add employees",
  577. status: false
  578. },
  579. {
  580. title: "Application allows users to view departments",
  581. score: 5,
  582. type: "true false",
  583. message: "Application doesn't allow users to view departments",
  584. status: false
  585. },
  586. {
  587. title: "Application allows users to view roles",
  588. score: 5,
  589. type: "true false",
  590. message: "Application doesn't allow users to view roles",
  591. status: false
  592. },
  593. {
  594. title: "Application allows users to view employees",
  595. score: 5,
  596. type: "true false",
  597. message: "Application doesn't allow users to view employees",
  598. status: false
  599. },
  600. {
  601. title: "Application allows users to update employee roles",
  602. score: 5,
  603. type: "true false",
  604. message: "Application doesn't allow users to update employee roles",
  605. status: false
  606. }
  607. ]
  608. },
  609. {
  610. title: "Repository Quality",
  611. subtitle: null,
  612. score: 0,
  613. questions: [
  614. {
  615. title: "Repository has a unique name",
  616. score: 2,
  617. type: "true false",
  618. message: "Repo doesn't have a unique name",
  619. status: false
  620. },
  621. {
  622. title:
  623. "Repository follows best practices for file structure and naming conventions",
  624. score: 2,
  625. type: "true false",
  626. message:
  627. "Code doesn't follow recommended file/folder structure",
  628. status: false
  629. },
  630. {
  631. title:
  632. "Repository follows best practices for class/id naming conventions, indentation, quality comments, etc.",
  633. score: 2,
  634. type: "true false",
  635. message:
  636. "Code doesn't follow good practices for class/id names, indentation, lacks quality comments",
  637. status: false
  638. },
  639. {
  640. title:
  641. "Repository contains multiple descriptive commit messages",
  642. score: 2,
  643. type: "true false",
  644. message:
  645. "Repo doesn't contain multiple descriptive commit messages",
  646. status: false
  647. },
  648. {
  649. title: "Repository contains quality README with description and a link to walkthrough video",
  650. score: 5,
  651. type: "likert",
  652. options: [
  653. {
  654. message: "Repo doesn't contain a quality README with description and a link to walkthrough video",
  655. score: 0
  656. },
  657. {
  658. message: "Repository README is missing either the description or the link to the walkthrough video",
  659. score: 2
  660. },
  661. {
  662. message: "Repository contains quality README with description and a link to walkthrough video",
  663. score: 5
  664. }
  665. ],
  666. message: "",
  667. status: false
  668. }
  669. ]
  670. },
  671. {
  672. title: "Application Quality",
  673. subtitle: null,
  674. score: 0,
  675. questions: [
  676. {
  677. title: "Application user experience is intuitive and easy to navigate",
  678. score: 10,
  679. type: "likert",
  680. options: [
  681. {
  682. message: "Application user experience is not intuitive and easy to navigate",
  683. score: 0
  684. },
  685. {
  686. message: "Application user experience could be much more intuitive and easy to navigate",
  687. score: 4
  688. },
  689. {
  690. message: "Application user experience could be a lot more intuitive and easy to navigate",
  691. score: 8
  692. },
  693. {
  694. message: "Application user experience is intuitive and easy to navigate",
  695. score: 10
  696. }
  697. ],
  698. message: "",
  699. status: false
  700. }
  701. ]
  702. },
  703. {
  704. title: "Bonus",
  705. subtitle: null,
  706. score: 0,
  707. questions: [
  708. {
  709. title: "Application allows users to update an employee's managers",
  710. score: 2,
  711. type: "true false",
  712. message: "Application allows users to update an employee's managers",
  713. status: false
  714. },
  715. {
  716. title: "Application allows users to view employees by manager",
  717. score: 2,
  718. type: "true false",
  719. message: "Application allows users to view employees by manager",
  720. status: false
  721. },
  722. {
  723. title: "Application allows users to view employees by department",
  724. score: 2,
  725. type: "true false",
  726. message: "Application allows users to view employees by department",
  727. status: false
  728. },
  729. {
  730. title: "Application allows users to delete departments",
  731. score: 2,
  732. type: "true false",
  733. message: "Application allows users to delete departments",
  734. status: false
  735. },
  736. {
  737. title: "Application allows users to delete roles",
  738. score: 2,
  739. type: "true false",
  740. message: "Application allows users to delete roles",
  741. status: false
  742. },
  743. {
  744. title: "Application allows users to delete employees",
  745. score: 2,
  746. type: "true false",
  747. message: "Application allows users to delete employees",
  748. status: false
  749. },
  750. {
  751. title: "Application allows users to view the total utilized budget of a department (the combined salaries of all employees in that department)",
  752. score: 8,
  753. type: "true false",
  754. message: "Application allows users to view the total utilized budget of a department (the combined salaries of all employees in that department)",
  755. status: false
  756. }
  757. ]
  758. },
  759. {
  760. title: "Academic Integrity",
  761. subtitle:
  762. "If any of of the following are true, partner with your instructor to investigate plagiarism. Contact your SSM if you believe plagiarism has occurred.",
  763. score: 0,
  764. questions: [
  765. {
  766. title: "Application contains a low number of commits",
  767. score: 0,
  768. type: "true false",
  769. message: null,
  770. status: false
  771. },
  772. {
  773. title:
  774. "Application codebase appears advanced for the student, at this point in the course, or in general",
  775. score: 0,
  776. type: "true false",
  777. message: null,
  778. status: false
  779. },
  780. {
  781. title:
  782. "Application package.json file references a different author and/or repository",
  783. score: 0,
  784. type: "true false",
  785. message: null,
  786. status: false
  787. },
  788. {
  789. title:
  790. "Application package.json file references much older versions of npm packages",
  791. score: 0,
  792. type: "true false",
  793. message: null,
  794. status: false
  795. }
  796. ]
  797. }
  798. ];
  799. this.initStorage();
  800. }
  801. Model.prototype.initStorage = function () {
  802. this.score = 0;
  803. this.questions = [];
  804. this.messages = new Set();
  805. this.flagged = new Set();
  806. this.isDarkMode =
  807. JSON.parse(localStorage.getItem("isDarkMode")) || false;
  808. this.categories
  809. .forEach(category => {
  810. category.score = 0;
  811. category.questions.forEach(question => {
  812. question.category = category.title;
  813. question.status = false;
  814. question.id = this.questions.length;
  815. question.flagged = category.title === "Academic Integrity";
  816. question.bonus = category.title === "Bonus";
  817. if (question.type === "likert") {
  818. question.message = question.options[0].message.split(" - ").pop();
  819. };
  820. let messageObj = {
  821. message: question.message,
  822. category: question.category
  823. };
  824. question.message && !question.bonus && this.messages.add(messageObj);
  825. this.questions.push(question);
  826. category.score += question.score;
  827. });
  828. });
  829. };
  830. Model.prototype.toggleDarkMode = function () {
  831. this.isDarkMode = !this.isDarkMode;
  832. localStorage.setItem("isDarkMode", this.isDarkMode);
  833. };
  834. Model.prototype.toggleRadio = function (radio) {
  835. const id = Number(radio.getAttribute("name"));
  836. const question = this.questions[id];
  837. const questionScore = document.querySelector("span[data-id='" + id + "']");
  838. const category = question.category;
  839. const categoryScore = document.querySelector("span[data-cat='" + category + "']");
  840. const resultsCategoryScore = document.querySelector("span[data-res-cat='" + category + "']");
  841. question.status = !question.status;
  842. if (question.status === true) {
  843. if (!question.bonus) {
  844. this.messages.forEach(message => {
  845. if (message.message === question.message) {
  846. this.messages.delete(message);
  847. }
  848. })
  849. } else {
  850. let messageObj = {
  851. message: question.message,
  852. category: category
  853. }
  854. this.messages.add(messageObj);
  855. }
  856. this.score += question.score;
  857. if (question.flagged) {
  858. this.flagged.add(question.id);
  859. }
  860. } else {
  861. if (question.flagged) {
  862. this.flagged.delete(question.id);
  863. }
  864. if (!question.bonus) {
  865. if (question.message) {
  866. let messageObj = {
  867. message: question.message,
  868. category: category
  869. }
  870. this.messages.add(messageObj);
  871. }
  872. } else {
  873. this.messages.forEach(message => {
  874. if (message.message === question.message) {
  875. this.messages.delete(message);
  876. }
  877. })
  878. }
  879. this.score -= question.score;
  880. }
  881. if (category !== "Academic Integrity") {
  882. if (question.status) {
  883. questionScore.textContent = question.score;
  884. } else {
  885. questionScore.textContent = 0;
  886. }
  887. const catQuestions = this.categories.filter(cat => cat.title === category)[0].questions;
  888. let categoryTotal = 0;
  889. catQuestions.forEach(question => {
  890. if (question.type === "true false") {
  891. if (question.status) {
  892. categoryTotal += question.score;
  893. }
  894. } else {
  895. let score = document.querySelector("select[name='" + question.id + "']").value;
  896. categoryTotal += parseInt(score);
  897. }
  898. })
  899. categoryScore.textContent = categoryTotal;
  900. resultsCategoryScore.textContent = categoryTotal;
  901. }
  902. };
  903. Model.prototype.handleSelect = function (select) {
  904. const id = Number(select.getAttribute("name"));
  905. const question = this.questions[id];
  906. const questionScore = document.querySelector("span[data-id='" + id + "']");
  907. const oldScore = questionScore.textContent;
  908. const category = question.category;
  909. const categoryScore = document.querySelector("span[data-cat='" + category + "']");
  910. const resultsCategoryScore = document.querySelector("span[data-res-cat='" + category + "']");
  911. let newMessage = select.selectedOptions[0].text.split(" - ").pop();
  912. if (newMessage === "Open this menu") {
  913. newMessage = select[1].text.split(" - ").pop();
  914. };
  915. if (question.type === "likert") {
  916. this.messages.forEach(item => {
  917. if (item.message === question.message) {
  918. this.messages.delete(item)
  919. }
  920. })
  921. question.message = newMessage;
  922. let messageObj = {
  923. message: newMessage,
  924. category: category
  925. }
  926. this.messages.add(messageObj);
  927. };
  928. this.score -= parseInt(oldScore);
  929. this.score += parseInt(select.value);
  930. questionScore.textContent = select.value;
  931. const catQuestions = this.categories.filter(cat => cat.title === category)[0].questions;
  932. let categoryTotal = 0;
  933. catQuestions.forEach(question => {
  934. if (question.type === "true false") {
  935. if (question.status) {
  936. categoryTotal += question.score;
  937. }
  938. } else {
  939. let score = document.querySelector("select[name='" + question.id + "']").value;
  940. categoryTotal += parseInt(score);
  941. }
  942. })
  943. categoryScore.textContent = categoryTotal;
  944. resultsCategoryScore.textContent = categoryTotal;
  945. };
  946. Model.prototype.calcGrade = function () {
  947. const roundedScore = Math.min(100, Math.ceil(this.score));
  948. let letterGrade = "";
  949. if (roundedScore >= 99.5) {
  950. letterGrade = "A+";
  951. } else if (roundedScore >= 94.5 && roundedScore <= 99.4) {
  952. letterGrade = "A";
  953. } else if (roundedScore >= 91.5 && roundedScore <= 94.4) {
  954. letterGrade = "A-";
  955. } else if (roundedScore >= 87.5 && roundedScore <= 91.4) {
  956. letterGrade = "B+";
  957. } else if (roundedScore >= 84.5 && roundedScore <= 87.4) {
  958. letterGrade = "B";
  959. } else if (roundedScore >= 81.5 && roundedScore <= 84.4) {
  960. letterGrade = "B-";
  961. } else if (roundedScore >= 77.5 && roundedScore <= 81.4) {
  962. letterGrade = "C+";
  963. } else if (roundedScore >= 74.5 && roundedScore <= 77.4) {
  964. letterGrade = "C";
  965. } else if (roundedScore >= 71.5 && roundedScore <= 74.4) {
  966. letterGrade = "C-";
  967. } else if (roundedScore >= 69.5 && roundedScore <= 71.4) {
  968. letterGrade = "D+";
  969. } else if (roundedScore >= 64.5 && roundedScore <= 69.4) {
  970. letterGrade = "D";
  971. } else if (roundedScore >= 61.5 && roundedScore <= 64.4) {
  972. letterGrade = "D-";
  973. } else {
  974. letterGrade = "F";
  975. }
  976. return letterGrade;
  977. };
  978. Model.prototype.hasFlags = function () {
  979. return this.flagged.size > 0;
  980. };
  981. function View(model) {
  982. this.model = model;
  983. this.generateHTML();
  984. this.cacheDom();
  985. }
  986. View.prototype.cacheDom = function () {
  987. this.darkModeToggle = document.querySelector("#dark-mode");
  988. this.radios = Array.from(
  989. document.querySelectorAll("input[type='radio']")
  990. );
  991. this.selects = Array.from(
  992. document.querySelectorAll("select")
  993. );
  994. this.totals = document.querySelector(".totals");
  995. this.grade = document.querySelector(".grade");
  996. this.alert = document.querySelector("div[role='alert']");
  997. this.summaryHeading = document.querySelector(".summary-heading");
  998. this.summary = document.querySelector(".summary");
  999. this.model.categories
  1000. .filter(category => category.title !== "Academic Integrity")
  1001. .map(category => {
  1002. let summary = category.title.replace(/\s+/g, '-').toLowerCase();
  1003. let summaryName = summary + "-summary";
  1004. return this[summaryName] = document.querySelector("." + summary);
  1005. })
  1006. this.resetButton = document.querySelector(".reset");
  1007. this.model.categories
  1008. .filter(category => category.title !== "Academic Integrity")
  1009. .map(category => {
  1010. let button = category.title.replace(/\s+/g, '-').toLowerCase();
  1011. let buttonName = "copyButton-" + button;
  1012. return this[buttonName] = document.querySelector(".copy-" + button);
  1013. })
  1014. };
  1015. View.prototype.createFieldset = function ({ title, id, score, status, category, type, options }) {
  1016. return `<fieldset class="input-group">
  1017. <legend>
  1018. <span class="title">${title}</span> ${category === "Academic Integrity" ? "" : "<span class='score'><span data-id='" + id + "' class='current-score'>0</span> / " + score + "</span>"}
  1019. </legend>
  1020. ${type === "true false" ?
  1021. `<div class="radio-group">
  1022. <input type="radio" name="${id}" id="${id}-true" value="true">
  1023. <label for="${id}-true">True</label>
  1024. </div>
  1025. <div class="radio-group">
  1026. <input type="radio" name="${id}" id="${id}-false" value="false" checked>
  1027. <label for="${id}-false">False</label>
  1028. </div>` :
  1029. `<div class="select-group">
  1030. <select name="${id}" class="select-lg select2 narrow wrap">
  1031. <option value="0" selected>Open this menu</option>
  1032. ${options.map(option => `<option value="${option.score}">${option.score} - ${option.message}</option>`)}
  1033. </select>
  1034. </div>`
  1035. }
  1036. </fieldset>`;
  1037. };
  1038. View.prototype.createCard = function ({ title, subtitle, questions, score }) {
  1039. return `<div class="card">
  1040. <div class="card-header"><h2>${title}</h2> ${title !== "Academic Integrity" ? "<span class='cat-score'><span data-cat='" + title + "'>0</span> / " + score + "</span>" : ""}</div>
  1041. ${subtitle ? `<h3>${subtitle}</h3>` : ""}
  1042. ${questions.map(child => this.createFieldset(child)).join("")}
  1043. </div>`;
  1044. };
  1045. View.prototype.createResults = function () {
  1046. return `<div class="card">
  1047. <h2>Recommended Grade: <span class="grade">F</span></h2>
  1048. <h2 class="totals">Total: (0/100)</h2>
  1049. <div class="d-none" role="alert">
  1050. You've selected <strong>True</strong> for one of more Academic
  1051. Integrity prompts and are advised to investigate plagiarism before
  1052. issuing a grade.
  1053. </div>
  1054. <div class="summary" aria-label="summary">
  1055. ${this.model.categories
  1056. .filter(category => category.title !== "Academic Integrity")
  1057. .map(category => {
  1058. let score = category.score;
  1059. let title = category.title;
  1060. let catClass = title.replace(/\s+/g, '-').toLowerCase();
  1061. return "<h2>" + title + "<span class='cat-score'><span data-res-cat='" + title + "'>0</span> / " + score + "</span></h2><pre class='" + catClass + "'>" + [...this.model.messages]
  1062. .filter(messageObj => messageObj.category === category.title)
  1063. .map(messageObj => `* ${messageObj.message}\n`)
  1064. .join("") + "</pre><button class='copy copy-" + catClass + "'>Copy To Clipboard</button>"
  1065. })
  1066. .join("")}
  1067. </div>
  1068. <div class="btn-container">
  1069. <button class="reset">Reset Form</button>
  1070. </div>
  1071. </div>`;
  1072. };
  1073. View.prototype.createHeader = function (title, isDarkMode = false) {
  1074. return `<header>
  1075. <h1>${title}</h1>
  1076. <div class="switch-group">
  1077. <input type="checkbox" name="dark-mode" id="dark-mode" ${isDarkMode ? "checked" : ""
  1078. }>
  1079. <label aria-label="dark mode" for="dark-mode" class="toggle">
  1080. </label>
  1081. </div>
  1082. </header>`;
  1083. };
  1084. View.prototype.generateHTML = function () {
  1085. this.wrapper = document.querySelector("#app");
  1086. if (this.model.isDarkMode) {
  1087. this.wrapper.classList.add("dark");
  1088. }
  1089. const survey = this.model.categories.reduce((final, current) => {
  1090. final += this.createCard(current);
  1091. return final;
  1092. }, "");
  1093. const results = this.createResults();
  1094. const header = this.createHeader(
  1095. this.model.title,
  1096. this.model.isDarkMode
  1097. );
  1098. this.wrapper.innerHTML = header + survey + results;
  1099. };
  1100. View.prototype.update = function () {
  1101. const roundedScore = Math.min(100, Math.ceil(this.model.score));
  1102. this.totals.textContent = `Total: (${roundedScore}/ 100)`;
  1103. const letterGrade = this.model.calcGrade();
  1104. this.grade.textContent = letterGrade;
  1105. if (this.model.hasFlags()) {
  1106. this.alert.classList.remove("d-none");
  1107. } else {
  1108. this.alert.classList.add("d-none");
  1109. }
  1110. if (this.model.isDarkMode) {
  1111. this.wrapper.classList.add("dark");
  1112. } else {
  1113. this.wrapper.classList.remove("dark");
  1114. }
  1115. this.model.categories
  1116. .filter(category => category.title !== "Academic Integrity")
  1117. .forEach(category => {
  1118. let catClass = category.title.replace(/\s+/g, '-').toLowerCase();
  1119. this[catClass + "-summary"].innerHTML = [...this.model.messages]
  1120. .filter(messageObj => messageObj.category === category.title)
  1121. .map(messageObj => `* ${messageObj.message}\n`)
  1122. .join("")
  1123. })
  1124. };
  1125. function Controller(model, view) {
  1126. this.model = model;
  1127. this.view = view;
  1128. this.addEventListeners();
  1129. }
  1130. Controller.prototype.addEventListeners = function () {
  1131. this.view.wrapper.addEventListener("change", event => {
  1132. const { target } = event;
  1133. if (target.name !== "dark-mode") {
  1134. if (!target.matches("input[type='radio']")) {
  1135. this.model.handleSelect(target);
  1136. } else {
  1137. this.model.toggleRadio(target);
  1138. }
  1139. }
  1140. this.view.update();
  1141. });
  1142. this.view.resetButton.addEventListener("click", () => {
  1143. this.model.initStorage();
  1144. this.view.radios.forEach(
  1145. radio => (radio.checked = radio.hasAttribute("checked"))
  1146. );
  1147. this.view.selects.forEach(
  1148. select => select.selectedIndex = null
  1149. )
  1150. this.model.questions
  1151. .filter(question => question.category !== "Academic Integrity")
  1152. .forEach(question => {
  1153. const id = question.id;
  1154. const questionScore = document.querySelector("span[data-id='" + id + "']");
  1155. questionScore.textContent = 0;
  1156. });
  1157. this.model.categories
  1158. .filter(category => category.title !== "Academic Integrity")
  1159. .forEach(category => {
  1160. const title = category.title
  1161. const categoryScore = document.querySelector("span[data-cat='" + title + "']");
  1162. const resultsCategoryScore = document.querySelector("span[data-res-cat='" + title + "']");
  1163. categoryScore.textContent = 0;
  1164. resultsCategoryScore.textContent = 0;
  1165. });
  1166. this.view.update();
  1167. window.scrollTo(0, 0);
  1168. });
  1169. this.model.categories
  1170. .filter(category => category.title !== "Academic Integrity")
  1171. .forEach(category => {
  1172. let title = category.title.replace(/\s+/g, '-').toLowerCase();
  1173. let buttonName = "copyButton-" + title;
  1174. let summaryName = title + "-summary";
  1175. this.view[buttonName].addEventListener("click", () => {
  1176. const selection = window.getSelection();
  1177. const range = document.createRange();
  1178. range.selectNodeContents(this.view[summaryName]);
  1179. selection.removeAllRanges();
  1180. selection.addRange(range);
  1181. document.execCommand("copy");
  1182. });
  1183. });
  1184. this.view.darkModeToggle.addEventListener("change", () => {
  1185. this.model.toggleDarkMode();
  1186. this.view.update();
  1187. });
  1188. };
  1189. function App(Model, View, Controller) {
  1190. this.model = new Model();
  1191. this.view = new View(this.model);
  1192. this.controller = new Controller(this.model, this.view);
  1193. }
  1194. return new App(Model, View, Controller);
  1195. })(window);
  1196. </script>
  1197. </body>
  1198. </html>