mod21.html 56 KB

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