fsf22.html 44 KB

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