fsf12.html 44 KB

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