fsf10.html 39 KB

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