fsf13.html 62 KB

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