fe13.html 55 KB

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