fsf19.html 42 KB

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