mod13.html 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430
  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 13 ORM 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 13 ORM 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: 6,
  470. type: "true false",
  471. message:
  472. "Student does not include link to walkthrough video in README",
  473. status: false
  474. },
  475. {
  476. title:
  477. "Walkthrough video shows all of the technical acceptance criteria being met",
  478. score: 10,
  479. type: "true false",
  480. message:
  481. "Walkthrough video doesn't show all of the technical acceptance criteria being met",
  482. status: false
  483. },
  484. {
  485. title:
  486. "Walkthrough video demonstrates how to create the schema from the MySQL shell",
  487. score: 2,
  488. type: "true false",
  489. message: "Walkthrough video does not demonstrate how to create the schema from the MySQL shell",
  490. status: false
  491. },
  492. {
  493. title:
  494. "Walkthrough video demonstrates how to seed the database from the command line",
  495. score: 2,
  496. type: "true false",
  497. message: "Walkthrough video does not demonstrate how to seed the database from the command line",
  498. status: false
  499. },
  500. {
  501. title:
  502. "Walkthrough video demonstrates how to start the server",
  503. score: 2,
  504. type: "true false",
  505. message: "Walkthrough video does not demonstrate how to start the server",
  506. status: false
  507. },
  508. {
  509. title: "Walkthrough video demonstrates GET routes for all categories, all products, and all tags being tested in Insomnia",
  510. score: 5,
  511. type: "likert",
  512. options: [
  513. {
  514. message: "Walkthrough video does not demonstrate GET routes for all categories, all products, and all tags being tested in Insomnia",
  515. score: 0
  516. },
  517. {
  518. message: "Walkthrough video demonstrates GET routes for 1 of the 3 following being tested in Insomnia: all categories, all products, and all tags",
  519. score: 1
  520. },
  521. {
  522. message: "Walkthrough video demonstrates GET routes for 2 of the 3 following being tested in Insomnia: all categories, all products, and all tags",
  523. score: 3
  524. },
  525. {
  526. message: "Walkthrough video demonstrates GET routes for all categories, all products, and all tags being tested in Insomnia",
  527. score: 5
  528. }
  529. ],
  530. message: "",
  531. status: false
  532. },
  533. {
  534. title: "Walkthrough video demonstrates GET routes for a single category, a single product, and a single tag being tested in Insomnia",
  535. score: 5,
  536. type: "likert",
  537. options: [
  538. {
  539. message: "Walkthrough video does not demonstrate GET routes for a single category, a single product, and a single tag being tested in Insomnia",
  540. score: 0
  541. },
  542. {
  543. message: "Walkthrough video demonstrates GET routes for 1 of the 3 following being tested in Insomnia: a single category, a single product, and a single tag",
  544. score: 1
  545. },
  546. {
  547. message: "Walkthrough video demonstrates GET routes for 2 of the 3 following being tested in Insomnia: a single category, a single product, and a single tag",
  548. score: 3
  549. },
  550. {
  551. message: "Walkthrough video demonstrates GET routes for a single category, a single product, and a single tag being tested in Insomnia",
  552. score: 5
  553. }
  554. ],
  555. message: "",
  556. status: false
  557. },
  558. {
  559. title: "Walkthrough video demonstrates POST, PUT, and DELETE routes for categories, products, and tags being tested in Insomnia",
  560. score: 5,
  561. type: "likert",
  562. options: [
  563. {
  564. message: "Walkthrough video does not demonstrate POST, PUT, and DELETE routes for categories, products, and tags being tested in Insomnia",
  565. score: 0
  566. },
  567. {
  568. message: "Walkthrough video demonstrates POST, PUT, and DELETE routes for 1 of the 3 following being tested in Insomnia: categories, products, and tags",
  569. score: 1
  570. },
  571. {
  572. message: "Walkthrough video demonstrates POST, PUT, and DELETE routes for 2 of the 3 following being tested in Insomnia: categories, products, and tags",
  573. score: 3
  574. },
  575. {
  576. message: "Walkthrough video demonstrates POST, PUT, and DELETE routes for categories, products, and tags being tested in Insomnia",
  577. score: 5
  578. }
  579. ],
  580. message: "",
  581. status: false
  582. }
  583. ]
  584. },
  585. {
  586. title: "Technical Acceptance Criteria",
  587. subtitle:
  588. "Watch out for errors in the console from this point forward.",
  589. score: 0,
  590. questions: [
  591. {
  592. title:
  593. "Application syncs Sequelize models to MySQL database on server start",
  594. score: 5,
  595. type: "true false",
  596. message:
  597. "Application doesn't sync Sequelize models to MySQL database on server start",
  598. status: false
  599. },
  600. {
  601. title: "Application includes column definitions for all 4 models that match Challenge instructions",
  602. score: 5,
  603. type: "likert",
  604. options: [
  605. {
  606. message: "Application doesn't include column definitions for all 4 models that match Challenge instructions",
  607. score: 0
  608. },
  609. {
  610. message: "Application includes column definitions for 1 of the 4 models that match Challenge instructions",
  611. score: 1
  612. },
  613. {
  614. message: "Application includes column definitions for 2 of the 4 models that match Challenge instructions",
  615. score: 2
  616. },
  617. {
  618. message: "Application includes column definitions for 3 of the 4 models that match Challenge instructions",
  619. score: 3
  620. },
  621. {
  622. message: "Application includes column definitions for all 4 models that match Challenge instructions",
  623. score: 5
  624. }
  625. ],
  626. message: "",
  627. status: false
  628. },
  629. {
  630. title:
  631. "Application includes model associations that match Challenge instructions",
  632. score: 5,
  633. type: "true false",
  634. message:
  635. "Application doesn't include model associations that match Challenge instructions",
  636. status: false
  637. },
  638. {
  639. title: "Application includes GET routes that return all categories, all products, and all tags",
  640. score: 5,
  641. type: "likert",
  642. options: [
  643. {
  644. message: "Application doesn't include GET routes that return all categories, all products, and all tags",
  645. score: 0
  646. },
  647. {
  648. message: "Application includes GET routes that return 1 of the 3 following: all categories, all products, and all tags",
  649. score: 1
  650. },
  651. {
  652. message: "Application includes GET routes that return 2 of the 3 following: all categories, all products, and all tags",
  653. score: 3
  654. },
  655. {
  656. message: "Application includes GET routes that return all categories, all products, and all tags",
  657. score: 5
  658. }
  659. ],
  660. message: "",
  661. status: false
  662. },
  663. {
  664. title: "Application includes GET routes that return a single category, a single product, and a single tag",
  665. score: 5,
  666. type: "likert",
  667. options: [
  668. {
  669. message: "Application doesn't include GET routes that return a single category, a single product, and a single tag",
  670. score: 0
  671. },
  672. {
  673. message: "Application includes GET routes that return 1 of the 3 following: a single category, a single product, and a single tag",
  674. score: 1
  675. },
  676. {
  677. message: "Application includes GET routes that return 2 of the 3 following: a single category, a single product, and a single tag",
  678. score: 3
  679. },
  680. {
  681. message: "Application includes GET routes that return a single category, a single product, and a single tag",
  682. score: 5
  683. }
  684. ],
  685. message: "",
  686. status: false
  687. },
  688. {
  689. title: "Application includes POST routes that can create a new category, a new product, or a new tag",
  690. score: 5,
  691. type: "likert",
  692. options: [
  693. {
  694. message: "Application doesn't include POST routes that can create a new category, a new product, or a new tag",
  695. score: 0
  696. },
  697. {
  698. message: "Application includes POST routes that can create 1 of the 3 following: a new category, a new product, or a new tag",
  699. score: 1
  700. },
  701. {
  702. message: "Application includes POST routes that can create 2 of the 3 following: a new category, a new product, or a new tag",
  703. score: 3
  704. },
  705. {
  706. message: "Application includes POST routes that can create a new category, a new product, or a new tag",
  707. score: 5
  708. }
  709. ],
  710. message: "",
  711. status: false
  712. },
  713. {
  714. title: "Application includes PUT routes that can update a category, a product, or a tag",
  715. score: 5,
  716. type: "likert",
  717. options: [
  718. {
  719. message: "Application doesn't include PUT routes that can update a category, a product, or a tag",
  720. score: 0
  721. },
  722. {
  723. message: "Application includes PUT routes that can update 1 of the 3 following: a category, a product, or a tag",
  724. score: 1
  725. },
  726. {
  727. message: "Application includes PUT routes that can update 2 of the 3 following: a category, a product, or a tag",
  728. score: 3
  729. },
  730. {
  731. message: "Application includes PUT routes that can update a category, a product, or a tag",
  732. score: 5
  733. }
  734. ],
  735. message: "",
  736. status: false
  737. },
  738. {
  739. title: "Application includes DELETE routes that can delete a category, a product, or a tag",
  740. score: 5,
  741. type: "likert",
  742. options: [
  743. {
  744. message: "Application doesn't include DELETE routes that can delete a category, a product, or a tag",
  745. score: 0
  746. },
  747. {
  748. message: "Application includes DELETE routes that can delete 1 of the 3 following: a category, a product, or a tag",
  749. score: 1
  750. },
  751. {
  752. message: "Application includes DELETE routes that can delete 2 of the 3 following: a category, a product, or a tag",
  753. score: 3
  754. },
  755. {
  756. message: "Application includes DELETE routes that can delete a category, a product, or a tag",
  757. score: 5
  758. }
  759. ],
  760. message: "",
  761. status: false
  762. }
  763. ]
  764. },
  765. {
  766. title: "Repository Quality",
  767. subtitle: null,
  768. score: 0,
  769. questions: [
  770. {
  771. title: "Repository has a unique name",
  772. score: 2,
  773. type: "true false",
  774. message: "Repo doesn't have a unique name",
  775. status: false
  776. },
  777. {
  778. title:
  779. "Repository follows best practices for file structure and naming conventions",
  780. score: 2,
  781. type: "true false",
  782. message:
  783. "Code doesn't follow recommended file/folder structure",
  784. status: false
  785. },
  786. {
  787. title:
  788. "Repository follows best practices for class/id naming conventions, indentation, quality comments, etc.",
  789. score: 2,
  790. type: "true false",
  791. message:
  792. "Code doesn't follow good practices for class/id names, indentation, lacks quality comments",
  793. status: false
  794. },
  795. {
  796. title:
  797. "Repository contains multiple descriptive commit messages",
  798. score: 2,
  799. type: "true false",
  800. message:
  801. "Repo doesn't contain multiple descriptive commit messages",
  802. status: false
  803. },
  804. {
  805. title: "Repository contains quality README with description and a link to walkthrough video",
  806. score: 5,
  807. type: "likert",
  808. options: [
  809. {
  810. message: "Repo doesn't contain a quality README with description and a link to walkthrough video",
  811. score: 0
  812. },
  813. {
  814. message: "Repository README is missing either the description or the link to the walkthrough video",
  815. score: 2
  816. },
  817. {
  818. message: "Repository contains quality README with description and a link to walkthrough video",
  819. score: 5
  820. }
  821. ],
  822. message: "",
  823. status: false
  824. }
  825. ]
  826. },
  827. {
  828. title: "Academic Integrity",
  829. subtitle:
  830. "If any of of the following are true, partner with your instructor to investigate plagiarism. Contact your SSM if you believe plagiarism has occurred.",
  831. score: 0,
  832. questions: [
  833. {
  834. title: "Application contains a low number of commits",
  835. score: 0,
  836. type: "true false",
  837. message: null,
  838. status: false
  839. },
  840. {
  841. title:
  842. "Application codebase appears advanced for the student, at this point in the course, or in general",
  843. score: 0,
  844. type: "true false",
  845. message: null,
  846. status: false
  847. },
  848. {
  849. title:
  850. "Application package.json file references a different author and/or repository",
  851. score: 0,
  852. type: "true false",
  853. message: null,
  854. status: false
  855. },
  856. {
  857. title:
  858. "Application package.json file references much older versions of npm packages",
  859. score: 0,
  860. type: "true false",
  861. message: null,
  862. status: false
  863. }
  864. ]
  865. }
  866. ];
  867. this.initStorage();
  868. }
  869. Model.prototype.initStorage = function () {
  870. this.score = 0;
  871. this.questions = [];
  872. this.messages = new Set();
  873. this.flagged = new Set();
  874. this.isDarkMode =
  875. JSON.parse(localStorage.getItem("isDarkMode")) || false;
  876. this.categories
  877. .forEach(category => {
  878. category.score = 0;
  879. category.questions.forEach(question => {
  880. question.category = category.title;
  881. question.status = false;
  882. question.id = this.questions.length;
  883. question.flagged = category.title === "Academic Integrity";
  884. question.bonus = category.title === "Bonus";
  885. if (question.type === "likert") {
  886. question.message = question.options[0].message.split(" - ").pop();
  887. };
  888. let messageObj = {
  889. message: question.message,
  890. category: question.category
  891. };
  892. question.message && !question.bonus && this.messages.add(messageObj);
  893. this.questions.push(question);
  894. category.score += question.score;
  895. });
  896. });
  897. };
  898. Model.prototype.toggleDarkMode = function () {
  899. this.isDarkMode = !this.isDarkMode;
  900. localStorage.setItem("isDarkMode", this.isDarkMode);
  901. };
  902. Model.prototype.toggleRadio = function (radio) {
  903. const id = Number(radio.getAttribute("name"));
  904. const question = this.questions[id];
  905. const questionScore = document.querySelector("span[data-id='" + id + "']");
  906. const category = question.category;
  907. const categoryScore = document.querySelector("span[data-cat='" + category + "']");
  908. const resultsCategoryScore = document.querySelector("span[data-res-cat='" + category + "']");
  909. question.status = !question.status;
  910. if (question.status === true) {
  911. if (!question.bonus) {
  912. this.messages.forEach(message => {
  913. if (message.message === question.message) {
  914. this.messages.delete(message);
  915. }
  916. })
  917. } else {
  918. let messageObj = {
  919. message: question.message,
  920. category: category
  921. }
  922. this.messages.add(messageObj);
  923. }
  924. this.score += question.score;
  925. if (question.flagged) {
  926. this.flagged.add(question.id);
  927. }
  928. } else {
  929. if (question.flagged) {
  930. this.flagged.delete(question.id);
  931. }
  932. if (!question.bonus) {
  933. if (question.message) {
  934. let messageObj = {
  935. message: question.message,
  936. category: category
  937. }
  938. this.messages.add(messageObj);
  939. }
  940. } else {
  941. this.messages.forEach(message => {
  942. if (message.message === question.message) {
  943. this.messages.delete(message);
  944. }
  945. })
  946. }
  947. this.score -= question.score;
  948. }
  949. if (category !== "Academic Integrity") {
  950. if (question.status) {
  951. questionScore.textContent = question.score;
  952. } else {
  953. questionScore.textContent = 0;
  954. }
  955. const catQuestions = this.categories.filter(cat => cat.title === category)[0].questions;
  956. let categoryTotal = 0;
  957. catQuestions.forEach(question => {
  958. if (question.type === "true false") {
  959. if (question.status) {
  960. categoryTotal += question.score;
  961. }
  962. } else {
  963. let score = document.querySelector("select[name='" + question.id + "']").value;
  964. categoryTotal += parseInt(score);
  965. }
  966. })
  967. categoryScore.textContent = categoryTotal;
  968. resultsCategoryScore.textContent = categoryTotal;
  969. }
  970. };
  971. Model.prototype.handleSelect = function (select) {
  972. const id = Number(select.getAttribute("name"));
  973. const question = this.questions[id];
  974. const questionScore = document.querySelector("span[data-id='" + id + "']");
  975. const oldScore = questionScore.textContent;
  976. const category = question.category;
  977. const categoryScore = document.querySelector("span[data-cat='" + category + "']");
  978. const resultsCategoryScore = document.querySelector("span[data-res-cat='" + category + "']");
  979. let newMessage = select.selectedOptions[0].text.split(" - ").pop();
  980. if (newMessage === "Open this menu") {
  981. newMessage = select[1].text.split(" - ").pop();
  982. };
  983. if (question.type === "likert") {
  984. this.messages.forEach(item => {
  985. if (item.message === question.message) {
  986. this.messages.delete(item)
  987. }
  988. })
  989. question.message = newMessage;
  990. let messageObj = {
  991. message: newMessage,
  992. category: category
  993. }
  994. this.messages.add(messageObj);
  995. };
  996. this.score -= parseInt(oldScore);
  997. this.score += parseInt(select.value);
  998. questionScore.textContent = select.value;
  999. const catQuestions = this.categories.filter(cat => cat.title === category)[0].questions;
  1000. let categoryTotal = 0;
  1001. catQuestions.forEach(question => {
  1002. if (question.type === "true false") {
  1003. if (question.status) {
  1004. categoryTotal += question.score;
  1005. }
  1006. } else {
  1007. let score = document.querySelector("select[name='" + question.id + "']").value;
  1008. categoryTotal += parseInt(score);
  1009. }
  1010. })
  1011. categoryScore.textContent = categoryTotal;
  1012. resultsCategoryScore.textContent = categoryTotal;
  1013. };
  1014. Model.prototype.calcGrade = function () {
  1015. const roundedScore = Math.min(100, Math.ceil(this.score));
  1016. let letterGrade = "";
  1017. if (roundedScore >= 99.5) {
  1018. letterGrade = "A+";
  1019. } else if (roundedScore >= 94.5 && roundedScore <= 99.4) {
  1020. letterGrade = "A";
  1021. } else if (roundedScore >= 91.5 && roundedScore <= 94.4) {
  1022. letterGrade = "A-";
  1023. } else if (roundedScore >= 87.5 && roundedScore <= 91.4) {
  1024. letterGrade = "B+";
  1025. } else if (roundedScore >= 84.5 && roundedScore <= 87.4) {
  1026. letterGrade = "B";
  1027. } else if (roundedScore >= 81.5 && roundedScore <= 84.4) {
  1028. letterGrade = "B-";
  1029. } else if (roundedScore >= 77.5 && roundedScore <= 81.4) {
  1030. letterGrade = "C+";
  1031. } else if (roundedScore >= 74.5 && roundedScore <= 77.4) {
  1032. letterGrade = "C";
  1033. } else if (roundedScore >= 71.5 && roundedScore <= 74.4) {
  1034. letterGrade = "C-";
  1035. } else if (roundedScore >= 69.5 && roundedScore <= 71.4) {
  1036. letterGrade = "D+";
  1037. } else if (roundedScore >= 64.5 && roundedScore <= 69.4) {
  1038. letterGrade = "D";
  1039. } else if (roundedScore >= 61.5 && roundedScore <= 64.4) {
  1040. letterGrade = "D-";
  1041. } else {
  1042. letterGrade = "F";
  1043. }
  1044. return letterGrade;
  1045. };
  1046. Model.prototype.hasFlags = function () {
  1047. return this.flagged.size > 0;
  1048. };
  1049. function View(model) {
  1050. this.model = model;
  1051. this.generateHTML();
  1052. this.cacheDom();
  1053. }
  1054. View.prototype.cacheDom = function () {
  1055. this.darkModeToggle = document.querySelector("#dark-mode");
  1056. this.radios = Array.from(
  1057. document.querySelectorAll("input[type='radio']")
  1058. );
  1059. this.selects = Array.from(
  1060. document.querySelectorAll("select")
  1061. );
  1062. this.totals = document.querySelector(".totals");
  1063. this.grade = document.querySelector(".grade");
  1064. this.alert = document.querySelector("div[role='alert']");
  1065. this.summaryHeading = document.querySelector(".summary-heading");
  1066. this.summary = document.querySelector(".summary");
  1067. this.model.categories
  1068. .filter(category => category.title !== "Academic Integrity")
  1069. .map(category => {
  1070. let summary = category.title.replace(/\s+/g, '-').toLowerCase();
  1071. let summaryName = summary + "-summary";
  1072. return this[summaryName] = document.querySelector("." + summary);
  1073. })
  1074. this.resetButton = document.querySelector(".reset");
  1075. this.model.categories
  1076. .filter(category => category.title !== "Academic Integrity")
  1077. .map(category => {
  1078. let button = category.title.replace(/\s+/g, '-').toLowerCase();
  1079. let buttonName = "copyButton-" + button;
  1080. return this[buttonName] = document.querySelector(".copy-" + button);
  1081. })
  1082. };
  1083. View.prototype.createFieldset = function ({ title, id, score, status, category, type, options }) {
  1084. return `<fieldset class="input-group">
  1085. <legend>
  1086. <span class="title">${title}</span> ${category === "Academic Integrity" ? "" : "<span class='score'><span data-id='" + id + "' class='current-score'>0</span> / " + score + "</span>"}
  1087. </legend>
  1088. ${type === "true false" ?
  1089. `<div class="radio-group">
  1090. <input type="radio" name="${id}" id="${id}-true" value="true">
  1091. <label for="${id}-true">True</label>
  1092. </div>
  1093. <div class="radio-group">
  1094. <input type="radio" name="${id}" id="${id}-false" value="false" checked>
  1095. <label for="${id}-false">False</label>
  1096. </div>` :
  1097. `<div class="select-group">
  1098. <select name="${id}" class="select-lg select2 narrow wrap">
  1099. <option value="0" selected>Open this menu</option>
  1100. ${options.map(option => `<option value="${option.score}">${option.score} - ${option.message}</option>`)}
  1101. </select>
  1102. </div>`
  1103. }
  1104. </fieldset>`;
  1105. };
  1106. View.prototype.createCard = function ({ title, subtitle, questions, score }) {
  1107. return `<div class="card">
  1108. <div class="card-header"><h2>${title}</h2> ${title !== "Academic Integrity" ? "<span class='cat-score'><span data-cat='" + title + "'>0</span> / " + score + "</span>" : ""}</div>
  1109. ${subtitle ? `<h3>${subtitle}</h3>` : ""}
  1110. ${questions.map(child => this.createFieldset(child)).join("")}
  1111. </div>`;
  1112. };
  1113. View.prototype.createResults = function () {
  1114. return `<div class="card">
  1115. <h2>Recommended Grade: <span class="grade">F</span></h2>
  1116. <h2 class="totals">Total: (0/100)</h2>
  1117. <div class="d-none" role="alert">
  1118. You've selected <strong>True</strong> for one of more Academic
  1119. Integrity prompts and are advised to investigate plagiarism before
  1120. issuing a grade.
  1121. </div>
  1122. <div class="summary" aria-label="summary">
  1123. ${this.model.categories
  1124. .filter(category => category.title !== "Academic Integrity")
  1125. .map(category => {
  1126. let score = category.score;
  1127. let title = category.title;
  1128. let catClass = title.replace(/\s+/g, '-').toLowerCase();
  1129. return "<h2>" + title + "<span class='cat-score'><span data-res-cat='" + title + "'>0</span> / " + score + "</span></h2><pre class='" + catClass + "'>" + [...this.model.messages]
  1130. .filter(messageObj => messageObj.category === category.title)
  1131. .map(messageObj => `* ${messageObj.message}\n`)
  1132. .join("") + "</pre><button class='copy copy-" + catClass + "'>Copy To Clipboard</button>"
  1133. })
  1134. .join("")}
  1135. </div>
  1136. <div class="btn-container">
  1137. <button class="reset">Reset Form</button>
  1138. </div>
  1139. </div>`;
  1140. };
  1141. View.prototype.createHeader = function (title, isDarkMode = false) {
  1142. return `<header>
  1143. <h1>${title}</h1>
  1144. <div class="switch-group">
  1145. <input type="checkbox" name="dark-mode" id="dark-mode" ${isDarkMode ? "checked" : ""
  1146. }>
  1147. <label aria-label="dark mode" for="dark-mode" class="toggle">
  1148. </label>
  1149. </div>
  1150. </header>`;
  1151. };
  1152. View.prototype.generateHTML = function () {
  1153. this.wrapper = document.querySelector("#app");
  1154. if (this.model.isDarkMode) {
  1155. this.wrapper.classList.add("dark");
  1156. }
  1157. const survey = this.model.categories.reduce((final, current) => {
  1158. final += this.createCard(current);
  1159. return final;
  1160. }, "");
  1161. const results = this.createResults();
  1162. const header = this.createHeader(
  1163. this.model.title,
  1164. this.model.isDarkMode
  1165. );
  1166. this.wrapper.innerHTML = header + survey + results;
  1167. };
  1168. View.prototype.update = function () {
  1169. const roundedScore = Math.min(100, Math.ceil(this.model.score));
  1170. this.totals.textContent = `Total: (${roundedScore}/ 100)`;
  1171. const letterGrade = this.model.calcGrade();
  1172. this.grade.textContent = letterGrade;
  1173. if (this.model.hasFlags()) {
  1174. this.alert.classList.remove("d-none");
  1175. } else {
  1176. this.alert.classList.add("d-none");
  1177. }
  1178. if (this.model.isDarkMode) {
  1179. this.wrapper.classList.add("dark");
  1180. } else {
  1181. this.wrapper.classList.remove("dark");
  1182. }
  1183. this.model.categories
  1184. .filter(category => category.title !== "Academic Integrity")
  1185. .forEach(category => {
  1186. let catClass = category.title.replace(/\s+/g, '-').toLowerCase();
  1187. this[catClass + "-summary"].innerHTML = [...this.model.messages]
  1188. .filter(messageObj => messageObj.category === category.title)
  1189. .map(messageObj => `* ${messageObj.message}\n`)
  1190. .join("")
  1191. })
  1192. };
  1193. function Controller(model, view) {
  1194. this.model = model;
  1195. this.view = view;
  1196. this.addEventListeners();
  1197. }
  1198. Controller.prototype.addEventListeners = function () {
  1199. this.view.wrapper.addEventListener("change", event => {
  1200. const { target } = event;
  1201. if (target.name !== "dark-mode") {
  1202. if (!target.matches("input[type='radio']")) {
  1203. this.model.handleSelect(target);
  1204. } else {
  1205. this.model.toggleRadio(target);
  1206. }
  1207. }
  1208. this.view.update();
  1209. });
  1210. this.view.resetButton.addEventListener("click", () => {
  1211. this.model.initStorage();
  1212. this.view.radios.forEach(
  1213. radio => (radio.checked = radio.hasAttribute("checked"))
  1214. );
  1215. this.view.selects.forEach(
  1216. select => select.selectedIndex = null
  1217. )
  1218. this.model.questions
  1219. .filter(question => question.category !== "Academic Integrity")
  1220. .forEach(question => {
  1221. const id = question.id;
  1222. const questionScore = document.querySelector("span[data-id='" + id + "']");
  1223. questionScore.textContent = 0;
  1224. });
  1225. this.model.categories
  1226. .filter(category => category.title !== "Academic Integrity")
  1227. .forEach(category => {
  1228. const title = category.title
  1229. const categoryScore = document.querySelector("span[data-cat='" + title + "']");
  1230. const resultsCategoryScore = document.querySelector("span[data-res-cat='" + title + "']");
  1231. categoryScore.textContent = 0;
  1232. resultsCategoryScore.textContent = 0;
  1233. });
  1234. this.view.update();
  1235. window.scrollTo(0, 0);
  1236. });
  1237. this.model.categories
  1238. .filter(category => category.title !== "Academic Integrity")
  1239. .forEach(category => {
  1240. let title = category.title.replace(/\s+/g, '-').toLowerCase();
  1241. let buttonName = "copyButton-" + title;
  1242. let summaryName = title + "-summary";
  1243. this.view[buttonName].addEventListener("click", () => {
  1244. const selection = window.getSelection();
  1245. const range = document.createRange();
  1246. range.selectNodeContents(this.view[summaryName]);
  1247. selection.removeAllRanges();
  1248. selection.addRange(range);
  1249. document.execCommand("copy");
  1250. });
  1251. });
  1252. this.view.darkModeToggle.addEventListener("change", () => {
  1253. this.model.toggleDarkMode();
  1254. this.view.update();
  1255. });
  1256. };
  1257. function App(Model, View, Controller) {
  1258. this.model = new Model();
  1259. this.view = new View(this.model);
  1260. this.controller = new Controller(this.model, this.view);
  1261. }
  1262. return new App(Model, View, Controller);
  1263. })(window);
  1264. </script>
  1265. </body>
  1266. </html>