Best JavaScript code snippet using puppeteer
surveyViewer.js
Source:surveyViewer.js
1import * as actionTypes from '../actions/actionTypes';2import { updateObject } from '../../shared/utility';3const initialState = {4 answering: false,5 finished: false,6 currentQuestion: 0,7 answers: [],8 verified: [],9 survey: [10 {11 question: '1. ¿The timebox for a daily Scrum is?',12 options: {13 A: 'The same time of day every day',14 B: 'Two minutes per person',15 C: '4 hours',16 D: '15 minutes',17 E:18 '15 minutes for a 4 week sprint, proportionally less for shorter sprints.'19 },20 correct: ['D'],21 isMultiple: false22 },23 {24 question: '2. Which statement best describes Scrum?',25 options: {26 A:27 'A complete methodology that defines how to develop software',28 B:29 'A cookbook that defines best practices for a software development',30 C:31 'A framework within which complex products in complex environments are developed',32 D:33 'A defines and predictive process that conforms to the principles of Scientific Management'34 },35 correct: ['C'],36 isMultiple: false37 },38 {39 question:40 '3. What is the primary way a Scrum Master keeps a Development Team working at its highest level of productivity?',41 options: {42 A:43 'By facilitating Development Team Decisions and removing impediments',44 B: 'By ensuring the meetings start and end at the proper time',45 C:46 'By preventing changes to the Backlog once the Sprint begins',47 D: 'By keeping high value features high in the Product Backlog'48 },49 correct: ['A'],50 isMultiple: false51 },52 {53 question:54 "4. The CEO asks the Development Team to add a 'very important' item to the current Sprint. What should the development team do?",55 options: {56 A: 'Add the item to the current Sprint without any adjustments',57 B:58 'Add the items to the current Sprint and drop an item of equal size',59 C: 'Add the item to the next Sprint',60 D: 'Inform the product Owner so he/she can work with the CEO.'61 },62 correct: ['D'],63 isMultiple: false64 },65 {66 question:67 '5. Who should know the most about the progress toward a business objective or a release, and be able to explain the alternatives most clearly?',68 options: {69 A: 'The Product Owner',70 B: 'The Development Team',71 C: 'The Scrum Master',72 D: 'The Project Manager'73 },74 correct: ['A'],75 isMultiple: false76 },77 {78 question:79 '6. What does it mean to say that an event has a timebox?',80 options: {81 A: 'The event must happen at a set time.',82 B: 'The event must happen by a given time',83 C: 'The event must take at least a minimum amount of time',84 D: 'The event can take no more than a maximun amount of time'85 },86 correct: ['D'],87 isMultiple: false88 },89 {90 question:91 '7. Which two (2) things does the Development Team not do during the first Sprint?',92 options: {93 A:94 'Deliver an increment of potentially shippable functionality',95 B: 'Nail down the complete architecture and infraestructure',96 C: 'Develop and deliver at least one piece of functionality',97 D: 'Develop a plan for the rest of the project'98 },99 correct: ['B', 'D'],100 isMultiple: true101 },102 {103 question:104 '8. Development Team members volunteer to own a Sprint Backlog item:',105 options: {106 A: 'At the Sprint planning meeting.',107 B:108 "Never. All Sprint Backlog Items are 'Owned' by the entire Development Team, even though each one may be done by an individual team member.",109 C: 'Whenever a team can accommodate more work',110 D: 'During the Daily Scrum'111 },112 correct: ['B'],113 isMultiple: false114 },115 {116 question: "9. Scrum Master is a 'management' position?",117 options: {118 A: 'TRUE',119 B: 'FALSE'120 },121 correct: ['A'],122 isMultiple: false123 },124 {125 question:126 '10. The reason the Scrum Master is at the Daily Scrum is:',127 options: {128 A:129 'To make sure everyone answers the three questions in order of seniority',130 B:131 'He or she does not have to be there; he or she only has to ensure the Development Team has a Daily Scrum.',132 C:133 'To write any changes to the sprint Backlog, including adding new items, and tracking progress on the burndown.',134 D: 'So he or she knows what to report to management'135 },136 correct: ['B'],137 isMultiple: false138 },139 {140 question:141 '11. The Development Team should have all the skills needed to:',142 options: {143 A:144 'Complete the project as estimated when the date and cost are committed to the product owner.',145 B:146 'Do all the development work, but not the types of testing that require specialized testing, tools, and environments.',147 C:148 'Turn the Product Backlog items it selects into an increment of potentially shippable product functionality.'149 },150 correct: ['C'],151 isMultiple: false152 },153 {154 question: '12. ¿What is the maximum length of a Sprint?',155 options: {156 A:157 'Not so long that the risk is unacceptable to the Product Owner',158 B:159 "Not so long that other business events can't be readily synchronized with the development work.",160 C: 'No more than one calendar month.',161 D: 'All of these answers are correct.'162 },163 correct: ['D'],164 isMultiple: false165 },166 {167 question:168 '13. When the Development Team determines that it has over-committed itself for a Sprint, who has to be present when reviewing and adjusting the Sprint work selected?',169 options: {170 A: 'The Scrum Master, project manager and Development Team.',171 B: 'The Product Owner and Development Team.',172 C: 'The Product Owner and All stakeholders.',173 D: 'The Development Team.'174 },175 correct: ['B'],176 isMultiple: false177 },178 {179 question:180 '14. The development Team should not be interrupted during the Sprint. The work it selects for a Sprint should not be changed. The Sprint Goal should remain intact. All of these attributes of a Sprint foster creativity, quality and productivity. Based on this, which of the following is FALSE?',181 options: {182 A:183 'The Product Owner can help clarify or optimize the Sprint when asked by the Development Team.',184 B:185 'The Sprint Backlog and its contents are fully formulated in the Sprint Planning meeting and do not change during the Sprint.',186 C:187 'As a descomposition of the selected Product Backlog items, the Sprint Backlog changes and may grow as the work emerges.',188 D:189 'The Development Team may work with the Product Owner to remove or add work if it finds it has more or less capacity than it expected.'190 },191 correct: ['B'],192 isMultiple: false193 },194 {195 question:196 '15. ¿What is the recommended size for a Development Team (within the Scrum Team)?',197 options: {198 A: '3 plus or minus 1',199 B: '6 plus or minus 3',200 C: '9 plus or minus 2',201 D: '15 plus or minus 3'202 },203 correct: ['B'],204 isMultiple: false205 },206 {207 question: '16. ¿Who is required to attend the Daily Scrum?',208 options: {209 A: 'The Development Team',210 B: 'The Scrum Team',211 C: 'The Development Team and Scrum Master.',212 D: 'The Development Team and Product Owner',213 E: 'The Scrum Master and Product Owner.'214 },215 correct: ['A'],216 isMultiple: false217 },218 {219 question: '17. ¿Which of the below are roles on a Scrum Team?',220 options: {221 A: 'Development Team',222 B: 'Users',223 C: 'Customers',224 D: 'Product Owner',225 E: 'Scrum Master'226 },227 correct: ['A', 'D', 'E'],228 isMultiple: true229 },230 {231 question: '18. ¿Which statement best describes the Sprint Review?',232 options: {233 A: "It is a review of the team's during the Sprint.",234 B:235 'It is when the Scrum Team and Stakeholders inspect the outcome of the Sprint and figure out what to do in the upcoming Sprint.',236 C:237 'It is a demo at the end of the Sprint for everyone in the organization to provide feedback on the work done.',238 D:239 'It is used to congratulate the Development Team if it did what it committed to doing, or to punish the Development Team if it failed to meet its commitments.'240 },241 correct: ['B'],242 isMultiple: false243 },244 {245 question:246 "19. ¿Which statement best describes a Product Owner's responsibility?",247 options: {248 A:249 'Optimizing the Return on investment (ROI) and the Total Cost of ownership (TCO) of the work the Development Team does.',250 B: 'Directing the Development Team.',251 C:252 'Managing the project and ensuring that the work meets the commitments to the stakeholders.',253 D: 'Keeping stakeholders at bay.'254 },255 correct: ['A'],256 isMultiple: false257 },258 {259 question: "20. Scrum does not have a role called 'project manager'",260 options: {261 A: 'TRUE',262 B: 'FALSE'263 },264 correct: ['A'],265 isMultiple: false266 },267 {268 question:269 '21. Which of the following options is MOST accurate about Scrum',270 options: {271 A: 'Scrum optimize change',272 B: 'Scrum optimize quality',273 C: 'Scrum optimize a plan',274 D: 'Scrum optimize predictability'275 },276 correct: ['D'],277 isMultiple: false278 },279 {280 question:281 '22. Which of the following is NOT a characteristic of a Scrum Development Team? ',282 options: {283 A: 'Possesses all of the skills to create a product increment',284 B:285 'Determines how to turn a Product Backlog item into a product increment after the architecture and requirements are documented',286 C: 'Accountability is shared amongst all team members',287 D: 'There are not titles other than Developer'288 },289 correct: ['B'],290 isMultiple: false291 },292 {293 question:294 '23. How are the decisions of the Product Owner made visible? (select two)',295 options: {296 A: 'By the ordering in the Product Backlog',297 B: 'By the number of errors in the delivered product',298 C: 'By the quality of the delivered product',299 D: 'By the content in the Product Backlog'300 },301 correct: ['A', 'D'],302 isMultiple: true303 },304 {305 question:306 '24. Scrum Teams deliver products ________________ and _________________',307 options: {308 A: 'Iteratively, at lower costs',309 B: 'Iteratively, incrementally',310 C: 'Iteratively, without mistakes',311 D: 'Iteratively, waterfall way'312 },313 correct: ['B'],314 isMultiple: false315 },316 {317 question:318 '25. What are the risks of making a Sprint too long? (select two)',319 options: {320 A: 'Risk may increment',321 B: 'Focus increase',322 C: 'Complexity may increase',323 D: 'All of the above'324 },325 correct: ['A', 'C'],326 isMultiple: true327 },328 {329 question:330 '26. What does the Product Backlog management include? 1 Clearly expressing Product Backlog items. 2 Authoring Product Backlog items. 3 Ordering Product Backlog items by size and risk.',331 options: {332 A: 'Only 2',333 B: 'All of the above',334 C: 'Only 1',335 D: 'Only 3'336 },337 correct: ['C'],338 isMultiple: false339 },340 {341 question: '27. What is the result of Sprint Review?',342 options: {343 A: 'A revised Product Backlog',344 B: 'Critique on the development product increment',345 C: 'A completed Sprint Backlog',346 D: 'The Scrum Master´s documentation on the Sprint statistics'347 },348 correct: ['A'],349 isMultiple: false350 },351 {352 question:353 '28. During which Scrum event is the Sprint Goal crafted?',354 options: {355 A: 'Daily Scrum',356 B: 'Sprint Retrospective',357 C: 'Sprint Review',358 D: 'Sprint Planning'359 },360 correct: ['D'],361 isMultiple: false362 },363 {364 question:365 "29.What optimizes the Development Team's overall efficiency and effectiveness?",366 options: {367 A: 'Being focused on only small increments at a time',368 B:369 'Determining how they will complete a given Product Backlog item',370 C: 'Determining which Product Backlog item to pick each Sprint',371 D: 'Working in an agile development framework'372 },373 correct: ['B'],374 isMultiple: false375 },376 {377 question: '30.Please select which statement is the MOST accurate ',378 options: {379 A:380 'No one outside of the Scrum Team should be invited to the last session of Sprint Planning',381 B:382 'The development team may invite other people to the last session of Sprint Planning',383 C:384 'The Product Owner may invite other people to the last session of Sprint Planning',385 D:386 'The Scrum Master may invite other people to the last session of Sprint Planning'387 },388 correct: ['B'],389 isMultiple: false390 },391 {392 question:393 '31.The Scrum Master serves the organization in all of the following ways EXCEPT',394 options: {395 A:396 'Helping employees and stakeholders understand and enact Scrum and empirical product development',397 B:398 'Working with other Scrum Masters to increase the effectiveness of the application of Scrum in the organization',399 C:400 'Leading and coaching the organizations in its Scrum adoption',401 D: 'Tracking Scrum implementations within the organization'402 },403 correct: ['D'],404 isMultiple: false405 },406 {407 question:408 '32.How much work must a Development Team do to a Product Backlog item it selects for a Sprint?',409 options: {410 A:411 'As much as it has told the Product Owner will be done for every Product Backlog item it selects in conformance with the definition of done',412 B: 'As much as it can fit into the Sprint',413 C: 'All development work and at least some testing',414 D: 'Analysis, design, programming, testing and documentation'415 },416 correct: ['A'],417 isMultiple: false418 },419 {420 question: '33.Development Team membership should change:',421 options: {422 A: 'Every Sprint to promote shared learning.',423 B: 'Never, because it reduces productivity',424 C:425 'As needed, while taking into account a short term reduction in productivity',426 D:427 'As needed, with no special allowance for changes in productivity.'428 },429 correct: ['C'],430 isMultiple: false431 },432 {433 question:434 '34.During a Sprint, a Development Team determines that it will not be able to finish the complete forecast. Who should be present to review and adjust the Sprint work selected?',435 options: {436 A:437 'The Scrum Master, the project manager and the Development Team.',438 B: 'The Product Owner and the Development Team.',439 C: 'The Product Owner and all stakeholders',440 D: 'The Development Team.'441 },442 correct: ['B'],443 isMultiple: false444 },445 {446 question:447 '35.Who is responsible for managing the progress of work during a Sprint?',448 options: {449 A: 'The Development Team.',450 B: 'The Scrum Master',451 C: 'The Product Owner',452 D: 'The Project Manager'453 },454 correct: ['A'],455 isMultiple: false456 },457 {458 question:459 '36.When multiple teams work together on the same product, each team should maintain a separate Product Backlog.',460 options: {461 A: 'TRUE',462 B: 'FALSE'463 },464 correct: ['B'],465 isMultiple: false466 },467 {468 question:469 '37.The maximum length of the Sprint Review (its time-box) is:',470 options: {471 A: '15 minutes',472 B: 'As long as needed.',473 C:474 '4 hours for a monthly Sprint. For shorter Sprints it is usually shorter.',475 D: '1 day'476 },477 correct: ['C'],478 isMultiple: false479 },480 {481 question:482 '38.The purpose of the Sprint is to produce a done increment of working product.',483 options: {484 A: 'TRUE',485 B: 'FALSE'486 },487 correct: ['A'],488 isMultiple: false489 },490 {491 question: '39.The time-box for the Sprint Planning meeting is?',492 options: {493 A:494 '8 hours for a monthly Sprint. For shorter Sprints it is usually shorter.',495 B:496 '4 hours for a monthly Sprint. For shorter Sprints it is usually shorter.',497 C: 'Monthly',498 D: 'Daily'499 },500 correct: ['A'],501 isMultiple: false502 },503 {504 question: '40.When is a Sprint over?',505 options: {506 A:507 'When all Product Backlog items meet their definition of done',508 B: 'When the Product Owner says it is done.',509 C: 'When all the tasks are completed.',510 D: 'When the time-box expires'511 },512 correct: ['D'],513 isMultiple: false514 },515 {516 question: '41.When does the next Sprint begin?',517 options: {518 A: 'Every week',519 B: 'Immediately following the next Sprint Planning',520 C: 'When the Product Owner is ready.',521 D: 'Immediately after the conclusion of the previous Sprint.'522 },523 correct: ['D'],524 isMultiple: false525 },526 {527 question:528 '42.How is management external to the Scrum Team involved in the Daily Scrum?',529 options: {530 A: 'The product Owner represents their opinions.',531 B: 'The Scrum Master speaks on their behalf.',532 C:533 'The Development Team self-manages and is the only management required at the Daily Scrum',534 D:535 'Management gives an update at the start of each Daily Scrum.'536 },537 correct: ['C'],538 isMultiple: false539 },540 {541 question:542 '43.Choose two responsabilities of a self-organizing Development Team.',543 options: {544 A: 'Do the work planned in the Sprint Backlog.',545 B: 'Increase velocity',546 C: 'Report daily progress to stakeholders',547 D: 'Pull Product Backlog items for the Sprint.',548 E: 'Reorder the Product Backlog.'549 },550 correct: ['A', 'B'],551 isMultiple: true552 },553 {554 question:555 '44.What is the tactic a Scrum Master should use to divide a group of 100 people into multiple Development Team.',556 options: {557 A:558 'Create teams based on their skills across multiple layers(such as database, UI, etc.)',559 B: 'Ask the Product Owner to assign the people to teams.',560 C: 'Ask the developers to divide themselves into teams.'561 },562 correct: ['C'],563 isMultiple: false564 },565 {566 question:567 '45.In accordance with Scrum theory, how should a group of 100 people be divided into multiple Development Teams',568 options: {569 A:570 'Check with the allocation department to see who has worked together before and make these the first teams.',571 B:572 "It doesn't really matter because you can rotate the teams every Sprint to spread knowledge",573 C:574 'Create a matrix of skills, seniority, and level of experience to assign people to teams.',575 D:576 'Understanding the product, the product vision and the rules of the Scrum framework, the group divides itself into teams.'577 },578 correct: ['D'],579 isMultiple: false580 },581 {582 question:583 '46.What are three ways Scrum promotes self-organization?',584 options: {585 A:586 'By the Development Team deciding what work to do in a Sprint.',587 B: 'By not allowing documentation.',588 C: 'By removing titles for Development Team members.',589 D: 'By being a lightweight framework.',590 E:591 'By preventing stakeholders from entering the development room'592 },593 correct: ['A', 'C', 'D'],594 isMultiple: true595 },596 {597 question:598 '47.Which two of the following are true about the Scrum Master role?',599 options: {600 A:601 "At the Sprint Review, the Scrum Master identifies what has been 'done' and what has not been 'done'.",602 B:603 'The Scrum Master assigns tasks to Development Team members when they need work.',604 C:605 'The Scrum Master is responsible for updating the Sprint Burndown.',606 D:607 'The Scrum Master helps those outside the team interact with the Scrum Team.',608 E:609 'The Scrum Master teaches the Development Team to keep the Scrum meetings to their timebox.'610 },611 correct: ['D', 'E'],612 isMultiple: true613 },614 {615 question:616 '48. As the Development Team starts work during the Sprint, it realizes it has selected too much work to finish in the Sprint. What should it do?',617 options: {618 A: 'Find another Scrum Team to give the excess work to.',619 B:620 'Inform the Product Owner at the Sprint Review, but prior to the demonstration.',621 C:622 'As soon as possible in the Sprint, work with the product owner to remove some work or Product Backlog items.',623 D:624 "Reduce the definition of 'Done' and get all of the Product Backlog items 'done' by the new definition."625 },626 correct: ['C'],627 isMultiple: false628 },629 {630 question:631 '49. Which of these may a Development Team deliver at the end of a Sprint?',632 options: {633 A:634 'Falling unit tests, to identify acceptance tests for the next Sprint.',635 B: "An increment of working software that is 'done'.",636 C: 'An increment of software with minor known bugs in it.',637 D:638 'A single document, if that is what the Scrum Master asked for.'639 },640 correct: ['B'],641 isMultiple: false642 },643 {644 question:645 '50. How often should Development Team membership change?',646 options: {647 A: 'Every Sprint to promote shared learning.',648 B: 'Never, because it reduces productivity',649 C:650 'As needed, while taking into account a short term reduction in productivity',651 D:652 'As needed, with no special allowance for changes in productivity.'653 },654 correct: ['C'],655 isMultiple: false656 },657 {658 question: '51. Which are properties of the Daily Scrum?',659 options: {660 A: 'Its location and time should remain constant.',661 B: 'It is facilitated by the team lead.',662 C:663 'It consists of the Scrum Master asking the Team members the three questions.',664 D: 'It is fifteen minutes or less in duration.',665 E: 'It is held first thing in the morning.',666 F: 'It is free form and designed to promote conversation.'667 },668 correct: ['A', 'D'],669 isMultiple: true670 },671 {672 question: '52. The length of a Sprint should be:',673 options: {674 A:675 'Short enough to keep the business risk acceptable to the Product Owner.',676 B: 'No more than one calendar month.',677 C:678 'Short enough to be able to synchronize the development work with other business events',679 D: 'All of these answer are correct'680 },681 correct: ['D'],682 isMultiple: false683 },684 {685 question: '53. Who owns the Sprint Backlog?',686 options: {687 A: 'The Scrum Master',688 B: 'The Scrum Team',689 C: 'The development Team',690 D: 'The Product Owner'691 },692 correct: ['C'],693 isMultiple: false694 },695 {696 question:697 '54. The Product Owner is not collaborating with the Development Team during the Sprint.What are two actions for a Scrum Master to take?',698 options: {699 A:700 'Stop the Sprint, send the Product Owner to a course and restart',701 B: 'Bring up the problem in the Sprint Retrospective.',702 C:703 'Coach the Product Owner in the values of Scrum and incremental delivery.',704 D: "Inform the Product Owner's functional manager.",705 E: 'Nominate a proxy Product Owner.'706 },707 correct: ['B', 'C'],708 isMultiple: true709 },710 {711 question:712 '55. A Scrum Team is only allowed to meet with stakeholders during Sprint Review',713 options: {714 A: 'TRUE',715 B: 'FALSE'716 },717 correct: ['B'],718 isMultiple: false719 },720 {721 question:722 '56. What is the best suited structure for Development Teams in order to produce integrated Increments?',723 options: {724 A:725 'Each Development Team works only on one technical layer of the system(e.g. GUI, database, middle tier, interfaces)',726 B:727 'Each Development Team develops functionality from beginning to end throughout all technical layers'728 },729 correct: ['B'],730 isMultiple: false731 },732 {733 question:734 '57. A Scrum Master is working with a Development Team that has members in different physical locations. The Development Team meets in a variety of meeting rooms and has much to do logistically(for example, set up conference calls) before the Daily Scrum. What actions should the Scrum Master take?',735 options: {736 A:737 'Allow the Development Team to self-manage and determine for itself what to do.',738 B:739 'Set up the meeting and tell the Development Team that is how it will be done.',740 C: 'Inform management and ask them solve it',741 D:742 'Ask the Development Team members to alternate who is responsible for meeting setup.'743 },744 correct: ['A'],745 isMultiple: false746 },747 {748 question:749 '58. How should a Development Team deal with non-functional requirements?',750 options: {751 A: 'Ensure every Increment meets them',752 B:753 'Handle them during the Integration Sprint preceding the Release Sprint.',754 C:755 "Make sure the release department understands these requirements, but it is not the Development Team's responsibility.",756 D: 'Assign them to the lead developers on the team.'757 },758 correct: ['A'],759 isMultiple: false760 },761 {762 question: '59. Which outcome is expected as Scrum Teams mature?',763 options: {764 A:765 'A Scrum master is no longer needed since they are a mature team now',766 B:767 "They will improve their definition of 'Done' to include more stronger criteria",768 C:769 'The Sprint Retrospectives will grow to be longer than 4 hours.',770 D:771 'There is no need for a time-boxed Sprint, since time-boxes are only for new Scrum Teams.',772 E: 'Sprint Reviews will no longer be needed.'773 },774 correct: ['B'],775 isMultiple: false776 },777 {778 question:779 '60. Five new Scrum Teams have been created to build one product. A few of the developers on one of the Development Teams ask the Scrum Master how to coordinate their work with the other teams.What should the Scrum Master do?',780 options: {781 A:782 'Visit the five teams each day to inspect that their Sprint Backlogs are aligned.',783 B:784 'Collect the Sprint tasks from the Teams at the end of their Sprint Planning and merge that into a consolidated plan for the entire Sprint.',785 C:786 'Teach them that it is their responsibility to work with the other teams to create an integrated increment',787 D:788 'Teach the Product Owner to work with the lead developers on ordering Product Backlog in a way to avoid too much technical and development overlap during a Sprint'789 },790 correct: ['C'],791 isMultiple: false792 },793 {794 question:795 '61. Which of the following are true about the length of the Sprint?',796 options: {797 A:798 'Sprint length is determined during Sprint Planning, and should hold the time it will take to code the planned features in the upcoming Sprint, but does not include time for any testing',799 B: 'All Sprints must be 1 month or less.',800 C:801 'The length of the Sprint should be proportional to the work that is done in between Sprints.',802 D:803 'Sprint length is determined during Sprint Planning, and should be long enough to make sure the Development Team can deliver what is to be accomplished in the upcoming Sprint',804 E:805 'It is best to have Sprints of consistent length throughout a development effort.'806 },807 correct: ['B', 'E'],808 isMultiple: true809 },810 {811 question:812 '62. What does it mean for a Development Team to be cross-functional?',813 options: {814 A:815 'The Development Team includes not only developers but also business analysts, architects, developers and testers',816 B:817 'The Development Team includes cross-skilled individuals who are able to contribute to do what is necessary to deliver an increment of software',818 C:819 'Developers on the Development Team work closely with business analysts, architects, developers and testers who are not on the team.',820 D:821 'The Development Team is a virtual team drawing from separate teams of business analysts, architects, developers and testers'822 },823 correct: ['B'],824 isMultiple: false825 },826 {827 question: '63. A Sprint Retrospective should be held :',828 options: {829 A: 'At the end of each Sprint',830 B: 'At the beginning of each Sprint',831 C: 'At the end of the last Sprint in a project or a release',832 D: 'Only when the Scrum Team determines it needs one'833 },834 correct: ['A'],835 isMultiple: false836 },837 {838 question:839 '64. How should Product Backlog items be chosen when multiple Scrum Teams work from the same Product Backlog?',840 options: {841 A:842 'The Scrum team with the highest velocity pulls Product Backlog items first.',843 B: 'The Product Owner decides.',844 C:845 'The Product Owner should provide each team with its on Product Backlog',846 D: 'Each Scrum Team takes an equal number of items.',847 E:848 'The Development Teams pull in work in agreement with the Product Owner'849 },850 correct: ['E'],851 isMultiple: false852 },853 {854 question:855 '65. The Product Owner determines how many Product Backlog items the Development Team selects for a Sprint',856 options: {857 A:858 'True, accordingly to what was committed to the stakeholders.',859 B:860 'True, but only after confirmation by the resource manager that the Team has enough capacity',861 C: 'TRUE',862 D: 'False, the Scrum Master does That',863 E: 'False ',864 F:865 "False, capacity and commitment are the Project manager's responsibility."866 },867 correct: ['E'],868 isMultiple: false869 },870 {871 question:872 '66. Scrum is a methodology that tells in detail how to build software incrementally',873 options: {874 A: 'TRUE',875 B: 'FALSE'876 },877 correct: ['B'],878 isMultiple: false879 },880 {881 question:882 '67. Who determines how work is performed during the Sprint?',883 options: {884 A: 'Architects',885 B: 'Development Team managers',886 C: 'The Development Team',887 D: 'The Scrum Master',888 E: 'Subject matter experts'889 },890 correct: ['C'],891 isMultiple: false892 },893 {894 question:895 '68. Which statement best describes the Sprint Backlog as outcome of the Sprint Planning',896 options: {897 A: "It is the Development Team's plan for the Sprint",898 B: 'Every item has a designated owner',899 C: 'It is ordered by the Product Owner.',900 D: 'It is a complete list of all work to be done in a Sprint',901 E: 'Each task is estimated in hours.'902 },903 correct: ['A'],904 isMultiple: false905 },906 {907 question: '69. Who can abnormally terminate a Sprint?',908 options: {909 A: 'The Stakeholders',910 B: 'The Development Team or its members',911 C: 'The Product Owner',912 D: 'The Scrum Master'913 },914 correct: ['C'],915 isMultiple: false916 },917 {918 question:919 '70. The Product Owner must release each Increment to production.',920 options: {921 A: 'To make sure the Development Team is done every Sprint',922 B: 'When it makes sense',923 C: 'Whenever the product is free of defects.',924 D: 'Without exception'925 },926 correct: ['B'],927 isMultiple: false928 },929 {930 question:931 "71. During the Sprint, the Scrum Master's role is to do which two of the following : ",932 options: {933 A:934 'Facilitate the inspection and adaptation opportunities as requested or needed',935 B: 'Monitor the progress of the Development Team',936 C: 'Remove Impediments',937 D: 'Assign tasks with the Scrum Team',938 E: 'Ensure the Product Owner attends all Scrum events',939 F: 'Escalate team conflicts to functional line managers.'940 },941 correct: ['A', 'C'],942 isMultiple: true943 },944 {945 question: '72. When might a Sprint be abnormally terminated?',946 options: {947 A: 'When the Development Team feels that the work is too hard ',948 B: 'When the sales department has an important new opportunity',949 C: 'When the Sprint Goal becomes obsolete',950 D:951 'When it becomes clear that not everything will be finished by the end of the Sprint'952 },953 correct: ['C'],954 isMultiple: false955 },956 {957 question:958 '73. If two Scrum Teams are added to the development of a product that previously had only one will be the immediate impact on the productivity of the original Scrum Team?',959 options: {960 A: 'Its productivity is likely to decrease',961 B: 'Its productivity is likely to stay the same',962 C: 'Its productivity is likely to increase'963 },964 correct: ['B'],965 isMultiple: false966 },967 {968 question: '74. What best describes the Product Backlog',969 options: {970 A:971 'It contains all foreseeable tasks and requirements from which the Scrum Team can develop and mantain a complete project plan',972 B: 'It is baselined to follow change management processes',973 C:974 'It provides just enough information to enable a Scrum team to start the design phase of a product',975 D:976 'It is allowed to grow and change as more is learned about the product and its customers'977 },978 correct: ['D'],979 isMultiple: false980 },981 {982 question:983 '75. Which of the following are true about the Product Owner role?',984 options: {985 A:986 'The Product Owner is accountable for ordering the Product Backlog.',987 B: 'The Product Owner is one person.',988 C:989 'Multiple people can share the Product Owner role on a Scrum team',990 D:991 'The Product Owner role can be played by a committee or a team of people',992 E: 'The Product Owner can be influenced by a committee'993 },994 correct: ['A', 'B', 'E'],995 isMultiple: true996 },997 {998 question:999 "76. Who must do all the work to make sure Product Backlog items conform to the Definition of 'Done'?",1000 options: {1001 A: 'The Development Team',1002 B: 'The Scrum Team',1003 C: 'The Product Owner',1004 D: 'QA Specialists',1005 E: 'The Scrum Master'1006 },1007 correct: ['A'],1008 isMultiple: false1009 },1010 {1011 question:1012 '77. If burndown charts are used to visualize progress, what d they track?',1013 options: {1014 A: 'Accumulated cost',1015 B: 'Individual worker productivity',1016 C: 'Work remaining across time',1017 D: 'Accumulated business value delivered to the customer'1018 },1019 correct: ['C'],1020 isMultiple: false1021 },1022 {1023 question:1024 '78. The Scrum master observes the Product Owner struggling with ordering the Product Backlog. What is an appropiate action for the Scrum Master to take?',1025 options: {1026 A:1027 'Present the Product Owner with an ordered Product Backlog to use',1028 B:1029 'Offer the Product Owner help in understanding that the goal of ordering the Product Backlog is to maximize value.',1030 C:1031 'Suggest that the Development Team does the ordering to be sure that it is a feasible ordering of work',1032 D:1033 'Suggest the Product Owner extend the Sprint, so he can have more time to order the Product Backlog',1034 E:1035 'Encourage the Product Owner to work with the Development Team to see which items technically are be to implement.'1036 },1037 correct: ['B'],1038 isMultiple: false1039 },1040 {1041 question:1042 '79. What happens if the Development Team cannot complete its work by the end of the Sprint?',1043 options: {1044 A:1045 'The Sprint is extended and Future Sprints use this new duration',1046 B:1047 "The Sprint is extended temporarally. Lessons are taken to ensure it doesn't happen again.",1048 C:1049 'The Sprint length holds and the Development Team continuosly learns what is actually possible to do within a Spring of this length.'1050 },1051 correct: ['C'],1052 isMultiple: false1053 },1054 {1055 question:1056 '80. When is implementation of a Product Backlog item considered complete?',1057 options: {1058 A: 'At the of the Sprint',1059 B:1060 'When the item has no work remaining in order to be released',1061 C:1062 'When QA reports that the item passes all acceptance criteria',1063 D:1064 'When all work in the Sprint Backlog related to the item is finished'1065 },1066 correct: ['B'],1067 isMultiple: false1068 },1069 {1070 question: '81. When can a Development Team cancel a Sprint?',1071 options: {1072 A: "It can't Only Product Owners can cancel Sprints.",1073 B: 'When the Product Owner is absent too often.',1074 C: 'When functional expectations are not well understood.',1075 D:1076 'When The selected Product Backlog items for the Sprint become unachievable',1077 E: 'When a technical dependency cannot be resolved.'1078 },1079 correct: ['A'],1080 isMultiple: false1081 },1082 {1083 question:1084 '82. A new developer is having continuing conflicts with existing Development Team members and creating a hostile environment. If necessary, who is responsible for removing the team member?',1085 options: {1086 A:1087 'The Development Team is responsible, and may need help from the Scrum Master',1088 B:1089 'The hiring manager is responsible, because he/she hired the developer',1090 C:1091 'The Scrum Master is responsible, because he/she remove impediments.',1092 D:1093 'The Product Owner is responsible, because he/she controls the return on investment(ROI).'1094 },1095 correct: ['A'],1096 isMultiple: false1097 },1098 {1099 question: '83. What are three benefits of self-organization?',1100 options: {1101 A: 'Increased creativity',1102 B: 'Increased self-accountability',1103 C: 'Increased accuracy of estimates',1104 D: 'Increased commitment',1105 E: 'Increased rule compliance'1106 },1107 correct: ['A', 'B', 'D'],1108 isMultiple: true1109 },1110 {1111 question:1112 '84. Who should make sure everyone on the Development Team does his or her tasks for the Sprint?',1113 options: {1114 A: 'The Scrum Master',1115 B: 'The Development Team',1116 C: 'The Project Manager',1117 D: 'The Product Owner',1118 E: 'All of the above'1119 },1120 correct: ['B'],1121 isMultiple: true1122 },1123 {1124 question:1125 '85. Multiple Scrum Teams working on the same project must have the same Sprint start date.',1126 options: {1127 A: 'TRUE',1128 B: 'FALSE'1129 },1130 correct: ['A'],1131 isMultiple: false1132 },1133 {1134 question:1135 "86. Which two things are appropiate for a Scrum Master to do if the Development Team doesn't have the engineering tools and infrastructure to completely finish each selected Product Backlog item?",1136 options: {1137 A:1138 "Refocus the current Sprint on establishing the Development Team's infrasstructure instead of delivering increment.",1139 B:1140 'Encourage the Product Owner to accept partially done increments until the situation improves.',1141 C: 'Declare the Development Team not ready for Scrum.',1142 D:1143 'Have the Development Team establish a Definition of Done that is actually possible to achieve given current circumstances.',1144 E:1145 'Coach the Development Team to improve its skills, tools and infrastructure over time and adjust the Definition of Done accordingly.'1146 },1147 correct: ['D', 'E'],1148 isMultiple: true1149 },1150 {1151 question:1152 '87. Who determines when it is appropiate to update the Sprint Backlog during a Sprint?',1153 options: {1154 A: 'The Scrum Team',1155 B: 'The Project Manager',1156 C: 'The Development Team',1157 D: 'The Product Owner'1158 },1159 correct: ['C'],1160 isMultiple: false1161 },1162 {1163 question:1164 '88. Which two things should the Development Team do during the first Sprint? (select two)',1165 options: {1166 A: 'Develop at least one piece of functionality',1167 B:1168 'Analyze, design, and describe the complete architecture and infrastructure',1169 C: 'Make up a plan for the rest of the Project',1170 D:1171 'Analyze, describe and document the requirements for the subsequent Sprints.',1172 E: 'Create an Increment of potentially releasable software'1173 },1174 correct: ['A', 'E'],1175 isMultiple: true1176 },1177 {1178 question: '89. When should a Sprint Goal be created?',1179 options: {1180 A: 'During Sprint Planning',1181 B:1182 'it should have been created in the previous Sprint during Product backlog refinement',1183 C:1184 'It must be established before Sprint Planning in order to begin planning',1185 D: 'At any time during the Sprint',1186 E: 'A Sprint Goal is not mandatory in Scrum'1187 },1188 correct: ['A'],1189 isMultiple: false1190 },1191 {1192 question:1193 '90. What are the two primary ways a Scrum Master keeps a Development Team working at its highest level of productivity?',1194 options: {1195 A: 'By facilitating Development Team decisions',1196 B: 'By removing impediments that hinder the Development Team',1197 C: 'By ensuring the meetings start and end at the proper time',1198 D: 'By Keeping high value features high in the Product Backlog.'1199 },1200 correct: ['A', 'B'],1201 isMultiple: true1202 },1203 {1204 question: '91.When does the second Sprint start?',1205 options: {1206 A:1207 'Once the architectural changes for the second Sprint have been approved by the senior architect',1208 B:1209 'After the customer completes acceptance testing of the first Sprint',1210 C:1211 'After the Product Backlog for the second Sprint has been selected',1212 D: 'Immediately after the first Sprint'1213 },1214 correct: ['D'],1215 isMultiple: false1216 },1217 {1218 question: '92.What is included in the Sprint Backlog?',1219 options: {1220 A: 'Tasks',1221 B: 'Use Cases',1222 C: 'User Stories',1223 D: 'Tests'1224 },1225 correct: ['A'],1226 isMultiple: false1227 },1228 {1229 question:1230 '93.What are two responsibilities of testers in a Development Team (select two)',1231 options: {1232 A:1233 'Everyone in the Development Team is responsible for quality',1234 B: "Scrum has no 'tester' role",1235 C: 'Finding bugs',1236 D: 'Tracking quality metrics'1237 },1238 correct: ['A', 'B'],1239 isMultiple: true1240 },1241 {1242 question:1243 '94.One of the Scrum events is the Daily Scrum. What are two intended outcomes of the Daily Scrum? (select two)',1244 options: {1245 A: 'A status report for the upper management',1246 B: 'New impediments for the Scrum Master to take care of',1247 C:1248 'A shared understanding of the most important work to be undertaken next to achieve the best possible progress toward the Sprint goal',1249 D:1250 'An updated Scrum board to make Sprint progress transparent for the stakeholders'1251 },1252 correct: ['B', 'C'],1253 isMultiple: true1254 },1255 {1256 question:1257 '95.When many Development Teams are working on a single product, what best describes the definition of Done?',1258 options: {1259 A:1260 'Each Development Team defines and uses its own. The differences are discussed and reconciled during a hardening Sprint',1261 B:1262 "All Development Teams must have a definition of 'Done' that makes their combined work potentially releasable",1263 C:1264 'Each Development Team uses its own but must make their definition cleat to all other teams so the differences are known',1265 D: 'It depends'1266 },1267 correct: ['B'],1268 isMultiple: false1269 },1270 {1271 question:1272 "96.A Development Team is required to deliver a done increment by the end of a Sprint. Select two statements that explain what 'done' means (select two)",1273 options: {1274 A: 'All work the Development Team is willing to do',1275 B: 'Whatever the Product Owner defines as quality',1276 C:1277 'Each Development Team uses its own but must make their definition cleat to all other teams so the differences are known',1278 D: "No work left from the definition of 'Done'"1279 },1280 correct: ['B', 'D'],1281 isMultiple: true1282 },1283 {1284 question:1285 "97.When a Development Team is having trouble delivering a working increment because they don't understand the functional requirement, what should they do?",1286 options: {1287 A: 'Partially complete the functionality',1288 B:1289 'Collaborate with the Product Owner to determine what is possible and acceptable',1290 C: 'Add a specialist to the Development Team',1291 D: 'Defer the work to a more appropriate Sprint'1292 },1293 correct: ['B'],1294 isMultiple: false1295 },1296 {1297 question:1298 '98.When a Development Team determines that it has over committed itself for a Sprint, who has to be present when reviewing and adjusting the Sprint work selected?',1299 options: {1300 A: 'The Development Team',1301 B: 'The Product Owner and the Development Team',1302 C: 'The Scrum Master, project manager and Development Team',1303 D: 'Nobody'1304 },1305 correct: ['B'],1306 isMultiple: false1307 },1308 {1309 question:1310 '99.Which answer best describes the topics covered in Sprint Planning?',1311 options: {1312 A:1313 'How conditions have changed and how the Product Backlog should evolve',1314 B: 'What to do and who will do it',1315 C: 'What can be done and how to do it',1316 D: 'Who is on the team and what team member roles will be'1317 },1318 correct: ['C'],1319 isMultiple: false1320 },1321 {1322 question:1323 '100.Why is the Daily Scrum held at the same time and same place?',1324 options: {1325 A: 'The Product Owner demands it',1326 B: 'The consistency reduces complexity',1327 C:1328 'Rooms are hard to book and this lets it be booked in advance',1329 D: 'The place can be named'1330 },1331 correct: ['B'],1332 isMultiple: false1333 },1334 {1335 question:1336 '101.Who is responsible for tracking the remaining work of the Sprint?',1337 options: {1338 A: 'The Product Owner',1339 B: 'The Development Team',1340 C: 'The Scrum Master',1341 D: 'The Project Manager'1342 },1343 correct: ['B'],1344 isMultiple: false1345 },1346 {1347 question:1348 '102.Who is responsible for tracking the remaining work of the Sprint?',1349 options: {1350 A: 'The Product Owner',1351 B: 'The Development Team',1352 C: 'The Scrum Master',1353 D: 'The Project Manager'1354 },1355 correct: ['B'],1356 isMultiple: false1357 },1358 {1359 question:1360 '103.During a Sprint Retrospective, for what is the Product Owner responsible?',1361 options: {1362 A:1363 'Summarizing and reporting the discussions to the stakeholders',1364 B:1365 'The Product Owner should not take part in Sprint Retrospective',1366 C: 'Capturing requirements for the Product Backlog',1367 D: 'Participating as a Scrum Team member'1368 },1369 correct: ['D'],1370 isMultiple: false1371 },1372 {1373 question:1374 '104.Which are not appropriate topics for discussion in a Sprint Retrospective? ',1375 options: {1376 A: 'How the team does its work',1377 B: 'Team relations',1378 C: "Definition of 'Done'",1379 D: 'Sprint Backlog for the next Sprint'1380 },1381 correct: ['D'],1382 isMultiple: false1383 },1384 {1385 question: '105.The Product Backlog is ordered by:',1386 options: {1387 A: 'Size',1388 B: 'Risk',1389 C:1390 'Importance, where the most important items are at the top at all times',1391 D: 'Items are randomly arranged'1392 },1393 correct: ['C'],1394 isMultiple: false1395 },1396 {1397 question:1398 '106.What activities would a Product Owner typically undertake in the phase between the end of the current Sprint and the start of the next Sprint?',1399 options: {1400 A: 'Refine the Product Backlog',1401 B:1402 'There are no such activities. The next Sprint starts immediately after the current Sprint',1403 C: 'Update the project plan with stakeholders',1404 D:1405 'Work with the QA departments on the increment of the current sprint'1406 },1407 correct: ['B'],1408 isMultiple: false1409 },1410 {1411 question:1412 "107.During the Daily Scrum, the Scrum Master's role is to:",1413 options: {1414 A: 'Make sure that all 3 questions have been answered',1415 B:1416 'Teach the Development Team to keep the Daily Scrum within the 15 minute time-box',1417 C: 'Lead the discussions of the Development Team',1418 D: 'All of the above'1419 },1420 correct: ['B'],1421 isMultiple: false1422 },1423 {1424 question:1425 '108.Every Scrum Team must have a Product Owner and Scrum Master',1426 options: {1427 A:1428 'False. A Scrum Master is only required when asked for by the Development Team',1429 B:1430 'True. Outcomes are affected by their participatioin and availability',1431 C: 'True. Each must be 100% dedicated to the Scrum Team',1432 D:1433 'False. A Product Owner can be replaced by a business analyst in the Development Team.'1434 },1435 correct: ['B'],1436 isMultiple: false1437 },1438 {1439 question:1440 '109.Which does a self-organizing Development Team choose?',1441 options: {1442 A: 'Sprint length',1443 B: 'Stakeholders for the Sprint Review',1444 C: 'How to best accomplish its work',1445 D: 'Product Backlog ordering'1446 },1447 correct: ['C'],1448 isMultiple: false1449 },1450 {1451 question:1452 '110.What is the accountability of the Product Owner during Sprint 0?',1453 options: {1454 A:1455 'Make the complete project plan to commit date, budget and scope to the stakeholders',1456 B:1457 'Gathering, eliciting, and analyzing the requirements that will be inserted into the Product Backlog',1458 C: 'There is no such thing as Sprint 0',1459 D:1460 'Make sure enough Product Backlog items are refined to fill the first 3 sprints'1461 },1462 correct: ['C'],1463 isMultiple: false1464 },1465 {1466 question:1467 '111.Which of the following might the Scrum Team discuss during a Sprint Retrospective?',1468 options: {1469 A: 'Methods of communication',1470 B: 'Its Definition of done',1471 C: 'The way the Scrum Team does Sprint Planning',1472 D: 'All of the above'1473 },1474 correct: ['D'],1475 isMultiple: false1476 },1477 {1478 question:1479 '112.For the purpose of transparency, when does Scrum say a new increment of working software must be available?',1480 options: {1481 A: 'At the end of every Sprint',1482 B: 'Before the release Sprint',1483 C: 'After the acceptance testing phase',1484 D: 'Every 3 sprints'1485 },1486 correct: ['A'],1487 isMultiple: false1488 },1489 {1490 question:1491 '113.Which three of the following are timeboxed events in Scrum?',1492 options: {1493 A: 'Sprint Planning',1494 B: 'Sprint 0',1495 C: 'Sprint Retrospective',1496 D: 'Daily Scrum'1497 },1498 correct: ['A', 'C', 'D'],1499 isMultiple: true1500 },1501 {1502 question: '114.When is the Sprint Backlog created?',1503 options: {1504 A: 'During the sprint',1505 B: 'During the Sprint Planning meeting',1506 C: 'At the beginning of the project',1507 D: 'Prior to the Sprint Planning meeting'1508 },1509 correct: ['B'],1510 isMultiple: false1511 },1512 {1513 question:1514 '115.Why should the Product Owner be present at the Daily Scrum?',1515 options: {1516 A: 'To hear about impediments in functionality',1517 B: "He/She doesn't need to be there",1518 C: 'To participate as a Scrum Team member',1519 D: "To represent the stakeholders's point of view"1520 },1521 correct: ['B'],1522 isMultiple: false1523 }1524 ]1525};1526const stopSurvey = (state, action) => {1527 const updatedState = {1528 answering: false,1529 finished: false,1530 currentQuestion: 0,1531 answers: [],1532 verified: []1533 };1534 return updateObject(state, updatedState);1535};1536const initSurvey = (state, action) => {1537 const updatedState = {1538 answering: true,1539 finished: false,1540 currentQuestion: 0,1541 answers: [],1542 verified: []1543 };1544 return updateObject(state, updatedState);1545};1546const continueSurvey = (state, action) => {1547 const updatedState = {1548 answering: true1549 };1550 return updateObject(state, updatedState);1551};1552const finishSurvey = (state, action) => {1553 const updatedState = {1554 answering: false,1555 finished: true1556 };1557 return updateObject(state, updatedState);1558};1559const prevQuestion = (state, action) => {1560 const updatedState = {1561 currentQuestion: state.currentQuestion - 11562 };1563 return updateObject(state, updatedState);1564};1565const verifyQuestion = (state, action) => {1566 const updatedOption = {1567 [state.currentQuestion]: true1568 };1569 const updatedVerified = updateObject(state.verified, updatedOption);1570 const updatedState = {1571 verified: updatedVerified1572 };1573 return updateObject(state, updatedState);1574};1575const skipQuestion = (state, action) => {1576 const updatedState = {1577 currentQuestion: state.currentQuestion + 11578 };1579 return updateObject(state, updatedState);1580};1581const nextQuestion = (state, action) => {1582 const updatedState = {1583 currentQuestion: state.currentQuestion + 11584 };1585 return updateObject(state, updatedState);1586};1587const answeredQuestion = (state, action) => {1588 let updatedOptions = {};1589 //Single option1590 if (state.survey[state.currentQuestion].isMultiple) {1591 const updatedSelected = updateObject(1592 state.answers[state.currentQuestion],1593 {1594 [action.event.target.value]: action.event.target.checked1595 }1596 );1597 updatedOptions = {1598 [state.currentQuestion]: updatedSelected1599 };1600 } else {1601 updatedOptions = {1602 [state.currentQuestion]: {1603 [action.event.target.value]: true1604 }1605 };1606 }1607 // Multioptions1608 const updatedAnswers = updateObject(state.answers, updatedOptions);1609 const updatedState = {1610 answers: updatedAnswers1611 };1612 return updateObject(state, updatedState);1613};1614const redcuer = (state = initialState, action) => {1615 switch (action.type) {1616 case actionTypes.INIT_SURVEY:1617 return initSurvey(state, action);1618 case actionTypes.STOP_SURVEY:1619 return stopSurvey(state, action);1620 case actionTypes.CONTINUE_SURVEY:1621 return continueSurvey(state, action);1622 case actionTypes.FINISH_SURVEY:1623 return finishSurvey(state, action);1624 case actionTypes.PREV_QUESTION:1625 return prevQuestion(state, action);1626 case actionTypes.VERIFY_QUESTION:1627 return verifyQuestion(state, action);1628 case actionTypes.SKIP_QUESTION:1629 return skipQuestion(state, action);1630 case actionTypes.NEXT_QUESTION:1631 return nextQuestion(state, action);1632 case actionTypes.ANSWERED_QUESTION:1633 return answeredQuestion(state, action);1634 default:1635 return state;1636 }1637};...
index.js
Source:index.js
1import React, {useRef, useState} from 'react';2import {3 View,4 Text,5 TouchableOpacity,6 Image,7 FlatList,8 TextInput,9 Keyboard,10 TouchableWithoutFeedback,11} from 'react-native';12import styles from './styles';13const CustomPicker = ({14 showState,15 setShowState,16 selectedItem,17 setSelectedItem,18 isMultiple,19 setIsMultiple,20 multipleSelectedItem,21 setMultipleSelectedItem,22 data,23 setData,24 isInputEnabled,25 setIsInputEnabled,26 tagViewStyle,27 tagIcon,28 tagIconStyle,29 tagTextStyle,30 selectedItemStyle,31 placeholderText,32 defaultSelectText,33}) => {34 const [filteredData, setFilteredData] = useState(data);35 const [searchQuery, setSearchQuery] = useState(' ');36 const inputRef = useRef();37 const renderPickerText = (38 isMultiple,39 isInputEnabled,40 selectedItem,41 placeholderText,42 defaultSelectText,43 multipleSelectedItem,44 ) => {45 if (!isMultiple) {46 if (isInputEnabled) {47 if (!selectedItem.value) {48 return placeholderText || defaultSelectText;49 } else {50 return selectedItem.value;51 }52 } else {53 return selectedItem.value || defaultSelectText;54 }55 } else if (isMultiple) {56 if (isInputEnabled) {57 if (!placeholderText) {58 return defaultSelectText;59 } else if (placeholderText) {60 console.log(multipleSelectedItem > 0);61 if (multipleSelectedItem.length > 0) {62 return ' ';63 } else {64 return 'Shail';65 }66 }67 } else {68 return defaultSelectText;69 }70 }71 };72 const renderSelectView = (73 isMultiple,74 isInputEnabled,75 selectedItem,76 placeholderText,77 defaultSelectText,78 multipleSelectedItem,79 showState,80 setShowState,81 setMultipleSelectedItem,82 tagViewStyle,83 tagTextStyle,84 tagIconStyle,85 ) => {86 const pickerText = renderPickerText(87 isMultiple,88 isInputEnabled,89 selectedItem,90 placeholderText,91 defaultSelectText,92 isMultiple,93 multipleSelectedItem,94 );95 return (96 <TouchableWithoutFeedback97 onPress={() => {98 if (!showState) setShowState(true);99 if (isInputEnabled) focus();100 }}>101 <View style={styles.searchView}>102 {renderSelectionType(103 pickerText,104 showState,105 setShowState,106 isMultiple,107 selectedItem,108 placeholderText,109 defaultSelectText,110 isInputEnabled,111 multipleSelectedItem,112 setMultipleSelectedItem,113 tagViewStyle,114 tagTextStyle,115 tagIconStyle,116 )}117 {renderIcon(showState, setShowState)}118 </View>119 </TouchableWithoutFeedback>120 );121 };122 const renderFilterList = (123 id,124 value,125 multipleSelectedItem,126 setMultipleSelectedItem,127 ) => {128 if (multipleSelectedItem.some(itemId => itemId.id == id)) {129 const newListItem = multipleSelectedItem.filter(item => item.id !== id);130 return setMultipleSelectedItem(newListItem);131 }132 setMultipleSelectedItem([...multipleSelectedItem, {id: id, value: value}]);133 };134 const update_Selected_Item = (135 id,136 value,137 isMultiple,138 multipleSelectedItem,139 setMultipleSelectedItem,140 selectedItem,141 setSelectedItem,142 setShowState,143 ) => {144 if (isMultiple) {145 renderFilterList(146 id,147 value,148 multipleSelectedItem,149 setMultipleSelectedItem,150 );151 } else if (selectedItem.id == id) {152 setSelectedItem({});153 } else {154 setShowState(false);155 setSelectedItem({id: id, value: value});156 }157 };158 const getSelected = (id, multipleSelectedItem) => {159 return multipleSelectedItem.some(item => item.id == id);160 };161 const selectedItemText = (item, selectedItemStyle) => {162 return (163 <Text style={selectedItemStyle ? selectedItemStyle : styles.selectedText}>164 {item.label}165 </Text>166 );167 };168 const checkSelected = (isMultiple, selectedItemStyle, selectedItem, item) => {169 if (isMultiple) {170 if (getSelected(item.id, multipleSelectedItem)) {171 return selectedItemText(item, selectedItemStyle);172 } else {173 return <Text>{item.label}</Text>;174 }175 }176 if (selectedItem.id == item.id) {177 return selectedItemText(item, selectedItemStyle);178 } else {179 return <Text>{item.label}</Text>;180 }181 };182 const renderOptionList = (183 isInputEnabled,184 isMultiple,185 multipleSelectedItem,186 setMultipleSelectedItem,187 selectedItem,188 setSelectedItem,189 setShowState,190 item,191 ) => {192 return (193 <View style={styles.dropdownItem}>194 <TouchableOpacity195 onPress={() => {196 update_Selected_Item(197 item.id,198 item.value,199 isMultiple,200 multipleSelectedItem,201 setMultipleSelectedItem,202 selectedItem,203 setSelectedItem,204 setShowState,205 );206 if (isMultiple && isInputEnabled) {207 focus();208 }209 setFilteredData(data);210 }}>211 {checkSelected(isMultiple, selectedItemStyle, selectedItem, item)}212 <View style={styles.divider}></View>213 </TouchableOpacity>214 </View>215 );216 };217 const renderDropdown = (218 isInputEnabled,219 isMultiple,220 multipleSelectedItem,221 setMultipleSelectedItem,222 selectedItem,223 setSelectedItem,224 setShowState,225 ) => {226 return (227 <View style={styles.dropdownView}>228 <FlatList229 data={filteredData}230 keyExtractor={item => {231 return item.id;232 }}233 extraData={selectedItem || multipleSelectedItem}234 ListEmptyComponent={<Text>No Items Found</Text>}235 renderItem={({item}) => {236 const id = item.id;237 const value = item.value;238 return renderOptionList(239 isInputEnabled,240 isMultiple,241 multipleSelectedItem,242 setMultipleSelectedItem,243 selectedItem,244 setSelectedItem,245 setShowState,246 item,247 );248 }}249 />250 </View>251 );252 };253 const renderPickerTextComponent = (254 showState,255 setShowState,256 isMultiple,257 isInputEnabled,258 selectedItem,259 placeholderText,260 defaultSelectText,261 multipleSelectedItem,262 ) => {263 return (264 <Text265 onPress={() => {266 if (!showState) setShowState(true);267 }}268 style={styles.pickerText}>269 {renderPickerText(270 isMultiple,271 isInputEnabled,272 selectedItem,273 placeholderText,274 defaultSelectText,275 isMultiple,276 multipleSelectedItem,277 )}278 </Text>279 );280 };281 const renderMultipleSearch = (282 showState,283 setShowState,284 isMultiple,285 selectedItem,286 placeholderText,287 defaultSelectText,288 isInputEnabled,289 multipleSelectedItem,290 setMultipleSelectedItem,291 tagViewStyle,292 tagTextStyle,293 tagIconStyle,294 ) => {295 return (296 <View style={styles.multipleSearchView}>297 {renderTags(298 showState,299 setShowState,300 isMultiple,301 selectedItem,302 placeholderText,303 defaultSelectText,304 isInputEnabled,305 multipleSelectedItem,306 setMultipleSelectedItem,307 tagViewStyle,308 tagTextStyle,309 tagIconStyle,310 )}311 {renderInputField(312 showState,313 setShowState,314 isMultiple,315 isInputEnabled,316 selectedItem,317 placeholderText,318 defaultSelectText,319 multipleSelectedItem,320 )}321 </View>322 );323 };324 const renderImage = tagIcon => {325 if (tagIcon) {326 return tagIcon;327 } else {328 return (329 <Image source={require('images/close.png')} style={styles.closeIcon} />330 );331 }332 };333 const renderTags = (334 showState,335 setShowState,336 isMultiple,337 selectedItem,338 placeholderText,339 defaultSelectText,340 isInputEnabled,341 multipleSelectedItem,342 setMultipleSelectedItem,343 tagViewStyle,344 tagTextStyle,345 tagIconStyle,346 ) => {347 if (multipleSelectedItem.length > 0) {348 return multipleSelectedItem.map(item => {349 return (350 <View style={tagViewStyle ? tagViewStyle : styles.tagsView}>351 <Text style={tagTextStyle ? tagTextStyle : styles.tagsText}>352 {item.value}353 </Text>354 <TouchableOpacity355 onPress={() => {356 renderFilterList(357 item.id,358 item.value,359 multipleSelectedItem,360 setMultipleSelectedItem,361 );362 }}>363 <View style={tagIconStyle || styles.closeIcon}>364 {renderImage(tagIcon)}365 </View>366 </TouchableOpacity>367 </View>368 );369 });370 } else if (!isInputEnabled) {371 return renderPickerTextComponent(372 showState,373 setShowState,374 isMultiple,375 isInputEnabled,376 selectedItem,377 placeholderText,378 defaultSelectText,379 isMultiple,380 multipleSelectedItem,381 );382 }383 };384 const renderWith_InputDisabled = (385 pickerText,386 showState,387 setShowState,388 isMultiple,389 selectedItem,390 placeholderText,391 defaultSelectText,392 isInputEnabled,393 multipleSelectedItem,394 setMultipleSelectedItem,395 tagViewStyle,396 tagTextStyle,397 tagIconStyle,398 ) => {399 if (isMultiple) {400 return (401 <TouchableWithoutFeedback402 onPress={() => {403 if (!showState) setShowState(true);404 }}>405 <View style={styles.tagsWithView}>406 {renderTags(407 showState,408 setShowState,409 isMultiple,410 selectedItem,411 placeholderText,412 defaultSelectText,413 isInputEnabled,414 multipleSelectedItem,415 setMultipleSelectedItem,416 tagViewStyle,417 tagTextStyle,418 tagIconStyle,419 )}420 </View>421 </TouchableWithoutFeedback>422 );423 } else {424 return renderPickerTextComponent(425 showState,426 setShowState,427 isMultiple,428 isInputEnabled,429 selectedItem,430 placeholderText,431 defaultSelectText,432 isMultiple,433 multipleSelectedItem,434 );435 }436 };437 const renderWith_InputDisabled_View = (438 pickerText,439 showState,440 setShowState,441 isMultiple,442 selectedItem,443 placeholderText,444 defaultSelectText,445 isInputEnabled,446 multipleSelectedItem,447 setMultipleSelectedItem,448 tagViewStyle,449 tagTextStyle,450 tagIconStyle,451 ) => {452 return (453 <View style={[styles.selectedItem_Text_View, {flexWrap: 'wrap'}]}>454 {renderWith_InputDisabled(455 pickerText,456 showState,457 setShowState,458 isMultiple,459 selectedItem,460 placeholderText,461 defaultSelectText,462 isInputEnabled,463 multipleSelectedItem,464 setMultipleSelectedItem,465 tagViewStyle,466 tagTextStyle,467 tagIconStyle,468 )}469 </View>470 );471 };472 const renderIconPosition = (showState, setShowState) => {473 if (showState) {474 return (475 <TouchableOpacity476 onPress={() => {477 setShowState(false);478 Keyboard.dismiss();479 }}>480 <Image481 source={require('images/right.png')}482 style={styles.arrowIconRoated}483 />484 </TouchableOpacity>485 );486 } else {487 return (488 <Image source={require('images/right.png')} style={styles.arrowIcon} />489 );490 }491 };492 const renderIcon = (showState, setShowState) => {493 return (494 <View style={styles.renderIcon}>495 {renderIconPosition(showState, setShowState)}496 </View>497 );498 };499 const handleSearch = (text, data) => {500 const fromatedQuery = text.toLowerCase();501 const newData = data.filter(item => {502 const itemData = item.value;503 return itemData.indexOf(fromatedQuery) > -1;504 });505 setFilteredData(newData);506 setSearchQuery(fromatedQuery);507 };508 const renderInputField = (509 showState,510 setShowState,511 isMultiple,512 isInputEnabled,513 selectedItem,514 placeholderText,515 defaultSelectText,516 multipleSelectedItem,517 ) => {518 return (519 <TextInput520 ref={inputRef}521 onChangeText={text => {522 handleSearch(text, data);523 }}524 placeholder={renderPickerText(525 isMultiple,526 isInputEnabled,527 selectedItem,528 placeholderText,529 defaultSelectText,530 isMultiple,531 multipleSelectedItem,532 )}533 placeholderTextColor={showState ? null : 'black'}534 onPressIn={() => {535 if (!showState) {536 setShowState(true);537 }538 }}539 />540 );541 };542 const renderSelectionType = (543 pickerText,544 showState,545 setShowState,546 isMultiple,547 selectedItem,548 placeholderText,549 defaultSelectText,550 isInputEnabled,551 multipleSelectedItem,552 setMultipleSelectedItem,553 tagViewStyle,554 tagTextStyle,555 tagIconStyle,556 ) => {557 if (isInputEnabled) {558 if (isMultiple) {559 return renderMultipleSearch(560 showState,561 setShowState,562 isMultiple,563 selectedItem,564 placeholderText,565 defaultSelectText,566 isInputEnabled,567 multipleSelectedItem,568 setMultipleSelectedItem,569 tagViewStyle,570 tagTextStyle,571 tagIconStyle,572 );573 }574 return renderInputField(575 showState,576 setShowState,577 isMultiple,578 isInputEnabled,579 selectedItem,580 placeholderText,581 defaultSelectText,582 multipleSelectedItem,583 );584 } else {585 return renderWith_InputDisabled_View(586 pickerText,587 showState,588 setShowState,589 isMultiple,590 selectedItem,591 placeholderText,592 defaultSelectText,593 isInputEnabled,594 multipleSelectedItem,595 setMultipleSelectedItem,596 tagViewStyle,597 tagTextStyle,598 tagIconStyle,599 );600 }601 };602 const focus = () => {603 inputRef.current.focus();604 };605 return (606 <View>607 {renderSelectView(608 isMultiple,609 isInputEnabled,610 selectedItem,611 placeholderText,612 defaultSelectText,613 multipleSelectedItem,614 showState,615 setShowState,616 setMultipleSelectedItem,617 tagViewStyle,618 tagTextStyle,619 tagIconStyle,620 )}621 {showState622 ? renderDropdown(623 isInputEnabled,624 isMultiple,625 multipleSelectedItem,626 setMultipleSelectedItem,627 selectedItem,628 setSelectedItem,629 setShowState,630 )631 : null}632 </View>633 );634};635CustomPicker.defaultProps = {636 isInputEnabled: false,637 isMultiple: false,638};...
QuestionsAndAnswers.js
Source:QuestionsAndAnswers.js
1const quiz = [2 {3 HTML : {4 "Quiz-1" : 5 [6 "12345html",7 {8 ques:'Select type of Lists in HTML ?',9 isMultiple:true,10 options:['<ol>','<ul>','<dt>','<dl>'],11 correctAnswer : ['<ol>','<ul>','<dl>']12 },13 {14 ques:'Apart from <b> tag, what other tag makes text bold ?',15 isMultiple:false,16 options:['<fat>','<strong>','<black>','<emp>'],17 correctAnswer : '<strong>'18 },19 20 {21 ques:'Select the values of <input /> types attribute ?',22 isMultiple:true,23 options:['button','checkbox','address','image'],24 correctAnswer : ['button','checkbox','image']25 },26 {27 ques:'What are the types of Web Storage in HTML5?',28 isMultiple:true,29 options:['Session Storage','Web Storage', 'Local Storage', 'System Storage'],30 correctAnswer : ['Session Storage','Local Storage']31 },32 {33 ques:'HTML is a Markup Language ?',34 isMultiple:false,35 options:['true','false'],36 correctAnswer : 'true'37 }38 ],39 "Quiz-2" : [],40 "Quiz-3" : [],41 "Quiz-4" : [],42 "Quiz-5" : []43 },44 CSS : {45 "Quiz-1" : 46 [47 "12345css",48 {49 ques:'What is the correct HTML for referring to an external style sheet ?',50 isMultiple:false,51 options:['<stylesheet>mystyle.css</stylesheet />','<style src="mystyle.css" />','<link rel="stylesheet" type="text/css" href="mystyle.css">'],52 correctAnswer : '<link rel="stylesheet" type="text/css" href="mystyle.css">'53 },54 {55 ques:'Select the multiple way to add CSS to HTML file ?',56 isMultiple:true,57 options:['Inline','Internal','Both of the Above','External'],58 correctAnswer : ['Inline','Internal','External']59 },60 61 {62 ques:'Which HTML attribute is used to define inline styles ?',63 isMultiple:false,64 options:['font','class','styles','style'],65 correctAnswer : 'style'66 },67 {68 ques:'What are the Correct statements for CSS ?',69 isMultiple:true,70 options:['CSS is a language used to detail the presentation of a web page\'s markup language','Not Supported by Modern Browsers', ' it allows the separation of document content (written in HTML or a similar markup language) from document presentation (written in CSS)', 'By making one change to your website\'s CSS style sheet, you can automatically make it to every page of your website'],71 correctAnswer : ['CSS is a language used to detail the presentation of a web page\'s markup language',' it allows the separation of document content (written in HTML or a similar markup language) from document presentation (written in CSS)','By making one change to your website\'s CSS style sheet, you can automatically make it to every page of your website']72 },73 {74 ques:'How do you display hyperlinks without an underline ?',75 isMultiple:false,76 options:['a {text-decoration:no underline}','a {decoration:no underline}','a {text-decoration:none}','a {underline:none}'],77 correctAnswer : 'a {text-decoration:none}'78 }79 ],80 "Quiz-2" : [],81 "Quiz-3" : [],82 "Quiz-4" : [],83 "Quiz-5" : []84 },85 CSHARP : {86 "Quiz-1" : 87 [88 "12345csharp",89 {90 ques:'Which of the following is true about C# structures vs C# classes?',91 isMultiple:true,92 options:['Classes are reference types and structs are value types.','Structures do not support inheritance.', 'Structures cannot have default constructor','Class cannot have default constructor'],93 correctAnswer : ['Classes are reference types and structs are value types.','Structures do not support inheritance.','Structures cannot have default constructor']94 },95 {96 ques:'Which of the following converts a type to a Boolean value, where possible in C# ?',97 isMultiple:false,98 options:['ToBoolean','ToSingle','ToChar','ToDateTime'],99 correctAnswer : 'ToBoolean'100 },101 {102 ques:'Which of the following access specifier in C# allows a child class to access the member variables and member functions of its base class?',103 isMultiple:false,104 options:['Public','Private','Protected','Internal'],105 correctAnswer : 'Protected'106 },107 108 {109 ques:'Which of the following converts a type to an unsigned int type in C# ?',110 isMultiple:false,111 options:['ToType','ToUInt16','ToSingle','ToString'],112 correctAnswer : 'ToUInt16'113 },114 {115 ques:'The conditional logical operators can be overloaded ?',116 isMultiple:false,117 options:['true','false'],118 correctAnswer : 'false'119 }120 ],121 "Quiz-2" : [],122 "Quiz-3" : [],123 "Quiz-4" : [],124 "Quiz-5" : []125 },126 JAVASCRIPT : {127 "Quiz-1" : 128 [129 "12345javascript",130 {131 ques:'JavaScript can be written ?',132 isMultiple:true,133 options:['directly into JS file and included into HTML','directly on the Server Script','directly into HTML pages','None of these'],134 correctAnswer : ['directly into JS file and included into HTML','directly into HTML pages']135 },136 {137 ques:'Javascript is _________ language ?',138 isMultiple:false,139 options:['Scripting','Programming', 'Automation','Application'],140 correctAnswer : 'Scripting'141 },142 {143 ques:'Why JavaScript is called as Lightweight Programming Language ?',144 isMultiple:false,145 options:['because JS can provide programming functionality inside but up to certain extend.','because we can add programming functionality inside JS','because JS is client side scripting','because JS is available free of cost.'],146 correctAnswer : 'because JS can provide programming functionality inside but up to certain extend.'147 },148 {149 ques:' JavaScript is also called as _____________ ?',150 isMultiple:true,151 options:['Browser Side Scripting Language','Client Side Scripting Language','None of These','Server Side Scripting Language'],152 correctAnswer : ['Browser Side Scripting Language','Client Side Scripting Language']153 },154 {155 ques:'State the correct place of JS Code inside HTML ?',156 isMultiple:false,157 options:['Inside Body','Inside Single JavaScript File','Inside Head','All of above'],158 correctAnswer : 'All of above'159 }160 ],161 "Quiz-2" : [],162 "Quiz-3" : [],163 "Quiz-4" : [],164 "Quiz-5" : []165 },166 "DATA STRUCTURE" : {167 "Quiz-1" : 168 [169 "12345datastructure",170 {171 ques:'Stack in Data Structure is ___________. ?',172 isMultiple:false,173 options:['LIFO','LILO','FIFO','None of these'],174 correctAnswer : 'LIFO'175 },176 {177 ques:'In the stack process of inserting an element in the stack is called as ___________ ?',178 isMultiple:false,179 options:['Evaluation','Pop', 'Push','Create'],180 correctAnswer : 'Push'181 },182 {183 ques:'Process of Removing element from the stack is called as __________ ?',184 isMultiple:false,185 options:['Postfix Expression','Pop', 'Push','Create'],186 correctAnswer : 'Pop'187 },188 {189 ques:'In the stack, If user try to remove element from the empty stack then it called as ___________ ?',190 isMultiple:false,191 options:['Overflow of Stack','Underflow of Stack','Garbage Collection','Empty Collection'],192 correctAnswer : 'Underflow of Stack'193 },194 {195 ques:'User push 1 element in the stack having already five elements and having stack size as 5 then stack becomes ___________ ?',196 isMultiple:false,197 options:['Overflow','Underflow','Crash'],198 correctAnswer : 'Overflow'199 }200 ],201 "Quiz-2" : [],202 "Quiz-3" : [],203 "Quiz-4" : [],204 "Quiz-5" : []205 } 206 }207 ];208// var quiz = [209// {210// HTML : {211// Test : 212// [213// {key : 'test1',Questions:[{Question : 'Hello1',ProposedAnswer:['hello11','hello12','hello13'],correctAnswer:['hello11','hello13']}]},214// {key : 'test2',Questions:[{Question : 'Hello2',ProposedAnswer:['hello21','hello22','hello23'],correctAnswer:['hello21']}]},215// {key : 'test3',Questions:[{Question : 'Hello3',ProposedAnswer:['hello31','hello32','hello33'],correctAnswer:['hello31','hello33']}]}216// ]217// }218// }219// ];...
viewRecord.js
Source:viewRecord.js
1import { pathConfig } from 'config';2const prefixFileNameSuffix = (prefix = '', fileName, suffix = '', extension) =>3 `${prefix}${prefix !== '' ? '_' : ''}${fileName.substr(0, fileName.lastIndexOf('.'))}${4 suffix !== '' ? '_' : ''5 }${suffix}.${extension}`;6// const prefixFileNameSuffix = (prefix, suffix, fileName, extension) =>7// `${prefix}_${fileName.substr(0, fileName.lastIndexOf('.'))}_${suffix}.${extension}`;8export const viewRecordsConfig = {9 genericDataEmail: 'data@library.uq.edu.au',10 licenseLinks: {11 453608: {12 className: 'cc-by',13 url: 'http://creativecommons.org/licenses/by/3.0/deed.en_US',14 },15 453609: {16 className: 'cc-by-nd',17 url: 'http://creativecommons.org/licenses/by-nd/3.0/deed.en_US',18 },19 453610: {20 className: 'cc-by-nc',21 url: 'http://creativecommons.org/licenses/by-nc/3.0/deed.en_US',22 },23 453611: {24 className: 'cc-by-nc-nd',25 url: 'http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_US',26 },27 453612: {28 className: 'cc-by-nc-sa',29 url: 'http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US',30 },31 453613: {32 className: 'cc-by-sa',33 url: 'http://creativecommons.org/licenses/by-sa/3.0/deed.en_US',34 },35 456710: {36 className: 'cc-by',37 url: 'http://creativecommons.org/licenses/by/4.0/deed.en',38 },39 456711: {40 className: 'cc-by-sa',41 url: 'http://creativecommons.org/licenses/by-sa/4.0/deed.en',42 },43 456712: {44 className: 'cc-by-nd',45 url: 'http://creativecommons.org/licenses/by-nd/4.0/deed.en',46 },47 456713: {48 className: 'cc-by-nc',49 url: 'http://creativecommons.org/licenses/by-nc/4.0/deed.en',50 },51 456714: {52 className: 'cc-by-nc-sa',53 url: 'http://creativecommons.org/licenses/by-nc-sa/4.0/deed.en',54 },55 456715: {56 className: 'cc-by-nc-nd',57 url: 'http://creativecommons.org/licenses/by-nc-nd/4.0/deed.en',58 },59 // Permitted Re-use with Acknowledgement60 453701: {61 className: 'uq',62 url: 'https://guides.library.uq.edu.au/deposit-your-data/license-reuse-with-acknowledgement',63 },64 // Permitted Non-commercial Re-use with Acknowledgement65 453702: {66 className: 'uq',67 url: 'https://guides.library.uq.edu.au/deposit_your_data/terms_and_conditions',68 },69 // Permitted Re-Use with Commercial Use Restriction70 454104: {71 className: 'uq',72 url: 'https://guides.library.uq.edu.au/deposit-your-data/license-reuse-noncommercial',73 },74 // Permitted Re-Use with Share Alike Requirement75 454105: {76 className: 'uq',77 url: 'https://guides.library.uq.edu.au/deposit-your-data/license-reuse-share-alike',78 },79 // Permitted reuse only with a Data Sharing Agreement in place between UQ and recipient80 456807: {81 className: 'uq',82 url: 'https://guides.library.uq.edu.au/deposit-your-data/license-reuse-data-agreement',83 },84 },85 htmlFields: [86 'rek_transcript',87 'rek_notes',88 'rek_additional_notes',89 'rek_project_description',90 'rek_acknowledgements',91 'rek_advisory_statement',92 'rek_related_datasets',93 'rek_related_publications',94 ],95 // apart from rek_date96 dateFields: [97 'rek_date_available',98 'rek_date_recorded',99 'rek_date_photo_taken',100 'rek_date_scanned',101 'rek_start_date',102 'rek_end_date',103 'rek_time_period_start_date',104 'rek_time_period_end_date',105 'rek_project_start_date',106 ],107 dateFieldFormat: {108 rek_date_available: 'YYYY',109 rek_date_photo_taken: 'YYYY',110 },111 // some display types have different publication date format112 publicationDateFormat: {113 Book: 'YYYY',114 'Book Chapter': 'YYYY',115 'Conference Paper': 'YYYY',116 'Data Collection': 'YYYY',117 },118 files: {119 blacklist: {120 namePrefixRegex: '^(FezACML|stream|web_|thumbnail_|preview_|presmd)',121 nameSuffixRegex: '(_t\\.|_compressed\\.)',122 collections: ['UQ:413806', 'UQ:357493', 'UQ:211157', 'UQ:342107'],123 },124 thumbnailFileName: fileName => [125 prefixFileNameSuffix('thumbnail', fileName, 'compressed_t', 'jpg'),126 prefixFileNameSuffix('thumbnail', fileName, 'override_t', 'jpg'),127 prefixFileNameSuffix('thumbnail', fileName, 't', 'jpg'),128 prefixFileNameSuffix('thumbnail', fileName, '', 'jpg'),129 ],130 previewFileName: fileName => [131 prefixFileNameSuffix('preview', fileName, 'compressed_t', 'jpg'),132 prefixFileNameSuffix('preview', fileName, 'override_t', 'jpg'),133 prefixFileNameSuffix('preview', fileName, 't', 'jpg'),134 prefixFileNameSuffix('preview', fileName, '', 'jpg'),135 ],136 webFileName: fileName => [137 prefixFileNameSuffix('web', fileName, 'compressed_t', 'jpg'),138 prefixFileNameSuffix('web', fileName, 'override_t', 'jpg'),139 prefixFileNameSuffix('web', fileName, 't', 'jpg'),140 prefixFileNameSuffix('web', fileName, '', 'jpg'),141 ],142 },143 metaTags: [144 {145 searchKey: null,146 subkey: 'rek_pid',147 tags: [148 {149 name: 'DC.Identifier',150 isMultiple: false,151 },152 ],153 url: pid => pathConfig.records.view(pid, true),154 },155 {156 searchKey: 'fez_record_search_key_subject',157 subkey: 'rek_subject',158 tags: [159 {160 name: 'DC.Subject',161 isMultiple: true,162 },163 ],164 },165 {166 searchKey: null,167 subkey: 'fez_datastream_info',168 tags: [169 {170 name: 'citation_pdf_url',171 isMultiple: true,172 },173 ],174 // TODO add dsi_checksum as a third param, if this function ever gets used in the future175 url: (pid, fileName) => pathConfig.file.url(pid, fileName),176 },177 {178 searchKey: null,179 subkey: 'rek_title',180 tags: [181 {182 name: 'DC.Title',183 isMultiple: false,184 },185 {186 name: 'citation_title',187 isMultiple: false,188 },189 ],190 },191 {192 searchKey: 'fez_record_search_key_contributor',193 subkey: 'rek_contributor',194 tags: [195 {196 name: 'DC.Contributor',197 isMultiple: true,198 },199 ],200 },201 {202 searchKey: 'fez_record_search_key_author',203 subkey: 'rek_author',204 tags: [205 {206 name: 'DC.Creator',207 isMultiple: true,208 },209 {210 name: 'citation_authors',211 isMultiple: false,212 },213 ],214 },215 {216 searchKey: 'fez_record_search_key_journal_name',217 subkey: 'rek_journal_name',218 tags: [219 {220 name: 'citation_journal_title',221 isMultiple: false,222 },223 ],224 },225 {226 searchKey: 'fez_record_search_key_issn',227 subkey: 'rek_issn',228 tags: [229 {230 name: 'citation_issn',231 isMultiple: true,232 },233 ],234 },235 {236 searchKey: null,237 subkey: 'rek_date',238 tags: [239 {240 name: 'DC.Date',241 isMultiple: false,242 format: 'YYYY-MM-DD',243 },244 {245 name: 'citation_date',246 isMultiple: false,247 format: 'YYYY/MM/DD',248 },249 ],250 },251 {252 searchKey: 'fez_record_search_key_start_date',253 subkey: 'rek_start_date',254 tags: [255 {256 name: 'citation_start_date',257 isMultiple: false,258 format: 'YYYY/MM/DD',259 },260 ],261 },262 {263 searchKey: 'fez_record_search_key_end_date',264 subkey: 'rek_end_date',265 tags: [266 {267 name: 'citation_end_date',268 isMultiple: false,269 format: 'YYYY/MM/DD',270 },271 ],272 },273 {274 searchKey: 'fez_record_search_key_doi',275 subkey: 'rek_doi',276 tags: [277 {278 name: 'citation_doi',279 isMultiple: false,280 },281 ],282 },283 {284 searchKey: 'fez_record_search_key_volume_number',285 subkey: 'rek_volume_number',286 tags: [287 {288 name: 'citation_volume',289 isMultiple: false,290 },291 ],292 },293 {294 searchKey: 'fez_record_search_key_issue_number',295 subkey: 'rek_issue_number',296 tags: [297 {298 name: 'citation_issue',299 isMultiple: false,300 },301 ],302 },303 {304 searchKey: 'fez_record_search_key_start_page',305 subkey: 'rek_start_page',306 tags: [307 {308 name: 'citation_firstpage',309 isMultiple: false,310 },311 ],312 },313 {314 searchKey: 'fez_record_search_key_end_page',315 subkey: 'rek_end_page',316 tags: [317 {318 name: 'citation_lastpage',319 isMultiple: false,320 },321 ],322 },323 {324 searchKey: 'fez_record_search_key_publisher',325 subkey: 'rek_publisher',326 tags: [327 {328 name: 'DC.Publisher',329 isMultiple: false,330 },331 {332 name: 'citation_publisher',333 isMultiple: false,334 },335 ],336 },337 {338 searchKey: 'fez_record_search_key_language',339 subkey: 'rek_language',340 tags: [341 {342 name: 'citation_language',343 isMultiple: true,344 },345 ],346 },347 {348 searchKey: null,349 subkey: 'rek_description',350 tags: [351 {352 name: 'DC.Description',353 isMultiple: false,354 },355 {356 name: 'citation_abstract',357 isMultiple: false,358 },359 ],360 },361 {362 searchKey: 'fez_record_search_key_keywords',363 subkey: 'rek_keywords',364 tags: [365 {366 name: 'citation_keywords',367 isMultiple: false,368 },369 ],370 },371 {372 searchKey: 'fez_record_search_key_conference_name',373 subkey: 'rek_conference_name',374 tags: [375 {376 name: 'citation_conference',377 isMultiple: false,378 },379 ],380 },381 {382 searchKey: 'fez_record_search_key_coverage_period',383 subkey: 'rek_coverage_period',384 tags: [385 {386 name: 'DC.Subject',387 isMultiple: true,388 },389 ],390 },391 {392 searchKey: 'fez_record_search_key_geographic_area',393 subkey: 'rek_geographic_area',394 tags: [395 {396 name: 'DC.Subject',397 isMultiple: true,398 },399 ],400 },401 {402 searchKey: 'fez_record_search_key_isbn',403 subkey: 'rek_isbn',404 tags: [405 {406 name: 'citation_isbn',407 isMultiple: true,408 },409 ],410 },411 {412 searchKey: 'fez_record_search_key_report_number',413 subkey: 'rek_report_number',414 tags: [415 {416 name: 'citation_technical_report_number',417 isMultiple: false,418 },419 ],420 },421 ],422};423export const STATE_ADDED = 'A';...
general.js
Source:general.js
1/*ä¼åä¸å¿ååå°å
¬ç¨çä¸äºæ¹æ³ï¼ä¸ä¼ çé¢ï¼éæ©æ°æ®ï¼ajaxå è½½æ°æ®ç*/2var currentfrom="";3if(location.href.indexOf("/e/member")>0)4 {5 currentfrom="member";6 }7else8 {9 currentfrom="master";10 }11function open_upload(sid,path,type,table,field,ObjId) //ä¸ä¼ çé¢12 {13 var Width=560;14 var Height=185;15 if(type=="file"){Height=185;}16 IDialog("æ件ä¸ä¼ ","/e/aspx/upload_panel.aspx?sid="+sid+"&filepath="+path+"&type="+type+"&table="+table+"&field="+field+"&objid="+ObjId+"&from="+currentfrom,Width,Height);17}18function open_files(sid,Id,table,field,FieldType,InforId) //é件ç»ä¸ä¼ çé¢19 {20 var Width=600;21 var Height;22 var title;23 if(FieldType=="files")24 {25 Height=450;26 title="é件åå¸";27 if(Id!="0"){title="é件信æ¯ç¼è¾";}28 }29 else30 {31 Height=300;32 title="å¾çåå¸";33 if(Id!="0"){title="å¾çä¿¡æ¯ç¼è¾";}34 }35 IDialog(title,"/e/aspx/upload_files.aspx?sid="+sid+"&id="+Id+"&table="+table+"&field="+field+"&type="+FieldType+"&inforid="+InforId+"&from="+currentfrom,Width,Height);36}37function load_ajaxdata(Table,Ids,InsertObj,parameters) //éè¿ajaxæ¥æ¾ä¸é¢ãç¸å
³ä¿¡æ¯ãåç±»ãç¨æ·ãé¨é¨å表ç,parameters为éå åæ°38 {39 if(typeof(Tg_Table)=="undefined"){Tg_Table="";}//ä¿¡æ¯è¡¨åçé¢çå
¨å±åéï¼ä¸»è¦ç¨äºåå°æ£æµæ稿æé40 if(typeof(Current_SiteId)=="undefined"){Current_SiteId="";}//ä¿¡æ¯è¡¨åçé¢çå
¨å±åé41 var obj=document.getElementById(InsertObj);42 if(obj==null){alert(InsertObj+"对象ä¸åå¨!");return;}43 if(typeof(parameters)=="undefined"){parameters="";}44 obj.className="loading";45 if(Ids==""){obj.className="";return;}46 var R=Math.random();47 var x=new PAAjax();48 x.setarg("get",true);49 //alert("/e/aspx/load_ajaxdata.aspx?siteid="+Current_SiteId+"&table="+Table+"&ids="+Ids+"&tgtable="+Tg_Table+"¶meters="+encodeURI(parameters)+"&from="+currentfrom+"&r="+R);50 x.send("/e/aspx/load_ajaxdata.aspx","siteid="+Current_SiteId+"&table="+Table+"&ids="+Ids+"&tgtable="+Tg_Table+"¶meters="+encodeURI(parameters)+"&from="+currentfrom+"&r="+R,function(v){write_ajaxdata(v,InsertObj)});51 }52function write_ajaxdata(v,Id) //load_ajaxdataåè°53 {54 var obj=document.getElementById(Id);55 if(v==""){obj.className="";return;}56 var data=$.parseJSON(v);57 //obj.options.length=0;58 var item;59 var id,title;60 var nodetype=obj.nodeName.toLowerCase();61 if(nodetype=="select")62 {63 for(i=0;i<data.length;i++)64 {65 id=data[i].value;66 title=data[i].text;67 item=new Option(title,id);68 obj.options.add(item);69 }70 if(!obj.multiple)71 {72 obj.value=data[0].value;73 }74 }75 else76 {77 obj.value=data[0].text;78 } 79 obj.className="";80 }81function IsExists(Id,id)82 {83 var obj=document.getElementById(Id);84 if(obj.options.length==0){return false;}85 for(i=0;i<obj.options.length;i++)86 {87 if(obj.options[i].value==id)88 {89 return true;90 }91 }92 return false;93 }94function clear_select(Id)95 {96 var obj=document.getElementById(Id);97 if(obj.options.length==0){return;}98 for(i=0;i<obj.options.length;i++)99 {100 if(obj.options[i].selected)101 {102 obj.remove(i);103 clear_select(Id);104 }105 }106 }107function AddSelect(txt,value,id)108 {109 var obj=document.getElementById(id);110 obj.options.add(new Option(txt,value));111 }112//èªå®ä¹éæ©é¨é¨113function Department_Select(Id,ismultiple,title,AutoClose,Width,Height)114 {115 if(typeof(ismultiple)=="undefined"){ismultiple="0";}116 if(typeof(title)=="undefined"){title="请éæ©é¨é¨";}117 if(typeof(Width)=="undefined"){Width="800";}118 if(typeof(Height)=="undefined"){Height=450;}119 if(typeof(AutoClose)=="undefined"){AutoClose=true;}120 IDialog(title,"/e/aspx/department_select.aspx?ismultiple="+ismultiple+"&sortchoicetype="+SortChoiceType+"&objid="+Id+"&autoclose="+AutoClose+"&from=master",Width,Height);121 }122//èªå®ä¹éæ©ä¼åç»123function MemberType_Select(title,ismultiple,Current_SiteId,SourceTable,field,title,SortChoiceType,AutoClose,Width,Height)124 {125 if(SourceSites=="" || SourceSites=="0"){SourceSites=Current_SiteId;}126 if(typeof(ismultiple)=="undefined"){ismultiple="0";}127 if(typeof(title)=="undefined"){title="请éæ©æ°æ®";}128 if(typeof(Width)=="undefined"){Width="800";}129 if(typeof(Height)=="undefined"){Height=450;}130 if(typeof(SortChoiceType)=="undefined"){SortChoiceType=1;} //0代表å¯ä»¥éæ©éæç»åç±»ï¼1表示åªè½éæ©æç»åç±»131 if(typeof(AutoClose)=="undefined"){AutoClose=true;}132 IDialog(title,"/e/aspx/membertype_select.aspx?siteid="+Current_SiteId+"&sourcesites="+SourceSites+"&table="+SourceTable+"&ismultiple="+ismultiple+"&sortchoicetype="+SortChoiceType+"&objid="+field+"&autoclose="+AutoClose+"&tgtable="+Current_Table+"&from=master",Width,Height);133 }134//èªå®ä¹éæ©ä¼å135function Member_Select(title,selecttype,valuetype,ismultiple,objId,AutoClose,Width,Height)136 {137 if(typeof(title)=="undefined"){title="请éæ©ç¨æ·";}138 if(typeof(selecttype)=="undefined"){selecttype="0";}139 if(typeof(valuetype)=="undefined"){valuetype="0";}140 if(typeof(Width)=="undefined"){Width=400;}141 if(typeof(Height)=="undefined"){Height=500;}142 if(typeof(AutoClose)=="undefined"){AutoClose=true;}143 IDialog(title,"/e/aspx/member_select.aspx?ismultiple="+ismultiple+"&selecttype="+selecttype+"&valuetype="+valuetype+"&objid="+objId+"&autoclose="+AutoClose+"&from=master",Width,Height);144 }145//èªå®ä¹éæ©æ°æ®åç±»146function Sort_Select(title,SourceSites,Current_SiteId,SourceTable,Tg_Table,field,ismultiple,SortChoiceType,AutoClose,Width,Height) //Tg_Table主è¦ç¨äºæ£æµåå°ä¼åæ稿æé147 {148 if(typeof(Current_SiteId)=="undefined"){Current_SiteId="0";}149 if(SourceSites=="" || SourceSites=="0"){SourceSites=Current_SiteId;}150 if(typeof(ismultiple)=="undefined"){ismultiple="0";}151 if(typeof(title)=="undefined"){title="请éæ©æ°æ®";}152 if(typeof(Width)=="undefined"){Width="800";}153 if(typeof(Height)=="undefined"){Height=450;}154 if(typeof(SortChoiceType)=="undefined"){SortChoiceType=1;} //2代表å¯ä»¥éæ©éæç»åç±»ï¼1表示åªè½éæ©æç»åç±»155 if(typeof(AutoClose)=="undefined"){AutoClose=true;}156 IDialog(title,"/e/aspx/sort_select.aspx?siteid="+Current_SiteId+"&sourcesites="+SourceSites+"&table="+SourceTable+"&ismultiple="+ismultiple+"&sortchoicetype="+SortChoiceType+"&objid="+field+"&autoclose="+AutoClose+"&tgtable="+Tg_Table+"&from="+currentfrom,Width,Height);157 }158//èªå®ä¹éæ©æ°æ®159function Data_Select(title,SourceSites,Current_SiteId,SourceTable,Tg_Table,field,ismultiple,AutoClose,Width,Height) //Tg_Table主è¦ç¨äºæ£æµåå°ä¼åæ稿æé160 {161 if(typeof(Current_SiteId)=="undefined"){Current_SiteId="0";}162 if(SourceSites=="" || SourceSites=="0"){SourceSites=Current_SiteId;}163 if(typeof(ismultiple)=="undefined"){ismultiple="0";}164 if(typeof(title)=="undefined"){title="请éæ©æ°æ®";}165 if(typeof(Width)=="undefined"){Width="800";}166 if(typeof(Height)=="undefined"){Height=450;}167 if(typeof(AutoClose)=="undefined"){AutoClose=true;}168 IDialog(title,"/e/aspx/data_select.aspx?siteid="+Current_SiteId+"&sourcesites="+SourceSites+"&table="+SourceTable+"&field="+field+"&multiple="+ismultiple+"&autoclose="+AutoClose+"&tgtable="+Tg_Table+"&from="+currentfrom,Width,Height);...
formatValue.js
Source:formatValue.js
1import {2 cloneDeep,3 isEmpty,4 isObject,5 isArray,6 get,7} from '@hui/shared-utils'8/**9 * parse 为å
¥å value 解æ10 * format 为åºå value æ ¼å¼å11 */12const defaultFormatMethods = () => ({13 // ååç»å®è¾å
¥â0â转å为空å符串ï¼è¾åºç©ºå¼è½¬å为â0â14 zeroToNull: {15 format (val, isMultiple) {16 if (isMultiple) {17 console.warn('[hui] zeroToNull åªæ¯æ select åé')18 return val19 }20 if (typeof val != 'number' && isEmpty(val)) {21 return '0'22 }23 return get(val, 'value') || '0'24 },25 parse (parseInfo) {26 let { value, isMultiple, optionInfos } = parseInfo27 if (isMultiple) {28 console.warn('[hui] zeroToNull åªæ¯æ select åé')29 }30 if (String(value) == '0') {31 value = ''32 }33 return optionInfos.find(o => o.value === value)34 }35 },36 labelInValue: {37 format (val) {38 return val39 },40 parse (parseInfo) {41 const { value: val, isMultiple, optionInfos, valueKey } = parseInfo42 if (!isMultiple && !isObject(val)) {43 console.error(44 '[hui] åé labelInValue parse value å¿
须为对象ä¸æå® valueKey'45 )46 return val47 }48 if (isMultiple && !isArray(val)) {49 console.error(50 '[hui] å¤é labelInValue parse value å¿
须为æ°ç»ä¸æå® valueKey'51 )52 return val53 }54 if (isMultiple) {55 const valList = val.map(o => get(o, valueKey))56 return optionInfos.filter(o => valList.includes(o.value))57 }58 return optionInfos.find(o => o.value == get(val, valueKey))59 }60 },61 isString: {62 format (val, isMultiple) {63 if (!isMultiple) {64 console.warn('[hui] isString åªæ¯æ select å¤é')65 return val66 }67 return val.map(o => o.value).join(',')68 },69 parse (parseInfo) {70 const { value, isMultiple, optionInfos } = parseInfo71 if (!isMultiple) {72 console.warn('[hui] isString åªæ¯æ select å¤é')73 return []74 }75 if (typeof value !== 'string') {76 console.warn('[hui] isString åªæ¯æ select string ç±»å value')77 return []78 }79 if (isEmpty(value)) {80 return []81 }82 const optionsSelected = value.split(',')83 // return optionsSelected84 return optionInfos.filter(o => optionsSelected.includes(o.value))85 }86 },87 default: {88 format (val, isMultiple) {89 if (!isMultiple && isObject(val)) {90 return get(val, 'value') || ''91 }92 if (isMultiple) {93 return val.map(o => o.value)94 }95 return val96 },97 parse (parseInfo) {98 const { value, isMultiple, optionInfos } = parseInfo99 if (isEmpty(value) && typeof value != 'number') {100 if (isMultiple) {101 return []102 }103 return {}104 }105 if (isMultiple) {106 return optionInfos.filter(o => value.includes(o.value))107 }108 return optionInfos.find(o => o.value === value)109 }110 }111})112// éåé»è®¤ value è£
æ¢113const defaultMethods = defaultFormatMethods()114const methodNameList = Object.keys(defaultMethods).filter(115 name => name != 'default'116)117/**118 * è·å select value 解ææ¹æ³119 * @param {*} selectProps120 * @param {*} defaultFormatName121 */122function _getFormat (selectProps, defaultFormatName) {123 if (defaultFormatName && methodNameList.includes(defaultFormatName)) {124 return defaultFormatName125 }126 const openMethods = methodNameList.filter(name => {127 return get(selectProps, name)128 })129 if (openMethods.length == 0) {130 return 'default'131 }132 if (openMethods.length > 1) {133 console.warn(`select å±æ§ ${methodNameList} åªè½åå¨ä¸é¡¹`)134 return 'default'135 }136 return openMethods[0]137}138// 设置select value139function _setValue (val, objVal) {140 // this.$emit('on-change', val, objVal)141 this.$emit('on-change', val, { objVal })142 if (this.validateStatus.includes('selected')) {143 this.dispatch('FormItem', 'on-form-change', val)144 }145}146// 设置select multiInfo or singleInfo147function _setInfo (val) {148 if (this.multiple) {149 this.multiInfo.currentOptions = val150 return151 }152 this.singleInfo.currentOption = val153}154/**155 * æ ¹æ®initOptions 设置Select value , singleInfo.currentOption, multipleInfo.currentOptions156 * @param {options|option} initOptions157 * @param {string} defaultFormatName [labelInValue, zeroToNull, isString]158 */159function setValue (initOptions, defaultFormatName) {160 const selectProps = this.$props161 const isMultiple = this.multiple162 const methodName = _getFormat(selectProps, defaultFormatName)163 // console.log('methodName', methodName)164 const formatFn = get(defaultMethods, [methodName, 'format'])165 const val = formatFn(initOptions, isMultiple)166 // on-change æ·»å 第äºä¸ªåæ°è¿åæ´ä¸ªoption å¯¹è±¡å¼ åèlabel-in-value167 const objFormatFn = get(defaultMethods, ['labelInValue', 'format'])168 const objVal = objFormatFn(initOptions, isMultiple)169 _setInfo.call(this, initOptions)170 _setValue.call(this, val, cloneDeep(objVal))171 return val172}173/**174 * æ ¹æ® initValue , åå§åèµå¼Select value ,singleInfo.currentOption, multipleInfo.currentOptions175 * @param {*} initValue176 * @param {*} parseMethod177 */178function getValue (initValue, parseMethod) {179 // console.log('===== getValue =====')180 this.$nextTick(() => {181 const selectProps = this.$props182 const isMultiple = this.multiple183 const valueKey = this.valueKey184 const labelKey = this.labelKey185 // TODO å
¼å®¹ flatData 大æ°æ®,tree,table body186 const optionInfos = this.flatData.map(item => {187 return {188 ...item,189 value: get(item, valueKey),190 label: get(item, labelKey)191 }192 })193 const parseInfo = {194 value: initValue || this.value,195 isMultiple,196 valueKey,197 optionInfos198 }199 const methodName = _getFormat(selectProps, parseMethod)200 const parseFn = get(defaultMethods, [methodName, 'parse'])201 const optionsSelected = parseFn(parseInfo)202 if (isEmpty(this.flatData) || isEmpty(optionsSelected)) {203 _setInfo.call(this, isMultiple ? [] : {})204 return205 }206 const formatOptionInfo = item => {207 // const data = isObject(item.data) ? item.data : {}208 return {209 // node对象éè¦è¿æ»¤ä¸å¿
è¦çèç¹å±æ§ï¼å¨selector对singleInfo.currentOptionèç¹åäºæ·±çå¬210 // tag disabledæ å¿211 disabled: item.disabled,212 value: item.value,213 label: item.label214 }215 }216 if (isMultiple) {217 const optionsInfo = []218 optionsSelected.map(item => {219 // if (item.disabled) return220 const optionInfo = formatOptionInfo(item)221 optionsInfo.push(optionInfo)222 })223 _setInfo.call(this, optionsInfo)224 return225 }226 const optionInfo = formatOptionInfo(optionsSelected)227 _setInfo.call(this, optionInfo)228 })229}230export default {231 methods: {232 setValue: setValue,233 getValue: getValue,234 _setValue: _setValue,235 changeFormatMethods () {236 defaultMethods.default = {237 format (optionInfo, isMultiple) {238 },239 parse (parseInfo) {240 return parseInfo.optionInfos241 }242 }243 }244 }...
poll-ui-builder.js.es6
Source:poll-ui-builder.js.es6
...15 types.push({ name: I18n.t("poll.ui_builder.poll_type.multiple"), value: multiplePollType });16 return types;17 },18 @computed("pollType", "pollOptionsCount", "multiplePollType")19 isMultiple(pollType, count, multiplePollType) {20 return (pollType === multiplePollType) && count > 0;21 },22 @computed("pollType", "numberPollType")23 isNumber(pollType, numberPollType) {24 return pollType === numberPollType;25 },26 @computed("isNumber", "isMultiple")27 showMinMax(isNumber, isMultiple) {28 return isNumber || isMultiple;29 },30 @computed("pollOptions")31 pollOptionsCount(pollOptions) {32 if (pollOptions.length === 0) return 0;33 let length = 0;...
gettersUtils.js
Source:gettersUtils.js
1import find from 'lodash/find';2import { CollectionTypes } from '../../constants/lessonsConstants';3// Just makes an params object that should work with all the paths.4// It has extra params that may not be used by some routes.5// See reportRoutes.js for details on param naming.6function makeParams(notification) {7 return {8 groupId: notification.collection.id,9 lessonId: notification.assignment.id,10 quizId: notification.assignment.id,11 resourceId: notification.resource.content_id,12 exerciseId: notification.resource.content_id,13 learnerId: notification.learnerSummary.firstUserId,14 // For individual Quiz or Exercise notifications, default to first index for everything15 questionId: 0,16 interactionIndex: 0,17 tryIndex: 0,18 };19}20// Data used for 'notificationLink' helper.21// object, isMultiple, and wholeClass are meant to be pattern matched22const pageNameToNotificationPropsMap = [23 {24 key: {25 object: 'Exercise',26 isMultiple: true,27 isWholeClass: false,28 },29 value: 'ReportsGroupReportLessonExerciseLearnerListPage',30 },31 {32 key: {33 object: 'NonExercise',34 isMultiple: true,35 isWholeClass: false,36 },37 value: 'ReportsGroupReportLessonResourceLearnerListPage',38 },39 {40 key: {41 object: 'Lesson',42 isMultiple: true,43 isWholeClass: false,44 },45 value: 'ReportsGroupReportLessonPage',46 },47 {48 key: {49 object: 'Quiz',50 isMultiple: true,51 isWholeClass: false,52 },53 value: 'ReportsGroupReportQuizLearnerListPage',54 },55 {56 key: {57 object: 'Exercise',58 isMultiple: true,59 isWholeClass: true,60 },61 value: 'ReportsLessonExerciseLearnerListPage',62 },63 {64 key: {65 object: 'NonExercise',66 isMultiple: true,67 isWholeClass: true,68 },69 value: 'ReportsLessonResourceLearnerListPage',70 },71 {72 key: {73 object: 'Lesson',74 isMultiple: true,75 isWholeClass: true,76 },77 value: 'ReportsLessonLearnerListPage',78 },79 {80 key: {81 object: 'Quiz',82 isMultiple: true,83 isWholeClass: true,84 },85 value: 'ReportsQuizLearnerListPage',86 },87 {88 key: {89 object: 'Exercise',90 isMultiple: false,91 isWholeClass: false,92 },93 value: 'ReportsGroupReportLessonExerciseLearnerPage',94 },95 {96 key: {97 object: 'Lesson',98 isMultiple: false,99 isWholeClass: false,100 },101 value: 'ReportsLessonLearnerPage',102 },103 {104 key: {105 object: 'Quiz',106 isMultiple: false,107 isWholeClass: false,108 },109 value: 'ReportsLearnerReportQuizPage',110 },111 {112 key: {113 object: 'Exercise',114 isMultiple: false,115 isWholeClass: true,116 },117 value: 'REPORTS_LESSON_EXERCISE_LEARNER_PAGE_ROOT',118 },119 {120 key: {121 object: 'Lesson',122 isMultiple: false,123 isWholeClass: true,124 },125 value: 'ReportsLessonLearnerPage',126 },127 {128 key: {129 object: 'Quiz',130 isMultiple: false,131 isWholeClass: true,132 },133 value: 'ReportsQuizLearnerPage',134 },135];136export function notificationLink(notification) {137 let object;138 const { learnerSummary } = notification;139 if (notification.object === 'Resource') {140 // Individual resources141 object = notification.resource.type === 'exercise' ? 'Exercise' : 'NonExercise';142 } else {143 // Quizzes or whole Lessons144 object = notification.object;145 }146 let isMultiple;147 if (notification.event === 'HelpNeeded') {148 isMultiple = false;149 } else if (learnerSummary.total === 1 && learnerSummary.completesCollection) {150 isMultiple = true;151 } else if (learnerSummary.total === 1 && !learnerSummary.completesCollection) {152 isMultiple = false;153 } else {154 isMultiple = learnerSummary.total > 1;155 }156 const matchingPageType = find(pageNameToNotificationPropsMap, {157 key: {158 object,159 isMultiple,160 isWholeClass:161 notification.collection.type === CollectionTypes.CLASSROOM ||162 notification.collection.type === CollectionTypes.ADHOCLEARNERSGROUP,163 },164 });165 if (matchingPageType) {166 return {167 name: matchingPageType.value,168 params: makeParams(notification),169 };170 } else {171 return null;172 }...
Using AI Code Generation
1const puppeteer = require('puppeteer');2const devices = require('puppeteer/DeviceDescriptors');3(async () => {4 const browser = await puppeteer.launch({headless: false});5 const page = await browser.newPage();6 await page.emulate(devices['iPhone 6']);7 await page.screenshot({path: 'example.png'});8 await browser.close();9})();10const puppeteer = require('puppeteer');11const devices = require('puppeteer/DeviceDescriptors');12(async () => {13 const browser = await puppeteer.launch({headless: false});14 const page = await browser.newPage();15 await page.emulate(devices['iPhone 6']);16 await page.screenshot({path: 'example.png'});17 await browser.close();18})();19const puppeteer = require('puppeteer');20const devices = require('puppeteer/DeviceDescriptors');21(async () => {22 const browser = await puppeteer.launch({headless: false});23 const page = await browser.newPage();24 await page.emulate(devices['iPhone 6']);25 await page.screenshot({path: 'example.png'});26 await browser.close();27})();28const puppeteer = require('puppeteer');29const devices = require('puppeteer/DeviceDescriptors');30(async () => {31 const browser = await puppeteer.launch({headless: false});32 const page = await browser.newPage();33 await page.emulate(devices['iPhone 6']);34 await page.screenshot({path: 'example.png'});35 await browser.close();36})();37const puppeteer = require('puppeteer');38const devices = require('puppeteer/DeviceDescriptors');39(async () => {40 const browser = await puppeteer.launch({headless: false});41 const page = await browser.newPage();42 await page.emulate(devices['iPhone 6']);
Using AI Code Generation
1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch();4 const page = await browser.newPage();5 await page.screenshot({path: 'google.png'});6 await browser.close();7})();8const puppeteer = require('puppeteer');9(async () => {10 const browser = await puppeteer.launch();11 const page = await browser.newPage();12 await page.screenshot({path: 'google.png'});13 await browser.close();14})();15const puppeteer = require('puppeteer');16(async () => {17 const browser = await puppeteer.launch();18 const page = await browser.newPage();19 await page.screenshot({path: 'google.png'});20 await browser.close();21})();22const puppeteer = require('puppeteer');23(async () => {24 const browser = await puppeteer.launch();25 const page = await browser.newPage();26 await page.screenshot({path: 'google.png'});27 await browser.close();28})();29const puppeteer = require('puppeteer');30(async () => {31 const browser = await puppeteer.launch();32 const page = await browser.newPage();33 await page.screenshot({path: 'google.png'});34 await browser.close();35})();36const puppeteer = require('puppeteer');37(async () => {38 const browser = await puppeteer.launch();39 const page = await browser.newPage();40 await page.screenshot({path: 'google.png'});41 await browser.close();42})();43const puppeteer = require('puppeteer');44(async () => {45 const browser = await puppeteer.launch();
Using AI Code Generation
1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch();4 const page = await browser.newPage();5 await page.screenshot({path: 'example.png'});6 await browser.close();7})();8 at CDPSession.send (C:\Users\paul\git\puppeteer\test\node_modules\puppeteer\lib\Connection.js:187:35)9 at Page._screenshotTask (C:\Users\paul\git\puppeteer\test\node_modules\puppeteer\lib\Page.js:1065:56)10 at Page.screenshot (C:\Users\paul\git\puppeteer\test\node_modules\puppeteer\lib\Page.js:1047:25)11 at process._tickCallback (internal/process/next_tick.js:68:7)
Using AI Code Generation
1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch();4 const page = await browser.newPage();5 await page.type('input[name="q"]', 'puppeteer');6 await page.click('input[name="btnK"]');7 await page.waitForSelector('a[href="
Using AI Code Generation
1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch();4 const page = await browser.newPage();5 await page.type('input[title="Search"]', 'Puppeteer');6 await page.keyboard.press('Enter');7 await page.waitForNavigation();8 let links = await page.evaluate(() => {9 let links = [];10 let nodeList = document.querySelectorAll('a');11 nodeList.forEach((node) => {12 links.push({13 href: node.getAttribute('href'),14 multiple: node.hasAttribute('multiple')15 });16 });17 return links;18 });19 console.log(links);20 await browser.close();21})();22## 6. isSameNode()23The isSameNode() method of the Node interface returns a boolean indicating whether two nodes are the same node. Two nodes are the same if and only if the following conditions are true:24* Both nodes have the same type (e.g. both are text nodes, both are comment nodes, both are element nodes, etc.)25const puppeteer = require('puppeteer');26(async () => {27 const browser = await puppeteer.launch();28 const page = await browser.newPage();29 await page.type('input[title="Search"]', 'Puppeteer');30 await page.keyboard.press('Enter');31 await page.waitForNavigation();32 let links = await page.evaluate(() => {33 let links = [];34 let nodeList = document.querySelectorAll('a');35 nodeList.forEach((node) => {36 links.push({37 href: node.getAttribute('href'),38 same: node.isSameNode(node)39 });40 });41 return links;42 });43 console.log(links);44 await browser.close();45})();
Using AI Code Generation
1const puppeteer = require('puppeteer');2const isMultiple = require('ismultiple');3(async () => {4 const browser = await puppeteer.launch();5 const page = await browser.newPage();6 await page.screenshot({path: 'google.png'});7 await browser.close();8})();9const puppeteer = require('puppeteer');10const isMultiple = require('ismultiple');11(async () => {12 const browser = await puppeteer.launch();13 const page = await browser.newPage();14 await page.screenshot({path: 'google.png'});15 await browser.close();16})();17MIT © [Ayush Chaurasia](
Using AI Code Generation
1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch({4 });5 const page = await browser.newPage();6 const isMultiple = await page.evaluate(() => {7 .querySelector('input[name="user[username]"]')8 .multiple;9 });10 console.log('isMultiple', isMultiple);11 await browser.close();12})();
Using AI Code Generation
1const puppeteer = require('puppeteer');2const isMultiple = require('is-multiple');3(async () => {4 const browser = await puppeteer.launch({ headless: false });5 const page = await browser.newPage();6 await page.screenshot({ path: 'google.png' });7 await browser.close();8})();9MIT © [kamleshchandnani](
Using AI Code Generation
1const puppeteer = require("puppeteer");2puppeteer.launch().then(async browser => {3 let page = await browser.newPage();4 const isMultiple = await page.$eval("input", input => input.multiple);5 console.log("Is multiple: " + isMultiple);6 await browser.close();7});
Using AI Code Generation
1const puppeteer = require('puppeteer');2async function isMultiple(page, selector) {3 const elementHandle = await page.$(selector);4 const result = await page.evaluate(element => element.multiple, elementHandle);5 return result;6}7async function isDisabled(page, selector) {8 const elementHandle = await page.$(selector);9 const result = await page.evaluate(element => element.disabled, elementHandle);10 return result;11}12async function isChecked(page, selector) {13 const elementHandle = await page.$(selector);14 const result = await page.evaluate(element => element.checked, elementHandle);15 return result;16}17async function isEnabled(page, selector) {18 const elementHandle = await page.$(selector);19 const result = await page.evaluate(element => element.enabled, elementHandle);20 return result;21}22async function isSelected(page, selector) {23 const elementHandle = await page.$(selector);24 const result = await page.evaluate(element => element.selected, elementHandle);25 return result;26}27async function isPresent(page, selector) {28 const elementHandle = await page.$(selector);29 return !!elementHandle;30}31async function isVisible(page, selector) {32 const elementHandle = await page.$(selector);33 const result = await page.evaluate(element => element.visible, elementHandle);34 return result;35}36async function isInvisible(page, selector) {37 const elementHandle = await page.$(selector);38 const result = await page.evaluate(element => element.invisible, elementHandle);39 return result;40}41async function isStale(page, selector) {42 const elementHandle = await page.$(selector);43 const result = await page.evaluate(element => element.stale, elementHandle);44 return result;45}46async function isClickable(page, selector) {
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!