userManagement, startExam api | 365

main
alireza khaji 2 years ago
parent bf4aef4e90
commit 98b14196a4
  1. 2
      public/icons/table/ReactTable4arrow-icon.svg
  2. 4
      public/icons/table/ReactTable4double-left-arrow copy.svg
  3. 4
      public/icons/table/ReactTable4double-left-arrow.svg
  4. 4
      public/icons/table/ReactTable4edit.svg
  5. 2
      public/icons/table/ReactTable4filter.svg
  6. 2
      public/icons/table/ReactTable4left-arrow.svg
  7. 2
      public/icons/table/ReactTable4right-arrow.svg
  8. 4
      public/icons/table/ReactTable4search-normal copy.svg
  9. 4
      public/icons/table/ReactTable4search-normal.svg
  10. 4
      public/icons/table/ReactTable4settings.svg
  11. 4
      public/icons/table/ReactTable4zarbedar-icon copy.svg
  12. 4
      public/icons/table/ReactTable4zarbedar-icon.svg
  13. 4
      public/icons/table/ReactTable5zarbedar-icon.svg
  14. 22
      src/App.js
  15. 4
      src/components/Product/index.js
  16. 11
      src/components/ShoppingCart/index.js
  17. 4
      src/components/Table/Layouts/Footer/components/ShowMoreRows.js
  18. 10
      src/components/Table/Layouts/Main/components/Table.js
  19. 2
      src/components/Table/Layouts/Toolbar/components/GoToPage.js
  20. 2
      src/components/Table/Layouts/Toolbar/components/Tabbar.js
  21. 2
      src/components/Table/Layouts/Toolbar/index.js
  22. 2
      src/components/Table/components/ColumnSearch.js
  23. 8
      src/components/Table/components/Columns/components/Buttons.js
  24. 2
      src/components/Table/components/Columns/components/EditButtons.js
  25. 10
      src/components/Table/components/Columns/index.js
  26. 2
      src/components/Table/index.js
  27. 63
      src/components/header/Header.js
  28. 8
      src/constants/defaultValues.js
  29. 4
      src/redux/actions/exam.js
  30. 2
      src/redux/proxy.js
  31. 14
      src/redux/reducers/book.js
  32. 5
      src/redux/reducers/exam2.js
  33. 104
      src/view/Exam/EnterExam/desktop/index.js
  34. 10
      src/view/Exam/EnterExam/index.js
  35. 20
      src/view/Exam/index.js
  36. 19
      src/view/Exam2/Exam.js
  37. 322
      src/view/Exam2/Questions.js
  38. 28
      src/view/addExam/views/ViewExamNote.js
  39. 12
      src/view/services/Budget.js
  40. 4
      src/view/services/PaymentBox.js
  41. 28
      src/view/services/service/index.js
  42. 10
      src/view/user-management/index.js
  43. 2
      src/view/user-management/layouts/Editor.js

@ -1,6 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15">
<g id="arrow-down" transform="translate(0)">
<path id="Vector" d="M9.9,0,5.825,4.075a1.241,1.241,0,0,1-1.75,0L0,0" transform="translate(2.55 5.594)" fill="none" stroke="rgba(0,37,58,0.32)" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
<path id="Vector" d="M9.9,0,5.825,4.075a1.241,1.241,0,0,1-1.75,0L0,0" transform="translate(2.55 5.594)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
<path id="Vector-2" data-name="Vector" d="M0,0H15V15H0Z" transform="translate(15 15) rotate(180)" fill="none" opacity="0"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 489 B

After

Width:  |  Height:  |  Size: 478 B

@ -1,11 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="15.988" height="11.988" viewBox="0 0 15.988 11.988">
<g id="vuesax_linear_arrow-right" data-name="vuesax/linear/arrow-right" transform="translate(15.988 11.988) rotate(180)">
<g id="arrow-right" transform="translate(4)">
<path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-2" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/>
</g>
<g id="arrow-right-2" data-name="arrow-right">
<path id="Vector-3" data-name="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-3" data-name="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-4" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/>
</g>
</g>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -1,11 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="15.988" height="11.988" viewBox="0 0 15.988 11.988">
<g id="vuesax_linear_arrow-right" data-name="vuesax/linear/arrow-right" transform="translate(15.988 11.988) rotate(180)">
<g id="arrow-right" transform="translate(4)">
<path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-2" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/>
</g>
<g id="arrow-right-2" data-name="arrow-right">
<path id="Vector-3" data-name="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-3" data-name="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-4" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/>
</g>
</g>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -1,6 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16.715" height="16.703" viewBox="0 0 16.715 16.703">
<g id="edit" transform="translate(-626.295 -252.999)">
<path id="Vector" d="M8.991,1.271l-7.88,7.88a2.712,2.712,0,0,0-.66,1.32l-.43,3.01a1.424,1.424,0,0,0,1.7,1.7l3.01-.43a2.8,2.8,0,0,0,1.32-.66l7.88-7.88c1.36-1.36,2-2.94,0-4.94S10.351-.089,8.991,1.271Z" transform="translate(627.049 253.749)" fill="none" stroke="#00253a" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
<path id="Vector-2" data-name="Vector" d="M0,0A7.144,7.144,0,0,0,4.94,4.94" transform="translate(634.91 256.15)" fill="none" stroke="#00253a" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
<path id="Vector" d="M8.991,1.271l-7.88,7.88a2.712,2.712,0,0,0-.66,1.32l-.43,3.01a1.424,1.424,0,0,0,1.7,1.7l3.01-.43a2.8,2.8,0,0,0,1.32-.66l7.88-7.88c1.36-1.36,2-2.94,0-4.94S10.351-.089,8.991,1.271Z" transform="translate(627.049 253.749)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
<path id="Vector-2" data-name="Vector" d="M0,0A7.144,7.144,0,0,0,4.94,4.94" transform="translate(634.91 256.15)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 725 B

After

Width:  |  Height:  |  Size: 725 B

@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="19.631" height="22.407" viewBox="0 0 19.631 22.407">
<path id="Vector" d="M2.105,0h13.92a2.107,2.107,0,0,1,2.105,2.105V4.428A3.933,3.933,0,0,1,17.078,6.86L13.613,9.924l-1.072.947A3.417,3.417,0,0,0,11.488,13.3v4.537a2.367,2.367,0,0,1-.944,1.8l-1.47.926a2.145,2.145,0,0,1-3.267-1.8v-5.59a3.962,3.962,0,0,0-.853-2.214L.944,6.733A3.43,3.43,0,0,1,0,4.628V2.214A2.133,2.133,0,0,1,2.105,0Z" transform="translate(0.75 0.75)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
<path id="Vector" d="M2.105,0h13.92a2.107,2.107,0,0,1,2.105,2.105V4.428A3.933,3.933,0,0,1,17.078,6.86L13.613,9.924l-1.072.947A3.417,3.417,0,0,0,11.488,13.3v4.537a2.367,2.367,0,0,1-.944,1.8l-1.47.926a2.145,2.145,0,0,1-3.267-1.8v-5.59a3.962,3.962,0,0,0-.853-2.214L.944,6.733A3.43,3.43,0,0,1,0,4.628V2.214A2.133,2.133,0,0,1,2.105,0Z" transform="translate(0.75 0.75)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
</svg>

Before

Width:  |  Height:  |  Size: 570 B

After

Width:  |  Height:  |  Size: 570 B

@ -1,7 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="11.988" height="11.988" viewBox="0 0 11.988 11.988">
<g id="vuesax_linear_arrow-right" data-name="vuesax/linear/arrow-right" transform="translate(11.988 11.988) rotate(180)">
<g id="arrow-right">
<path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-2" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/>
</g>
</g>

Before

Width:  |  Height:  |  Size: 622 B

After

Width:  |  Height:  |  Size: 622 B

@ -1,6 +1,6 @@
<svg id="vuesax_linear_arrow-right" data-name="vuesax/linear/arrow-right" xmlns="http://www.w3.org/2000/svg" width="11.988" height="11.988" viewBox="0 0 11.988 11.988">
<g id="arrow-right">
<path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-2" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 552 B

After

Width:  |  Height:  |  Size: 552 B

@ -2,9 +2,9 @@
<g id="search-normal" transform="translate(-428 -188)">
<g id="Vector" transform="translate(430 190)" fill="none">
<path d="M19,9.5A9.5,9.5,0,1,1,9.5,0,9.5,9.5,0,0,1,19,9.5Z" stroke="none"/>
<path d="M 9.5 1.5 C 5.088789939880371 1.5 1.5 5.088789939880371 1.5 9.5 C 1.5 13.91121006011963 5.088789939880371 17.5 9.5 17.5 C 13.91121006011963 17.5 17.5 13.91121006011963 17.5 9.5 C 17.5 5.088789939880371 13.91121006011963 1.5 9.5 1.5 M 9.5 0 C 14.74670028686523 0 19 4.253290176391602 19 9.5 C 19 14.74670028686523 14.74670028686523 19 9.5 19 C 4.253290176391602 19 0 14.74670028686523 0 9.5 C 0 4.253290176391602 4.253290176391602 0 9.5 0 Z" stroke="none" fill="#65a9ff"/>
<path d="M 9.5 1.5 C 5.088789939880371 1.5 1.5 5.088789939880371 1.5 9.5 C 1.5 13.91121006011963 5.088789939880371 17.5 9.5 17.5 C 13.91121006011963 17.5 17.5 13.91121006011963 17.5 9.5 C 17.5 5.088789939880371 13.91121006011963 1.5 9.5 1.5 M 9.5 0 C 14.74670028686523 0 19 4.253290176391602 19 9.5 C 19 14.74670028686523 14.74670028686523 19 9.5 19 C 4.253290176391602 19 0 14.74670028686523 0 9.5 C 0 4.253290176391602 4.253290176391602 0 9.5 0 Z" stroke="none" fill="#a51c45"/>
</g>
<path id="Vector-2" data-name="Vector" d="M2.552,3.252a.7.7,0,0,1-.49-.2L.2,1.192A.706.706,0,0,1,.2.2a.706.706,0,0,1,.99,0l1.86,1.86a.706.706,0,0,1,0,.99A.738.738,0,0,1,2.552,3.252Z" transform="translate(446.747 206.747)" fill="#65a9ff"/>
<path id="Vector-2" data-name="Vector" d="M2.552,3.252a.7.7,0,0,1-.49-.2L.2,1.192A.706.706,0,0,1,.2.2a.706.706,0,0,1,.99,0l1.86,1.86a.706.706,0,0,1,0,.99A.738.738,0,0,1,2.552,3.252Z" transform="translate(446.747 206.747)" fill="#a51c45"/>
<path id="Vector-3" data-name="Vector" d="M0,0H24V24H0Z" transform="translate(452 212) rotate(180)" fill="none" opacity="0"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -2,9 +2,9 @@
<g id="search-normal" transform="translate(-428 -188)">
<g id="Vector" transform="translate(430 190)" fill="none">
<path d="M19,9.5A9.5,9.5,0,1,1,9.5,0,9.5,9.5,0,0,1,19,9.5Z" stroke="none"/>
<path d="M 9.5 1.5 C 5.088789939880371 1.5 1.5 5.088789939880371 1.5 9.5 C 1.5 13.91121006011963 5.088789939880371 17.5 9.5 17.5 C 13.91121006011963 17.5 17.5 13.91121006011963 17.5 9.5 C 17.5 5.088789939880371 13.91121006011963 1.5 9.5 1.5 M 9.5 0 C 14.74670028686523 0 19 4.253290176391602 19 9.5 C 19 14.74670028686523 14.74670028686523 19 9.5 19 C 4.253290176391602 19 0 14.74670028686523 0 9.5 C 0 4.253290176391602 4.253290176391602 0 9.5 0 Z" stroke="none" fill="#65a9ff"/>
<path d="M 9.5 1.5 C 5.088789939880371 1.5 1.5 5.088789939880371 1.5 9.5 C 1.5 13.91121006011963 5.088789939880371 17.5 9.5 17.5 C 13.91121006011963 17.5 17.5 13.91121006011963 17.5 9.5 C 17.5 5.088789939880371 13.91121006011963 1.5 9.5 1.5 M 9.5 0 C 14.74670028686523 0 19 4.253290176391602 19 9.5 C 19 14.74670028686523 14.74670028686523 19 9.5 19 C 4.253290176391602 19 0 14.74670028686523 0 9.5 C 0 4.253290176391602 4.253290176391602 0 9.5 0 Z" stroke="none" fill="#a51c45"/>
</g>
<path id="Vector-2" data-name="Vector" d="M2.552,3.252a.7.7,0,0,1-.49-.2L.2,1.192A.706.706,0,0,1,.2.2a.706.706,0,0,1,.99,0l1.86,1.86a.706.706,0,0,1,0,.99A.738.738,0,0,1,2.552,3.252Z" transform="translate(446.747 206.747)" fill="#65a9ff"/>
<path id="Vector-2" data-name="Vector" d="M2.552,3.252a.7.7,0,0,1-.49-.2L.2,1.192A.706.706,0,0,1,.2.2a.706.706,0,0,1,.99,0l1.86,1.86a.706.706,0,0,1,0,.99A.738.738,0,0,1,2.552,3.252Z" transform="translate(446.747 206.747)" fill="#a51c45"/>
<path id="Vector-3" data-name="Vector" d="M0,0H24V24H0Z" transform="translate(452 212) rotate(180)" fill="none" opacity="0"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

@ -1,6 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="5.397" height="5.397" viewBox="0 0 5.397 5.397">
<g id="Group_1887" data-name="Group 1887" transform="translate(0.707 0.707)">
<path id="Vector" d="M3.943,3.943,0,0" transform="translate(0.04)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<path id="Vector-2" data-name="Vector" d="M3.943,0,0,3.943" transform="translate(0 0.04)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<path id="Vector" d="M3.943,3.943,0,0" transform="translate(0.04)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<path id="Vector-2" data-name="Vector" d="M3.943,0,0,3.943" transform="translate(0 0.04)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

@ -1,6 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="5.397" height="5.397" viewBox="0 0 5.397 5.397">
<g id="Group_1887" data-name="Group 1887" transform="translate(0.707 0.707)">
<path id="Vector" d="M3.943,3.943,0,0" transform="translate(0.04)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<path id="Vector-2" data-name="Vector" d="M3.943,0,0,3.943" transform="translate(0 0.04)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<path id="Vector" d="M3.943,3.943,0,0" transform="translate(0.04)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<path id="Vector-2" data-name="Vector" d="M3.943,0,0,3.943" transform="translate(0 0.04)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

@ -1,6 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="5.397" height="5.397" viewBox="0 0 5.397 5.397">
<g id="Group_1887" data-name="Group 1887" transform="translate(0.707 0.707)">
<path id="Vector" d="M3.943,3.943,0,0" transform="translate(0.04)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<path id="Vector-2" data-name="Vector" d="M3.943,0,0,3.943" transform="translate(0 0.04)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<path id="Vector" d="M3.943,3.943,0,0" transform="translate(0.04)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<path id="Vector-2" data-name="Vector" d="M3.943,0,0,3.943" transform="translate(0 0.04)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

@ -629,10 +629,14 @@ let data = [
function App() {
let location = window.location.pathname;
const [dontShowNav,setDontShowNav]=useState(false);
useEffect(()=>{
location = window.location.pathname;
})
// const {id} = useParams();
console.log(location);
let buyPackagesData = null;
if (location.includes("buy-packages")) {
if (location?.includes("buy-packages")) {
let pathList = location.split("/");
let id = pathList[pathList.length - 1];
for (let i = 0; i < data.length; i++) {
@ -644,8 +648,6 @@ function App() {
}
let loginStorage = localStorage.getItem("userData");
let userData = JSON.parse(loginStorage);
console.log(loginStorage == null);
console.log(userData);
const [LOGIN, setLOGIN] = useState(loginStorage == undefined ? false : true);
const activeLogin = () => {
setLOGIN(true);
@ -669,7 +671,6 @@ function App() {
const [ActiveUserFullInfo, setActiveUserFullInfo] = useState(false);
const [UserFullInfoData, setUserFullInfoData] = useState(buyPackagesData);
const showUserFullInfo = (data) => {
console.log(data);
setActiveUserFullInfo(true);
setUserFullInfoData(data);
};
@ -686,10 +687,8 @@ function App() {
<div>
<Router>
<div className="App">
{LOGIN && location?.split("/")[3] !== "exam" && (
<Header logOut={logOut} />
)}
{LOGIN && location?.split("/")[3] !== "exam" && <Nav />}
{LOGIN && !dontShowNav && <Header logOut={logOut} />}
{LOGIN && !dontShowNav && <Nav />}
<Routes>
<Route
path="/"
@ -742,7 +741,10 @@ function App() {
element={<AddProduct />}
/>
<Route path="/adminpanel/add-exam" element={<AddExam />} />
<Route path="/adminpanel/user-management" element={<UserManagement />} />
<Route
path="/adminpanel/user-management"
element={<UserManagement />}
/>
<Route
path="/register"
@ -766,7 +768,7 @@ function App() {
<Route
exact
path="/enter_exam/:id"
element={<ENTER_EXAM />}
element={<ENTER_EXAM setDontShowNav={setDontShowNav} />}
/>
<Route
exact

@ -192,7 +192,7 @@ const ProductDesign = ({
<img
src={
product?.fileId
? `https://new.andishmand.ir/api/v1/file/${product?.fileId}`
? `https://api.andishmand.ir/api/v1/file/${product?.fileId}`
: imgPlaceHolder
}
className={` rounded-md w-full ${
@ -450,7 +450,7 @@ const ProductDesign = ({
<img
src={
product?.fileId
? `https://new.andishmand.ir/api/v1/file/${product?.fileId}`
? `https://api.andishmand.ir/api/v1/file/${product?.fileId}`
: imgPlaceHolder
}
className="rounded-t-xl"

@ -44,7 +44,7 @@ function ShoppingCart({
let query = Object.fromEntries(new URLSearchParams(search));
const [paymentError, setPaymentError] = useState(false);
useEffect(() => {
if (query.status && window.innerWidth<1000) {
if (query.status && window.innerWidth < 1000) {
if (query.status === "OK") {
toast.success("پرداخت با موفقیت انجام شد");
} else {
@ -52,7 +52,6 @@ function ShoppingCart({
// `عملیات پرداخت موفق نبود. شناسه پیگیری شما ${query.authority} میباشد`
// );
setPaymentError(true);
}
setShowPaymentBox(true);
}
@ -77,10 +76,10 @@ function ShoppingCart({
//payHandler---------------------------------------
const payHandler = () => {
if(window.innerWidth<1000){
if (window.innerWidth < 1000) {
alert("hoooo");
setShowPaymentBoxM(true);
}else{
} else {
setShowPaymentBox(true);
}
};
@ -117,7 +116,7 @@ function ShoppingCart({
className="w-full px-1 h-12 mt-1 text-white bg-red52 rounded-lg text-sm font-semibold"
onClick={() =>
paySchool({
redirectUrl: "https://new.andishmand.ir/myServices",
redirectUrl: "https://api.andishmand.ir/myServices",
})
}
>
@ -260,7 +259,7 @@ function ShoppingCart({
style={{ fontSize: "0.65vw" }}
onClick={() =>
paySchool({
redirectUrl: "https://new.andishmand.ir/myServices",
redirectUrl: "https://api.andishmand.ir/myServices",
})
}
>

@ -3,7 +3,7 @@ import React from "react";
const ShowMoreRows = ({ pageSize, setPageSize }) => {
return (
<select
className="text-white text-sm rounded cursor-pointer mr-2 bg-[#65A9FF]"
className="w-32 text-white text-sm rounded cursor-pointer mr-2 bg-[#a51c45] px-1"
value={pageSize}
onChange={(e) => setPageSize(Number(e.target.value))}
>
@ -11,7 +11,7 @@ const ShowMoreRows = ({ pageSize, setPageSize }) => {
<option
key={pageSize}
value={pageSize}
className=" text-xs text-right ltr"
className=" text-xs text-right ltr bg-white"
>
نمایش {pageSize}
</option>

@ -81,7 +81,7 @@ const Table = ({
<th
{...column.getHeaderProps(column.getSortByToggleProps())}
scope="col"
className="cursor-pointer py-2 px-2 text-right text-sm bg-[#3287B9] text-background text-white"
className="cursor-pointer py-2 px-2 text-right text-sm bg-[#df1452] text-background text-white"
>
{column.render("Header")}
{/* {column.render("description")} */}
@ -96,7 +96,7 @@ const Table = ({
{/* filter row */}
{console.log("...............................o")}
{filtering ? (
<thead className="bg-[#F1F5FE]">
<thead className="bg-[#a51c4510]">
{headerGroups.map((headerGroup, index) => (
<tr key={index} {...headerGroup.getHeaderGroupProps()}>
{headerGroup.headers.map((column) => (
@ -143,7 +143,7 @@ const Table = ({
<td colSpan={headerGroups[0].headers.length}>
<RowDetail
data={data}
schema={schema.filter((e) => e.more)}
schema={schema.filter((e) => e?.more)}
setTabs={setTabs}
tabs={tabs}
row={row.original}
@ -159,7 +159,7 @@ const Table = ({
{/* {tabs?.length > 1 && editor} */}
</tbody>
{/* {tabs?.length > 1 && editor} */}
<tfoot className={`bg-blue-900 ${rows.length > 5 ? "w-full" : "hidden"}`}>
{/* <tfoot className={`bg-blue-900 ${rows.length > 5 ? "w-full" : "hidden"}`}>
{footerGroups.map((footerGroup, index) => (
<tr key={index} {...footerGroup.getFooterGroupProps()}>
{footerGroup.headers.map((column, index) => (
@ -173,7 +173,7 @@ const Table = ({
))}
</tr>
))}
</tfoot>
</tfoot> */}
</table>
);
};

@ -2,7 +2,7 @@ import React from "react";
const GoToPage = ({ pageIndex, gotoPage, pageOptions }) => {
return (
<span className="text-xs text-blue-400 mr-1">
<span className="text-xs text-[#df1452] mr-1">
صفحه{" "}
<input
className="ml-1 text-xs p-1 rounded border-blue-400 w-9"

@ -97,7 +97,7 @@ const Tabbar = ({
aria-current="page"
className={`flex flex-row items-center text-sm text-white px-2 py-0.5 text-center active rounded-sm ${
el?.isActive ? "text-[#fff]" : "text-[#000]"
} ${el?.isActive ? "bg-[#92c1fc]" : "bg-[#F1F6FF]"}`}
} ${el?.isActive ? "bg-[#df145277]" : "bg-[#df145210]"}`}
>
<div
className="h-full py-2 pointer-events-none"

@ -39,7 +39,7 @@ export const Toolbar = ({
activeOtherTab={activeOtherTab}
setActiveOtherTab={setActiveOtherTab}
/>
<div className="flex py-2 bg-surface items-center gap-2 px-2 bg-sky-200">
<div className="flex py-2 bg-[#df145277] items-center gap-2 px-2 bg-sky-200">
<TableSearch
globalFilter={globalFilter}
setGlobalFilter={setGlobalFilter}

@ -8,7 +8,7 @@ export const ColumnSearch = ({ column }) => {
<input
value={filterValue || ""}
onChange={(e) => setFilter(e.target.value)}
className={`w-full h-8 text-xs text-blue-400 bg-[#F9FBFF] border-[#B5D6FF] rounded focus:outline-none border p-1 focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20`}
className={`w-full h-8 text-xs text-[#df1452] bg-[#F9FBFF] border-[#df145255] rounded focus:outline-none border p-1 focus:border-[#df1452] focus:ring focus:ring-[#df1452] focus:ring-opacity-20`}
/>
</div>
);

@ -28,9 +28,11 @@ const Buttons = ({
for (let i = 0; i < newList.length; i++) {
newList[i].isActive = false;
}
console.log("00000000000||0000000000000000");
console.log(row);
newList.push({
id: Math.floor(Math.random() * 10000),
name: row.original.name,
name: row.original.firstName + " " + row.original.lastName,
isActive: true,
data: row,
element: "editor",
@ -64,10 +66,10 @@ const Buttons = ({
</button>
</div>
<div
className="mx-1 p-1 rounded border border-gray-300 cursor-pointer"
className="mx-1 p-1 rounded border border-gray-300 cursor-pointer"
onClick={editHandler}
>
<img src="/icons/table/ReactTable4edit.svg" alt="" className="w-10" />
<img src="/icons/table/ReactTable4edit.svg" alt="" className="w-6" />
</div>
{/* <DropDown /> */}
</div>

@ -35,7 +35,7 @@ const EditButtons = ({
<div className="flex flex-row items-center justify-end">
{/* add new row */}
<button
className="mx-1 flex flex-row items-center bg-[#65A9FF] p-2 text-xs text-white rounded border-b-2 border-blue-600"
className="mx-1 flex flex-row items-center bg-[#a51c45] p-2 text-xs text-white rounded"
onClick={addNewItem}
>
<div>ثبت جدید</div>

@ -44,12 +44,12 @@ export const COLUMNS = ({
activeOtherTab,
}) => [
...schema.map((e) => ({
accessor: e.name,
Header: e.description,
accessor: e?.name,
Header: e?.description,
// Cell: e.renderer ? Components[e.renderer] : Components["text"],
Cell: e.type ? Components[e.type] : Components["text"],
Filter: e.filter ? Filters[e.filter] : Filters["ColumnSrarch"],
disableSortBy: e.sort == false,
Cell: e?.type ? Components[e.type] : Components["text"],
Filter: e?.filter ? Filters[e.filter] : Filters["ColumnSrarch"],
disableSortBy: e?.sort == false,
Footer: "ستون " + e.description,
})),
{

@ -41,7 +41,7 @@ const Table = ({
const columns = useMemo(
() =>
COLUMNS({
schema: schema.filter((e) => !e.more),
schema: schema.filter((e) => !e?.more),
filtering,
setFiltering,
setTabs,

@ -1,38 +1,41 @@
import React, { useEffect } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import './Header.scss';
import React, { useEffect } from "react";
import { useLocation, useNavigate } from "react-router-dom";
import "./Header.scss";
import searchIcon from "../../assets/img/Group 1148.svg";
import moment from "jalali-moment";
import { useState } from 'react';
import { useState } from "react";
import avatar1 from "../../assets/img/avatar/pexels-jan-kopřiva-3525908.jpg";
import logoIcon from '../../assets/img/logo.png';
import MobileSideMenu from './MobileSideMenu';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import arrowIcon from './MobileSideMenu/arrow-down.svg'
import exitIcon from '../../assets/img/group-9.svg'
import backIcon from './arrow-left-1.svg';
import profileIcon from './MobileSideMenu/profile-active.svg'
import { user } from '../../redux/actions';
import { grades } from '../../redux/reducers/public';
const Header = ({
isMobile, cart,
logOut,
setUserStatus,
user
}) => {
import logoIcon from "../../assets/img/logo.png";
import MobileSideMenu from "./MobileSideMenu";
import { connect } from "react-redux";
import { Link } from "react-router-dom";
import arrowIcon from "./MobileSideMenu/arrow-down.svg";
import exitIcon from "../../assets/img/group-9.svg";
import backIcon from "./arrow-left-1.svg";
import profileIcon from "./MobileSideMenu/profile-active.svg";
import { user } from "../../redux/actions";
import { grades } from "../../redux/reducers/public";
const Header = ({ isMobile, cart, logOut, setUserStatus, user }) => {
let today = moment().locale("fa").format("YYYY/M/D");
let weekday = new Date().getDay();
let weekdayList = ["یکشنبه", "دوشنبه", "سهشنبه", "چهارشنبه", 'پنجشنبه', 'جمعه', "شنبه"];
let weekdayList = [
"یکشنبه",
"دوشنبه",
"سهشنبه",
"چهارشنبه",
"پنجشنبه",
"جمعه",
"شنبه",
];
const [menuPopup, setMenuPopup] = useState(false);
const [subMenu, setSubMenu] = useState(false);
const location = useLocation();
const navigate = useNavigate();
useEffect(() => {
setUserStatus()
}, [])
setUserStatus();
}, []);
let UserData =JSON.parse(localStorage.getItem("userData"));
let UserData = JSON.parse(localStorage.getItem("userData"));
return (
<>
<div
@ -50,7 +53,7 @@ const Header = ({
<img
src={
UserData.picFileId
? `https://new.andishmand.ir/api/v1/file/${UserData.picFileId}`
? `https://api.andishmand.ir/api/v1/file/${UserData.picFileId}`
: profileIcon
}
/>
@ -190,7 +193,7 @@ const Header = ({
<img
src={
UserData.picFileId
? `https://new.andishmand.ir/api/v1/file/${UserData.picFileId}`
? `https://api.andishmand.ir/api/v1/file/${UserData.picFileId}`
: profileIcon
}
alt="avatar1"
@ -272,7 +275,7 @@ const Header = ({
)}
</>
);
}
};
const mapStateToProps = (state) => ({
isMobile: state.publicApi.isMobile,
@ -280,13 +283,11 @@ const mapStateToProps = (state) => ({
user: state.user.status,
});
const mapDispatchToProps = {
setUserStatus: user.setUserStatus
setUserStatus: user.setUserStatus,
};
export default connect(mapStateToProps, mapDispatchToProps)(Header);
const Clock = () => {
let today = new Date();
let h = today.getHours();
@ -310,4 +311,4 @@ const Clock = () => {
{h < 10 ? "0" + h : h}:{m < 10 ? "0" + m : m}:{s < 10 ? "0" + s : s}
</div>
);
}
};

@ -1,9 +1,9 @@
export const ApiConfig = {
// apiKey: 'AIzaSyBBksq-Asxq2M4Ot-75X19IyrEYJqNBPcg',
// authDomain: 'dnvn.ir',
baseUrl: 'https://new.andishmand.ir/api/v1',
baseUrl: "https://api.andishmand.ir/api/v1",
//baseUrl: 'http://localhost:3030/api/v1',
loginURL: 'user/login',
otploginURL: 'user/otp/login',
logoutURL: 'user/logout',
loginURL: "user/login",
otploginURL: "user/otp/login",
logoutURL: "user/logout",
};

@ -21,6 +21,10 @@ const exam = {
(data = {}) =>
async (dispatch) =>
await proxy.put("exam/confirm", data, { dispatch }),
start:
(data = {}) =>
async (dispatch) =>
await proxy.get("exam/start", data, { dispatch }),
emptySubexamList: (data = {}) => {
return (dispatch) => {
dispatch({

@ -48,7 +48,7 @@ class Proxy {
let response = await fetch();
switch (response.status) {
case 200:
dispatch({ type: url, data: response.data.data, params });
dispatch({ type: url, data: response.data.data,schema:response.data.schema, params });
return response.data.data;
case 401:
if (await this.refresh()) {

@ -35,7 +35,7 @@ const grades = [
];
export default function book(state = initialState, action) {
let { type, data } = action;
let { type, data, schema } = action;
switch (type) {
case "product/list":
let itemsSubject = (Array.isArray(data) ? data : []).map(
@ -62,8 +62,16 @@ export default function book(state = initialState, action) {
};
case "product/info":
return { ...state, loading: false, info: data, error: null };
case "product/schoolUser":
return { ...state, loading: false, schoolUserList: data, error: null };
case "product/schoolUsers":
console.log("{{{{{{-..-}}}}}}}")
console.log(action)
return {
...state,
loading: false,
schoolUserList: data,
schema: schema,
error: null,
};
case "book/lesson/active":
return {
...state,

@ -10,6 +10,7 @@ const initialState = {
preview: null,
subExamList: [],
lastSubExamAdd:null,
list:null,
confirm:null
};
export default function exam2(state = initialState, action) {
@ -25,13 +26,15 @@ export default function exam2(state = initialState, action) {
case "exam/parentAdd":
toast.success("آزمون شما با موفقیت ثبت شد");
return { ...state, loading: false, error: null, lastExamAdd: data.id };
case "exam/start":
return { ...state, loading: false, list: data, error: null };
case "exam/subexamAdd":
toast.success("درخواست با موفقیت انجام شد");
return {
...state,
loading: false,
error: null,
lastSubExamAdd:data.id,
lastSubExamAdd: data.id,
subExamList: [...state.subExamList, data.id],
};
case "empty_subexam_list":

@ -18,6 +18,7 @@ import moment from "jalali-moment";
import { useEffect } from "react";
import { state } from "../../../../components/exam/Carousel/state";
import { exam } from "../../../../redux/actions";
import {useNavigate} from "react-router-dom"
let gradeList = [
"اول",
@ -33,14 +34,18 @@ let gradeList = [
"یازدهم",
"دوازدهم",
];
const EnterExam = ({ ID, getExamInfo, examInfo }) => {
const EnterExam = ({
ID,
getExamInfo,
examInfo,
startExam,
examData,
setDontShowNav,
}) => {
// const state = useSelector((state) => state.default);
console.log("Cheraaaaaaaaaaaaaa????????");
console.log(ID);
useEffect(() => {
getExamInfo({ id: ID });
}, []);
console.log(examInfo);
//------------------------------------------
const [common_data] = useState(state);
let data;
@ -49,64 +54,32 @@ const EnterExam = ({ ID, getExamInfo, examInfo }) => {
data = common_data[i];
}
}
console.log("cc:" + data);
//--today date--and timer setting-----------------------------
// let today = new Date();
// let examDate = new Date(data.date)
// let diff = (examDate-today)/1000;
// let d = Math.floor(diff/86400);
// let h = Math.floor((diff-(86400*d))/3600);
// let m = Math.floor((diff-(86400*d)-(h*3600))/60);
// let s = Math.floor(diff-(86400*d)-(h*3600)-(m*60));
// const [timer,setTimer]=useState({
// d,h,m,s
// })
//----------------------------------------
const startExamBtnhandler = () => {
startExam({
examId: ID,
});
};
let navigate = useNavigate();
useEffect(() => {
// console.log(sec);
// if (timer.s >= 0 && diff > 0) {
// setTimeout(() => {
// // console.log("okdkdokodkd");
// setTimer({
// d,
// h,
// m,
// s:s-1
// });
// if (timer.s === 0) {
// setTimer({
// d,
// h,
// m:m-1,
// s:59
// });
// }
// if (timer.m === 0) {
// setTimer({
// d,
// h:h-1,
// m:59,
// s:59
// });
// }
// if (timer.h === 0) {
// setTimer({
// d:d-1,
// h:23,
// m:59,
// s:59
// });
// }
// }, 1000);
// }
});
if (examData) {
setDontShowNav(true);
navigate(`/myServices/azmoon_list/exam/${ID}`);
}
}, [examData]);
//-------------------------------------------
moment.locale("en");
return (
<div className="enter-exam">
<div
className="enter-exam-box"
style={window.innerWidth < 1000 ? { width: "95%" } : { width: "35%",height:"auto" }}
style={
window.innerWidth < 1000
? { width: "95%" }
: { width: "35%", height: "auto" }
}
>
<div className="eeb-title-box">
<img className="eeb-title-box-img" src={img0} alt="title-box-img" />
@ -118,13 +91,15 @@ const EnterExam = ({ ID, getExamInfo, examInfo }) => {
<div className="eeb-name-box-label">نام آزمون:</div>
<div className="eeb-name-box-name">{examInfo?.name}</div>
</div>
<div className="eeb-level-box">
<img className="eeb-level-box-icon" src={icon2} alt="name-icon" />
<div className="eeb-level-box-label">پایه تحصیلی:</div>
<div className="eeb-level-box-level">
{gradeList[examInfo?.gradeId - 1]}
{examInfo?.gradeId && (
<div className="eeb-level-box">
<img className="eeb-level-box-icon" src={icon2} alt="name-icon" />
<div className="eeb-level-box-label">پایه تحصیلی:</div>
<div className="eeb-level-box-level">
{gradeList[examInfo?.gradeId - 1]}
</div>
</div>
</div>
)}
<div className="eeb-date-box">
<img className="eeb-date-box-icon" src={icon3} alt="name-icon" />
<div className="eeb-date-box-label">زمان آزمون:</div>
@ -205,12 +180,13 @@ const EnterExam = ({ ID, getExamInfo, examInfo }) => {
<div className="eeb-created-box-label">ایجاد شده توسط</div>
<div className="eeb-created-box-file">موسسه فرهنگی مصباح نور</div>
</div> */}
<Link
to={`/dashboard/azmoon_list/exam/${data?.id}`}
<div
// to={`/dashboard/azmoon_list/exam/${data?.id}`}
className="eeb-btn"
onClick={startExamBtnhandler}
>
شروع آزمون
</Link>
</div>
{/* {(new Date(data.date)>today) &&
<div className="eeb-timer">
<div>{timer.d} روز و </div>
@ -227,10 +203,12 @@ const EnterExam = ({ ID, getExamInfo, examInfo }) => {
const mapStateToProps = (state) => ({
examInfo: state.exam2.info,
examData : state.exam2.list
});
const mapDispatchToProps = {
getExamInfo: exam.info,
startExam : exam.start
};
export default connect(mapStateToProps, mapDispatchToProps)(EnterExam);

@ -2,13 +2,17 @@ import EnterExam from "./desktop";
import { useParams } from "react-router-dom";
// import MobileEnterExam from "../../component/mobile/azmoon-list/M_EnterExam";
import MobileEnterExam from "./mobile";
const ENTER_EXAM = () => {
const ENTER_EXAM = ({ setDontShowNav }) => {
const { id } = useParams();
return (
<div className="ENTER_EXAM">
{window.innerWidth > 1000 && <EnterExam ID={id} />}
{window.innerWidth < 1000 && <MobileEnterExam ID={id} />}
{window.innerWidth > 1000 && (
<EnterExam setDontShowNav={setDontShowNav} ID={id} />
)}
{window.innerWidth < 1000 && (
<MobileEnterExam setDontShowNav={setDontShowNav} ID={id} />
)}
</div>
);
};

@ -21,8 +21,10 @@ let l1 = [];
let i = 0;
let l2 = [];
const Exam = ({ ID, isMobile }) => {
// const state = useSelector((state) => state.default);
const Exam = ({ ID, isMobile, examData }) => {
// const state = useSelector((state) => state.default);
console.log("rtttttttttttttttttttttttttt");
console.log(examData);
const [common_data] = useState(state);
// responsive-setting-for-choice-width----------------------------------
@ -846,8 +848,9 @@ const Exam = ({ ID, isMobile }) => {
}
}
return (
isMobile ? <M_Exam /> :
return isMobile ? (
<M_Exam />
) : (
<>
{data_list.map((item) => {
if (item.choices) {
@ -867,15 +870,11 @@ const Exam = ({ ID, isMobile }) => {
<div className="Es-exam-info-p1-text">
<div className="Es-eip1t-title">
<img src={icon1} alt="hat-icon" />
<div className="Es-eip1t-title-text">
{data?.name || ""}
</div>
<div className="Es-eip1t-title-text">{data?.name || ""}</div>
</div>
<div className="Es-eip1t-subtitle">
<VscCircleFilled className="Es-eip1t-subtitle-icon" />
<div className="Es-eip1t-subtitle-text">
{data?.text}
</div>
<div className="Es-eip1t-subtitle-text">{data?.text}</div>
</div>
</div>
<div className="Es-exam-info-p1-time">
@ -1050,6 +1049,7 @@ const mapStateToProps = (state) => ({
cartProductsLength: state.userProduct.list?.filter(
(product) => product.condition < 2
)?.length,
examData : state.exam2.list
});
const mapDispatchToProps = {

@ -1,19 +1,30 @@
import Header from "./Header";
import Questions from "./Questions";
import "./index.css";
import { connect } from "react-redux";
const Exam=()=>{
const Exam = ({ examData }) => {
console.log("||||||||||||||||||||||||||||");
console.log(examData);
return (
<div
className="Exam w-[100vw] px-28 pt-16 pb-8 relative"
style={{ width: "calc(100vw - 5px)" }}
>
<Header />
<Questions />
<Questions questions={examData?.questions} />
</div>
);
}
};
export default Exam;
const mapStateToProps = (state) => ({
examData : state.exam2.list
});
const mapDispatchToProps = {
};
export default connect(mapStateToProps, mapDispatchToProps)(Exam);

@ -1,154 +1,192 @@
import { useEffect, useState } from "react";
import { useEffect, useMemo, useState } from "react";
import { RiErrorWarningLine } from "react-icons/ri";
import './index.css';
import img1 from "../../assets/img/4bea9a991c6b23d3dcaf231513ee94bd.jpg";
let data = [
{
id: 1,
text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟",
img: null,
choices: [
"گزینه اول که درست نیست",
"گزینه دوم که این هم درست نیست",
"گزینه سوم",
"همه گزینهها",
],
guidance: null,
choiceWidth: null,
choiceHeight: null,
},
{
id: 2,
text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟",
img: img1,
choices: ["11", "22", "33", "44"],
guidance:
"راهنمایی در مورد این سوال: در رابطه با سوال بالا سعی کنید دقت لازم را بعمل آورده و تمامی گذاره ها را در نظر بگیرید",
choiceWidth: null,
choiceHeight: null,
},
{
id: 3,
text: null,
img: img1,
choices: [
"گزینه کوتاه",
"گزینه متوسط",
"گزینه بلند",
"گزینه خیلی خیلی خیلی خیلی خیلی بلـــــــند",
],
guidance:
"راهنمایی در مورد این سوال: در رابطه با سوال بالا سعی کنید دقت لازم را بعمل آورده و تمامی گذاره ها را در نظر بگیرید",
choiceWidth: null,
choiceHeight: null,
},
{
id: 4,
text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟",
img: null,
choices: [
"لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است ",
"22",
"33",
"44",
],
guidance: null,
choiceWidth: null,
choiceHeight: null,
},
// {
// id: 5,
// text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟",
// img: "",
// choices: [
// "تیرتسیذر",
// "22",
// "بتربدر",
// "تیدرتسر",
// "تشدتنسدر",
// "ستیذزتن"
// ],
// guidance:"",
// choiceWidth: null,
// choiceHeight: null,
// },
];
// let data = [
// {
// id: 1,
// text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟",
// img: null,
// choices: [
// "گزینه اول که درست نیست",
// "گزینه دوم که این هم درست نیست",
// "گزینه سوم",
// "همه گزینهها",
// ],
// guidance: null,
// choiceWidth: null,
// choiceHeight: null,
// },
// {
// id: 2,
// text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟",
// img: img1,
// choices: ["11", "22", "33", "44"],
// guidance:
// "راهنمایی در مورد این سوال: در رابطه با سوال بالا سعی کنید دقت لازم را بعمل آورده و تمامی گذاره ها را در نظر بگیرید",
// choiceWidth: null,
// choiceHeight: null,
// },
// {
// id: 3,
// text: null,
// img: img1,
// choices: [
// "گزینه کوتاه",
// "گزینه متوسط",
// "گزینه بلند",
// "گزینه خیلی خیلی خیلی خیلی خیلی بلـــــــند",
// ],
// guidance:
// "راهنمایی در مورد این سوال: در رابطه با سوال بالا سعی کنید دقت لازم را بعمل آورده و تمامی گذاره ها را در نظر بگیرید",
// choiceWidth: null,
// choiceHeight: null,
// },
// {
// id: 4,
// text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟",
// img: null,
// choices: [
// "لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است ",
// "22",
// "33",
// "44",
// ],
// guidance: null,
// choiceWidth: null,
// choiceHeight: null,
// },
// // {
// // id: 5,
// // text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟",
// // img: "",
// // choices: [
// // "تیرتسیذر",
// // "22",
// // "بتربدر",
// // "تیدرتسر",
// // "تشدتنسدر",
// // "ستیذزتن"
// // ],
// // guidance:"",
// // choiceWidth: null,
// // choiceHeight: null,
// // },
// ];
//badgeList-------------
let badgeList = ["الف", "ب", "ج", "د","هـ","ز"];
const Questions = () => {
const [Data, setData] = useState(data);
const Questions = ({questions}) => {
const [Data, setData] = useState(null);
console.log("exam render-----------------")
console.log(Data);
const [fake, setFake] = useState(0);
const [layoutTrigger,setLayoutTrigger]=useState(0);
const [answerList, setAnswerList] = useState([]);
//choice layout setting-& default answer-----------------
//create local data from api data -------------------------------------
const createChoices=(item)=>{
let list = [];
let options = [
item["question.option1"],
item["question.option2"],
item["question.option3"],
item["question.option4"],
item["question.option5"],
];
for (let i = 0; i < item["question.type"]; i++) {
list.push(options[i]);
}
return(list)
}
useEffect(() => {
let newData = Data;
let defaultAnswers = [];
let Choice = document.querySelectorAll(".Choice");
let examSize = document.querySelector(".Choice-container").offsetWidth - 58;
console.log(examSize);
for (let i = 0; i < data.length; i++) {
defaultAnswers.push("");
console.log(i + 1 + ":-----------------------");
//پیدا کردن تعداد گزینه ها
let choiceNumber = data[i].choices.length;
//پیدا کردن اندازه هر گزینه
let wList = [];
let hList = [];
for (let j = 0; j < data[i].choices.length; j++) {
let w = Choice[i * choiceNumber + j].offsetWidth;
wList.push(w);
let h = Choice[i * choiceNumber + j].offsetHeight;
hList.push(h);
}
console.log("wList:");
console.log(wList);
wList.sort(function (a, b) {
return b - a;
});
hList.sort(function (a, b) {
return b - a;
let newList =[];
console.log("create data useEffect------------------------");
for (let i = 0; i < questions?.length; i++) {
newList.push({
id: questions[i]["question.id"],
text: questions[i]["question.text"],
fileId: questions[i]["question.fileId"],
choices: createChoices(questions[i]),
guidance: questions[i]["question.help"],
choiceWidth: null,
choiceHeight: null,
});
console.log("wList:");
console.log(wList);
//پیدا کردن بزرگ ترین گزینه
let wMax = wList[0];
let hMax = hList[0];
console.log("wMax:" + wMax);
//چک کردن اندازه بزرگ ترین عضو با توجه به تعداد گزینه ها و اندازه صفحه و اعمال تنظیمات اندازه
newData[i].choiceHeight = hMax;
if (wMax < 0.23 * examSize && choiceNumber === 4) {
newData[i].choiceWidth = 23;
console.log("o");
} else if (wMax < 0.32 * examSize && choiceNumber === 3) {
newData[i].choiceWidth = 32;
console.log("oo");
} else if (wMax < 0.47 * examSize && choiceNumber === 2) {
newData[i].choiceWidth = 48;
console.log("ooo");
} else if (wMax < 0.48 * examSize && choiceNumber === 4) {
newData[i].choiceWidth = 48;
console.log("oooo");
} else if (wMax < 0.18 * examSize && choiceNumber === 5) {
newData[i].choiceWidth = 18;
console.log("oo");
} else if (wMax < 0.15 * examSize && choiceNumber === 6) {
newData[i].choiceWidth = 15;
console.log("oo");
} else {
newData[i].choiceWidth = "full";
console.log("ooooo");
}
setData(newList);
console.log("created data-----------------------");
console.log(newList);
setFake(Math.random()*10000);
setLayoutTrigger(Math.random() * 10000);
}, [questions]);
//--------------------------------------------------
//choice layout setting-& default answer-----------------
useEffect(() => {
console.log(
"choice layout setting-& default answer-----------------------"
);
console.log(Data);
if (Data) {
let newData = Data;
let data = Data;
let defaultAnswers = [];
let Choice = document.querySelectorAll(".Choice");
let examSize =
document.querySelector(".Choice-container")?.offsetWidth - 58;
for (let i = 0; i < data?.length; i++) {
defaultAnswers.push("");
//پیدا کردن تعداد گزینه ها
let choiceNumber = data[i].choices.length;
//پیدا کردن اندازه هر گزینه
let wList = [];
let hList = [];
for (let j = 0; j < data[i].choices.length; j++) {
let w = Choice[i * choiceNumber + j].offsetWidth;
wList.push(w);
let h = Choice[i * choiceNumber + j].offsetHeight;
hList.push(h);
}
console.log("wList:");
console.log(wList);
wList.sort(function (a, b) {
return b - a;
});
hList.sort(function (a, b) {
return b - a;
});
console.log("wList:");
console.log(wList);
//پیدا کردن بزرگ ترین گزینه
let wMax = wList[0];
let hMax = hList[0];
console.log("wMax:" + wMax);
//چک کردن اندازه بزرگ ترین عضو با توجه به تعداد گزینه ها و اندازه صفحه و اعمال تنظیمات اندازه
newData[i].choiceHeight = hMax;
if (wMax < 0.23 * examSize && choiceNumber === 4) {
newData[i].choiceWidth = 23;
} else if (wMax < 0.32 * examSize && choiceNumber === 3) {
newData[i].choiceWidth = 32;
} else if (wMax < 0.47 * examSize && choiceNumber === 2) {
newData[i].choiceWidth = 48;
} else if (wMax < 0.48 * examSize && choiceNumber === 4) {
newData[i].choiceWidth = 48;
} else if (wMax < 0.18 * examSize && choiceNumber === 5) {
newData[i].choiceWidth = 18;
} else if (wMax < 0.15 * examSize && choiceNumber === 6) {
newData[i].choiceWidth = 15;
} else {
newData[i].choiceWidth = "full";
}
}
setData(newData);
setAnswerList(defaultAnswers);
setFake(fake + 1);
}
setData(newData);
setAnswerList(defaultAnswers);
setFake(fake + 1);
}, []);
}, [questions, layoutTrigger]);
//choose choice-----------------------------
const [counter,setCounter]=useState(0);
const [counter, setCounter] = useState(0);
const chooseHandler = (index, answer) => {
let list = answerList;
if (list[index] !== answer) {
@ -158,7 +196,7 @@ const Questions = () => {
list[index] = answer;
} else {
list[index] = "";
setCounter(counter-1);
setCounter(counter - 1);
}
setAnswerList(list);
setFake(fake + 1);
@ -166,7 +204,7 @@ const Questions = () => {
return (
<div className="Questions w-full mt-10">
{Data.map((item, index) => (
{Data?.map((item, index) => (
<div key={index} className="Questions-item w-full mb-24">
{/* -----question-text----------------------- */}
<div className="Questions-item-text-container w-full flex flex-row-reverse">
@ -174,22 +212,22 @@ const Questions = () => {
{index + 1}
</div>
<div className="Qitc-text w-full mr-2">
{item.text && (
{item?.text && (
<div
className="w-full text-right text-base"
style={{ direction: "rtl" }}
>
{item.text}
{item?.text}
</div>
)}
{/* -----question-img----------------------- */}
{item.img && (
{item?.fileId && (
<div
className="w-full"
style={item.text ? { marginTop: "10px" } : null}
>
<img
src={item.img}
src={item?.fileId}
alt="question-img"
className="w-full rounded-md"
/>
@ -199,7 +237,7 @@ const Questions = () => {
</div>
{/* -----choices----------------------------- */}
<div className="Choice-container w-full pr-12 mt-10 flex flex-row-reverse justify-between flex-wrap gap-y-5">
{item.choices.map((choice, INDEX) => (
{item?.choices?.map((choice, INDEX) => (
<div
key={INDEX}
className="Choice flex shrink-0 flex-row-reverse cursor-pointer"

@ -1,29 +1,25 @@
import React, { useEffect } from 'react'
import { useState } from 'react';
import React, { useEffect } from "react";
import { useState } from "react";
// import { Document, Page } from "react-pdf";
import { Viewer, Worker } from "@react-pdf-viewer/core";
// Import the styles
import "@react-pdf-viewer/core/lib/styles/index.css";
const optionNum = ["", "الف", "ب", "پ", "ت", "ث", "ج", "چ", "ح"];
const ViewExamNote = ({ notes ,questions}) => {
const [activeNote,setActiveNote]=useState(0);
const ViewExamNote = ({ notes, questions }) => {
const [activeNote, setActiveNote] = useState(0);
const [activeFileId, setActiveFileId] = useState(null);
const changeNoteHandler=(index,fileId)=>{
const changeNoteHandler = (index, fileId) => {
setActiveNote(index);
setActiveFileId(fileId);
}
};
useEffect(()=>{
useEffect(() => {
setActiveFileId(notes[0].fileId);
},[notes])
}, [notes]);
console.log("rrrrrrrrrrrr============")
console.log("rrrrrrrrrrrr============");
console.log(activeFileId);
const createOptions = (item) => {
@ -63,11 +59,11 @@ const ViewExamNote = ({ notes ,questions}) => {
>
<Worker workerUrl="https://unpkg.com/pdfjs-dist@2.13.216/build/pdf.worker.min.js">
<Viewer
fileUrl={`https://new.andishmand.ir/api/v1/file/${activeFileId}`}
fileUrl={`https://api.andishmand.ir/api/v1/file/${activeFileId}`}
/>
</Worker>
{/* <Document
file={`https://new.andishmand.ir/api/v1/file/${activeFileId}`}
file={`https://api.andishmand.ir/api/v1/file/${activeFileId}`}
onLoadSuccess={onDocumentLoadSuccess}
>
<Page pageNumber={pageNumber} />
@ -130,4 +126,4 @@ const ViewExamNote = ({ notes ,questions}) => {
);
};
export default ViewExamNote
export default ViewExamNote;

@ -1,14 +1,12 @@
import closeBtn from "../../assets/img/Group 1862.svg";
import React from 'react'
import React from "react";
const Budget = ({ setShowBudget, setBudgetFileId, budgetFileId }) => {
const closeHandler=()=>{
const closeHandler = () => {
setShowBudget(false);
setBudgetFileId(false);
}
};
return (
<div
className="w-[93.5vw] h-[93.5vh] fixed top-[6.5%] left-0 flex justify-center backdrop-blur bg-[#9999991A] overflow-y-auto z-[100]"
@ -24,7 +22,7 @@ const Budget = ({ setShowBudget, setBudgetFileId, budgetFileId }) => {
<div className="w-[70%] mt-16">
{budgetFileId && (
<img
src={`https://new.andishmand.ir/api/v1/file/${budgetFileId}`}
src={`https://api.andishmand.ir/api/v1/file/${budgetFileId}`}
alt=""
className="w-full"
/>
@ -39,4 +37,4 @@ const Budget = ({ setShowBudget, setBudgetFileId, budgetFileId }) => {
);
};
export default Budget
export default Budget;

@ -144,12 +144,12 @@ const PaymentBox = ({
if (window.innerWidth > 1000) {
payment({
price: item.amount,
redirectUrl: "https://new.andishmand.ir/services",
redirectUrl: "https://api.andishmand.ir/services",
});
} else {
payment({
price: item.amount,
redirectUrl: "https://new.andishmand.ir/shoppingCart",
redirectUrl: "https://api.andishmand.ir/shoppingCart",
});
}
// payment({

@ -13,7 +13,7 @@ const servicePopUp = ({
setShowBudget,
setBudgetFileId,
userInfo,
pushToCart
pushToCart,
}) => {
console.log(")))))((((((((((");
console.log(content);
@ -38,10 +38,10 @@ const servicePopUp = ({
console.log(childList);
console.log(parentLength);
if (parentLength === childList.length) {
pushToCart({ productId :content.product.id,count:1});
pushToCart({ productId: content.product.id, count: 1 });
} else {
for(let j=0;j<childList.length;j++){
pushToCart({productId:childList[j],count:1})
for (let j = 0; j < childList.length; j++) {
pushToCart({ productId: childList[j], count: 1 });
}
}
};
@ -266,21 +266,23 @@ const servicePopUp = ({
</div>
))}
</div>
{rulesAccepted && <div className="w-full flex mt-5">
<div
className="w-40 h-12 rounded bg-[#DF1452] flex items-center justify-center text-[#fff] cursor-pointer text-sm"
onClick={addToCartHandler}
>
افزودن به سبد خرید
{rulesAccepted && (
<div className="w-full flex mt-5">
<div
className="w-40 h-12 rounded bg-[#DF1452] flex items-center justify-center text-[#fff] cursor-pointer text-sm"
onClick={addToCartHandler}
>
افزودن به سبد خرید
</div>
</div>
</div>}
)}
</div>
)}
{content.id === 3 && (
<video className="w-1/2 rounded-md" controls>
<source
src={`https://new.andishmand.ir/api/v1/file/${content?.video}`}
src={`https://api.andishmand.ir/api/v1/file/${content?.video}`}
type="video/mp4"
/>
</video>
@ -288,7 +290,7 @@ const servicePopUp = ({
{content.id === 1 && (
<img
src={`https://new.andishmand.ir/api/v1/file/${content?.product?.fileId}`}
src={`https://api.andishmand.ir/api/v1/file/${content?.product?.fileId}`}
className="w-1/3 rounded-md mt-4"
alt="Content"
/>

@ -27,6 +27,8 @@ const UserManagement = ({
}, []);
// console.log(info);
console.log(schoolList);
console.log("==============^tabs^==============");
console.log(tabs);
useEffect(() => {
setTabs([
{
@ -38,6 +40,8 @@ const UserManagement = ({
]);
}, []);
console.log("ProductManagement render---------------------------------");
console.log(info);
console.log(schoolUserList);
// console.log(tabs);
// const [tabs, setTabs] = useState([
// {
@ -87,8 +91,8 @@ const UserManagement = ({
)}
<div className="flex flex-1 w-full pt-12 pb-4">
<Table
data={info.list || []}
schema={info.schema || []}
data={info?.schoolUserList || []}
schema={info?.schema || []}
Editor={Editor}
add={add}
update={update}
@ -106,7 +110,7 @@ const UserManagement = ({
);
};
const mapStateToProps = (state) => ({
info: state[source].schoolUserList,
info: state[source],
tabs: state.table.tabs,
schoolList: state.book.list,
schoolUserList: state.book.schoolUserList,

@ -181,7 +181,7 @@ const datehandler=(value,mode)=>{
))}
</div>
<div
className="px-6 py-4 w-fit rounded-md bg-[#3C58EB] text-[#fff] text-base cursor-pointer mx-auto mt-6"
className="px-6 py-4 w-fit rounded-md bg-[#df1452] text-[#fff] text-base cursor-pointer mx-auto mt-6"
onClick={submitHandler}
>
{data ? "ثبت تغییرات" : "ثبت ردیف"}

Loading…
Cancel
Save