fsf21.html 56 KB

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