CN111079390A - Method and device for determining selection state of check box list - Google Patents

Method and device for determining selection state of check box list Download PDF

Info

Publication number
CN111079390A
CN111079390A CN201911321739.1A CN201911321739A CN111079390A CN 111079390 A CN111079390 A CN 111079390A CN 201911321739 A CN201911321739 A CN 201911321739A CN 111079390 A CN111079390 A CN 111079390A
Authority
CN
China
Prior art keywords
check box
selection state
state
array
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911321739.1A
Other languages
Chinese (zh)
Other versions
CN111079390B (en
Inventor
翁佳城
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuba Co Ltd
Original Assignee
Wuba Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuba Co Ltd filed Critical Wuba Co Ltd
Priority to CN201911321739.1A priority Critical patent/CN111079390B/en
Publication of CN111079390A publication Critical patent/CN111079390A/en
Application granted granted Critical
Publication of CN111079390B publication Critical patent/CN111079390B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a method and a device for determining the selection state of a check box list, wherein the method comprises the following steps: acquiring a mapping array corresponding to the check box list; under the condition that the operation of a target check box in the check boxes is monitored, changing the value of the target element corresponding to the target check box into a first numerical value or a second numerical value according to the value of the target element corresponding to the target check box; acquiring a first element with the median of a plurality of elements as a first numerical value, and adding the first element into a first array; and determining the selection state of the check box list to be any one state of a full selection state, a non-selection state and a multi-selection state according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array. In this way, the selection state of the check box list can be represented in a manner of mapping an array without acquiring the current states of all check boxes. Resources are saved.

Description

Method and device for determining selection state of check box list
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for determining a selection state of a check box list.
Background
In order to reduce the user's effort when using form design questionnaires, the user is typically provided with candidate answers to each question and corresponding selection box options. The selection boxes will vary depending on the question and the candidate answer in the questionnaire. Generally, there are two types of check boxes, namely a radio box and a check box. Radio boxes are distinguished from check boxes in that the user can only select one of the options in the radio box. While for options in the check box, the user can select any option, even a full selection. In many scenarios, the selection state of the selection box needs to be determined so as to facilitate corresponding processing. For example, when a selection box is found to be unable to be further processed because the user has not made a selection, the user is prompted to make the selection.
In the case where the check boxes are check boxes, a plurality of check boxes corresponding to a plurality of candidate answers to each question may form one check box list. In the prior art, when the selection state of the check box list is determined, the current state of each check box is acquired, and then the selection state of the check box list is determined according to the current state of each check box. However, when there are many check boxes, acquiring the current states of all the check boxes consumes a lot of resources, resulting in waste of resources.
Disclosure of Invention
The application provides a method and a device for determining the selection state of a check box list, which are used for solving the problem that in the prior art, when the selection state of the check box list is determined, the current state of each check box needs to be acquired, so that resources are wasted.
In a first aspect, the present invention provides a method for determining a selection state of a check box list, including:
acquiring a mapping array corresponding to a check box list, wherein the check box list comprises a plurality of check boxes, the mapping array comprises a plurality of elements, the check boxes correspond to the elements one to one, the value of each element is a first numerical value or a second numerical value, the first numerical value corresponds to the checking state of the check box, and the second numerical value corresponds to the non-checking state of the check box;
under the condition that it is monitored that a target check box in the check boxes is operated, changing the value of a target element corresponding to the target check box into the first numerical value or the second numerical value according to the value of the target element corresponding to the target check box;
acquiring a first element of which the median of the elements is the first numerical value, and adding the first element into a first array;
and determining the selection state of the check box list to be any one state of a full selection state, a non-selection state and a multi-selection state according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array.
Further, the determining, according to the number of the first elements included in the first array and the number of the plurality of elements included in the mapping array, that the selection state of the check box list is any one of a fully selected state, an unselected state, and a multi-selection state includes:
and determining that the selection state of the check box list is a full selection state when the number of first elements contained in the first array is equal to the number of a plurality of elements contained in the mapping array.
Further, the determining, according to the number of the first elements included in the first array and the number of the plurality of elements included in the mapping array, that the selection state of the check box list is any one of a fully selected state, an unselected state, and a multi-selection state includes:
determining that the selection state of the check box list is an unselected state if the number of first elements included in the first array is zero.
Further, the determining, according to the number of the first elements included in the first array and the number of the plurality of elements included in the mapping array, that the selection state of the check box list is any one of a fully selected state, an unselected state, and a multi-selection state includes:
determining that the selection state of the check box list is a multi-selection state if the number of first elements included in the first array is greater than zero and less than the number of the plurality of elements included in the mapping array.
Further, after the step of changing the value of the target element corresponding to the target check box to the first numerical value or the second numerical value, the method further includes:
under the condition that the value of a target element corresponding to the target check box is changed into the first numerical value, updating the state of the target check box into a checked state;
and updating the state of the target check box to be an unchecked state under the condition that the value of the target element corresponding to the target check box is changed to be the second numerical value.
In a second aspect, the present invention further provides an apparatus for determining a selection status of a check box list, including:
the system comprises an acquisition module, a check box list generation module and a check box selection module, wherein the check box list comprises a plurality of check boxes, the mapping array comprises a plurality of elements, the check boxes correspond to the elements one to one, the value of each element is a first numerical value or a second numerical value, the first numerical value corresponds to the checking state of the check box, and the second numerical value corresponds to the non-checking state of the check box;
a changing module, configured to change, when it is monitored that a target check box of the multiple check boxes is operated, a value of a target element corresponding to the target check box to the first numerical value or the second numerical value according to a value of the target element corresponding to the target check box;
the adding module is used for acquiring a first element of which the median value of the elements is the first numerical value, and adding the first element into a first array;
and the determining module is used for determining the selection state of the check box list to be any one of a full selection state, an unselected state and a multi-selection state according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array.
Further, the determining module is specifically configured to determine that the selection state of the check box list is the full selection state if the number of first elements included in the first array is equal to the number of the plurality of elements included in the mapping array.
Further, the determining module is specifically configured to determine that the selection state of the check box list is an unselected state when the number of first elements included in the first array is zero.
Further, the determining module is specifically configured to determine that the selection state of the check box list is a multiple-selection state if the number of first elements included in the first array is greater than zero and less than the number of the plurality of elements included in the mapping array.
Further, the device for determining the selection state of the check box list further includes:
the first updating module is used for updating the state of the target check box to a checked state under the condition that the value of the target element corresponding to the target check box is changed into the first numerical value;
and the second updating module is used for updating the state of the target check box to be in an unchecked state under the condition that the value of the target element corresponding to the target check box is changed to be the second numerical value.
In a third aspect, the present invention further provides an electronic device, including:
a memory for storing program instructions;
and the processor is used for calling and executing the program instructions in the memory so as to realize the check box list selection state determination method of the first aspect.
In a fourth aspect, the present invention also provides a readable storage medium in which a computer program is stored, and when at least one processor of the check box list selection state determination device executes the computer program, the check box list selection state determination device executes the check box list selection state determination method according to the first aspect.
As can be seen from the above technical solutions, according to the method and the device for determining the selection state of the check box list provided in the embodiments of the present invention, a mapping array corresponding to the check box list is obtained, where the check box list includes a plurality of check boxes, the mapping array includes a plurality of elements, the check boxes correspond to the elements one to one, a value of each element is a first value or a second value, the first value corresponds to the selection state of the check box, and the second value corresponds to the non-selection state of the check box; under the condition that it is monitored that a target check box in the check boxes is operated, changing the value of a target element corresponding to the target check box into the first numerical value or the second numerical value according to the value of the target element corresponding to the target check box; acquiring a first element of which the median of the elements is the first numerical value, and adding the first element into a first array; and determining the selection state of the check box list to be any one state of a full selection state, a non-selection state and a multi-selection state according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array. In this way, the selection state of the check box list can be determined according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array, that is, the selection state of the check box list can be represented in the manner of the mapping array without acquiring the current states of all the check boxes. Resources are saved.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for determining a selection state of a check box list according to the present invention;
FIG. 2 is a schematic diagram of a check box list provided by the present invention;
FIG. 3 is a flow chart of another method for determining the selection status of a list of check boxes according to the present invention;
FIG. 4 is a schematic diagram illustrating updating the status of a second check box to a checked status according to the present invention;
FIG. 5 is a schematic diagram of updating the status of the third check box to an unchecked status according to the present invention;
fig. 6 is a structural diagram of a check box list selection state determination apparatus according to the present invention;
FIG. 7 is a block diagram of another check box list selection state determining apparatus according to the present invention;
fig. 8 is a schematic diagram of a hardware structure of an electronic device according to the present invention.
Detailed Description
Reference will now be made in detail to embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following examples do not represent all embodiments consistent with the present application. But merely as exemplifications of systems and methods consistent with certain aspects of the application, as recited in the claims.
Referring to fig. 1, fig. 1 is a flowchart of a method for determining a selection state of a check box list according to the present invention. As shown in fig. 1, the method comprises the following steps:
step 101, obtaining a mapping array corresponding to a check box list, wherein the check box list comprises a plurality of check boxes, the mapping array comprises a plurality of elements, the check boxes correspond to the elements one by one, the value of each element is a first numerical value or a second numerical value, the first numerical value corresponds to the checking state of the check box, and the second numerical value corresponds to the non-checking state of the check box.
In step 101, a mapping array corresponding to the check box list may be obtained. The check box list can comprise a plurality of check boxes, the mapping array can comprise a plurality of elements, the check boxes correspond to the elements one by one, the value of each element can be a first numerical value or a second numerical value, the first numerical value corresponds to the checked state of the check box, and the second numerical value corresponds to the unchecked state of the check box. For example, the check box list may contain 5 check boxes, and accordingly, the mapping array may contain 5 elements, and the 5 check boxes and the 5 elements may correspond one to one. The value of each element may be a first value of 1 or a second value of 0, with the first value of 1 corresponding to the checked state of the check box and the second value of 0 corresponding to the unchecked state of the check box. Fig. 2 is a schematic diagram of a check box list. In fig. 2, a total of 5 check boxes are included, and the first check box, the second check box, the fourth check box and the fifth check box are all in an unchecked state, and at this time, the values of the elements corresponding to the four check boxes are all the second numerical value 0; the third check box is in a checking state, and the value of the element corresponding to the third check box is the first numerical value 1.
102, changing the value of the target element corresponding to the target check box to the first numerical value or the second numerical value according to the value of the target element corresponding to the target check box when it is monitored that the target check box in the plurality of check boxes is operated.
In step 102, in the case that it is monitored that a target check box of the plurality of check boxes is operated, the value of the target element corresponding to the target check box may be changed to a first numerical value or a second numerical value according to the value of the target element corresponding to the target check box. For example, still taking fig. 2 as an example, in a case that it is monitored that the second check box of the 5 check boxes is operated, the value of the target element corresponding to the second check box may be changed to the first value 1 according to the second value 0 of the target element corresponding to the second check box. Or, in a case that it is monitored that the third check box of the 5 check boxes is operated, the value of the target element corresponding to the third check box may be changed to the second numerical value 0 according to the first numerical value 1 of the target element corresponding to the third check box.
Step 103, obtaining a first element of which the median of the plurality of elements is the first numerical value, and adding the first element into a first array.
In step 103, a first element with a first value of 1 among the plurality of elements may be obtained and added to the first array.
And 104, determining the selection state of the check box list to be any one of a full selection state, an unselected state and a multi-selection state according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array.
In step 104, the selection status of the check box list can be determined to be any one of the full selection status, the unselected status and the multi-selection status according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array.
In the prior art, when the selection state of the check box list is determined, the current state of each check box is acquired, and the selection state of the check box list is determined according to the current state of each check box. However, when there are many check boxes, acquiring the current states of all the check boxes consumes a lot of resources, resulting in waste of resources.
In the application, the selection state of the check box list can be determined according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array, that is, the selection state of the check box list can be represented in the manner of mapping array without acquiring the current states of all check boxes. Resources are saved.
As can be seen from the foregoing technical solutions, in the method for determining the selection state of the check box list provided in the embodiment of the present invention, a mapping array corresponding to the check box list is obtained, where the check box list includes a plurality of check boxes, the mapping array includes a plurality of elements, the check boxes correspond to the elements one to one, a value of each element is a first numerical value or a second numerical value, the first numerical value corresponds to the selection state of the check box, and the second numerical value corresponds to the non-selection state of the check box; under the condition that it is monitored that a target check box in the check boxes is operated, changing the value of a target element corresponding to the target check box into the first numerical value or the second numerical value according to the value of the target element corresponding to the target check box; acquiring a first element of which the median of the elements is the first numerical value, and adding the first element into a first array; and determining the selection state of the check box list to be any one state of a full selection state, a non-selection state and a multi-selection state according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array. In this way, the selection state of the check box list can be determined according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array, that is, the selection state of the check box list can be represented in the manner of the mapping array without acquiring the current states of all the check boxes. Resources are saved.
Referring to fig. 3, fig. 3 is a flowchart of another method for determining the selection status of the check box list according to the present invention. As shown in fig. 3, the method comprises the following steps:
301, obtaining a mapping array corresponding to a check box list, wherein the check box list includes a plurality of check boxes, the mapping array includes a plurality of elements, the check boxes correspond to the elements one to one, a value of each element is a first numerical value or a second numerical value, the first numerical value corresponds to a checked state of the check box, and the second numerical value corresponds to an unchecked state of the check box.
In step 301, a mapping array corresponding to the check box list may be obtained. The check box list can comprise a plurality of check boxes, the mapping array can comprise a plurality of elements, the check boxes correspond to the elements one by one, the value of each element can be a first numerical value or a second numerical value, the first numerical value corresponds to the checked state of the check box, and the second numerical value corresponds to the unchecked state of the check box. For example, the check box list may contain 5 check boxes, and accordingly, the mapping array may contain 5 elements, and the 5 check boxes and the 5 elements may correspond one to one. The value of each element may be a first value of 1 or a second value of 0, with the first value of 1 corresponding to the checked state of the check box and the second value of 0 corresponding to the unchecked state of the check box. Still taking fig. 2 as an example, in fig. 2, a total of 5 check boxes are included, and the first check box, the second check box, the fourth check box and the fifth check box are all in an unchecked state, and at this time, the values of the elements corresponding to the four check boxes are all the second value 0; the third check box is in a checking state, and the value of the element corresponding to the third check box is the first numerical value 1.
Step 302, changing the value of the target element corresponding to the target check box to the first numerical value or the second numerical value according to the value of the target element corresponding to the target check box when it is monitored that the target check box in the plurality of check boxes is operated.
In step 302, in the case that it is monitored that a target check box of the plurality of check boxes is operated, the value of the target element corresponding to the target check box may be changed to a first numerical value or a second numerical value according to the value of the target element corresponding to the target check box. For example, still taking fig. 2 as an example, in a case that it is monitored that the second check box of the 5 check boxes is operated, the value of the target element corresponding to the second check box may be changed to the first value 1 according to the second value 0 of the target element corresponding to the second check box. Or, in a case that it is monitored that the third check box of the 5 check boxes is operated, the value of the target element corresponding to the third check box may be changed to the second numerical value 0 according to the first numerical value 1 of the target element corresponding to the third check box.
And 303, updating the state of the target check box to a checked state under the condition that the value of the target element corresponding to the target check box is changed into the first numerical value.
In step 303, when the value of the target element corresponding to the target check box is changed to the first numerical value 1, the state of the target check box may be updated to the checked state. For example, as described above, when it is monitored that the second check box of the 5 check boxes is operated, the value of the target element corresponding to the second check box may be changed to the first value 1 according to the second value 0 of the target element corresponding to the second check box, and the state of the second check box may be updated from the previous unchecked state to the checked state. Fig. 4 is a schematic diagram illustrating the state of the second check box being updated to the checked state.
And 304, updating the state of the target check box to be in an unchecked state under the condition that the value of the target element corresponding to the target check box is changed to the second numerical value.
In step 304, the state of the target check box may be updated to an unchecked state if the value of the target element corresponding to the target check box is changed to the second value. For example, as described above, when it is monitored that the third check box of the 5 check boxes is operated, the value of the target element corresponding to the third check box may be changed to the second numerical value 0 according to the first numerical value 1 of the target element corresponding to the third check box, and the state of the third check box may be updated from the previous checked state to the unchecked state. Fig. 5 is a schematic diagram illustrating the state of the third check box being updated to an unchecked state.
Step 305, obtaining a first element of which the median of the plurality of elements is the first numerical value, and adding the first element into a first array.
In step 305, a first element of the plurality of elements having a first value of 1 may be obtained and added to the first array.
Step 306, determining the selection state of the check box list to be any one of a full selection state, an unselected state and a multi-selection state according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array.
In step 306, the selection status of the check box list can be determined to be any one of the full selection status, the unselected status and the multi-selection status according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array.
Optionally, the determining, according to the number of the first elements included in the first array and the number of the plurality of elements included in the mapping array, that the selection state of the check box list is any one of a full selection state, an unselected state, and a multiple selection state includes:
and determining that the selection state of the check box list is a full selection state when the number of first elements contained in the first array is equal to the number of a plurality of elements contained in the mapping array.
It should be noted that, in the case where the number of first elements included in the first array is equal to the number of the plurality of elements included in the mapping array, that is, in the case where the number of elements included in the first array having the first value 1 is equal to the number of the plurality of elements included in the mapping array, the selection state of the check box list may be determined to be the full selection state.
Optionally, the determining, according to the number of the first elements included in the first array and the number of the plurality of elements included in the mapping array, that the selection state of the check box list is any one of a full selection state, an unselected state, and a multiple selection state includes:
determining that the selection state of the check box list is an unselected state if the number of first elements included in the first array is zero.
In the case where the number of first elements included in the first array is zero, that is, in the case where the number of elements included in the first array having a value of 1 is zero, it is possible to determine that the selection state of the check box list is the unselected state.
Optionally, the determining, according to the number of the first elements included in the first array and the number of the plurality of elements included in the mapping array, that the selection state of the check box list is any one of a full selection state, an unselected state, and a multiple selection state includes:
determining that the selection state of the check box list is a multi-selection state if the number of first elements included in the first array is greater than zero and less than the number of the plurality of elements included in the mapping array.
In a case where the number of first elements included in the first array is greater than zero and smaller than the number of the plurality of elements included in the mapping array, that is, in a case where the number of elements included in the first array having a value of the first numerical value 1 is greater than zero and smaller than the number of the plurality of elements included in the mapping array, it may be determined that the selection state of the check box list is the multi-selection state.
As can be seen from the foregoing technical solutions, in the method for determining the selection state of the check box list provided in the embodiment of the present invention, when the value of the target element corresponding to the target check box is changed to the first numerical value, the state of the target check box can be updated to the check state; in the case where the value of the target element corresponding to the target check box is changed to the second numerical value, the state of the target check box may be updated to the unchecked state. The selection state of the check box list can be determined according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array, that is, the selection state of the check box list can be represented in the mapping array mode without acquiring the current states of all the check boxes. Resources are saved.
Referring to fig. 6, fig. 6 is a block diagram of a check box list selection status determination apparatus according to the present invention. As shown in fig. 6, the device 600 for determining the selection status of a check box list includes an obtaining module 601, a changing module 602, an adding module 603, and a determining module 604, wherein:
an obtaining module 601, configured to obtain a mapping array corresponding to a check box list, where the check box list includes multiple check boxes, the mapping array includes multiple elements, the check boxes correspond to the elements one to one, a value of each element is a first numerical value or a second numerical value, the first numerical value corresponds to a checked state of the check box, and the second numerical value corresponds to an unchecked state of the check box;
a changing module 602, configured to, when it is monitored that a target check box of the multiple check boxes is operated, change a value of a target element corresponding to the target check box to the first numerical value or the second numerical value according to a value of the target element corresponding to the target check box;
an adding module 603, configured to obtain a first element whose median value is the first numerical value, and add the first element to a first array;
the determining module 604 is configured to determine, according to the number of the first elements included in the first array and the number of the plurality of elements included in the mapping array, that the selection state of the check box list is any one of a full selection state, an unselected state, and a multi-selection state.
Optionally, the determining module is specifically configured to determine that the selection state of the check box list is the full selection state when the number of the first elements included in the first array is equal to the number of the plurality of elements included in the mapping array.
Optionally, the determining module is specifically configured to determine that the selection state of the check box list is an unselected state when the number of first elements included in the first array is zero.
Optionally, the determining module is specifically configured to determine that the selection state of the check box list is a multiple-selection state when the number of first elements included in the first array is greater than zero and less than the number of multiple elements included in the mapping array.
Optionally, as shown in fig. 7, the device for determining the selection state of the check box list further includes:
a first updating module 605, configured to update the state of the target check box to a checked state when the value of the target element corresponding to the target check box is changed to the first numerical value;
a second updating module 606, configured to update the state of the target check box to an unchecked state when the value of the target element corresponding to the target check box is changed to the second numerical value.
The device 600 for determining the selection status of the check box list can implement each process implemented by the device for determining the selection status of the check box list in the embodiment of the method in fig. 1 and fig. 3, and is not described herein again to avoid repetition. The selection state determining device 600 of the check box list can update the state of the target check box to the check state when the value of the target element corresponding to the target check box is changed to the first numerical value; in the case where the value of the target element corresponding to the target check box is changed to the second numerical value, the state of the target check box may be updated to the unchecked state. The selection state of the check box list can be determined according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array, that is, the selection state of the check box list can be represented in the mapping array mode without acquiring the current states of all the check boxes. Resources are saved.
Fig. 8 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention. As shown in fig. 8, the electronic device includes:
a memory 801 for storing program instructions;
a processor 802, configured to call and execute the program instructions in the memory to implement the method for determining the selection status of the check box list in the above embodiments. Reference may be made in particular to the description in relation to the preceding embodiments.
In this embodiment, the processor 802 and the memory 801 may be connected by a bus or other means. The processor may be a general-purpose processor, such as a central processing unit, a digital signal processor, an application specific integrated circuit, or one or more integrated circuits configured to implement embodiments of the present invention. The memory may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, a hard disk, or a solid state disk.
An embodiment of the present invention further provides a readable storage medium, including: the readable storage medium has stored therein a computer program which, when executed by at least one processor of the check box list selection state determination means, performs the check box list selection state determination method described in the above-described embodiments.
The readable storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The same and similar parts in the various embodiments in this specification may be referred to each other. In particular, for the embodiments of the check box list selection state determining apparatus, the electronic device and the readable storage medium, since they are substantially similar to the method embodiments, the description is simple, and the relevant points can be referred to the description in the method embodiments.
The above-described embodiments of the present invention should not be construed as limiting the scope of the present invention.

Claims (12)

1. A method for determining a selection state of a check box list, comprising:
acquiring a mapping array corresponding to a check box list, wherein the check box list comprises a plurality of check boxes, the mapping array comprises a plurality of elements, the check boxes correspond to the elements one to one, the value of each element is a first numerical value or a second numerical value, the first numerical value corresponds to the checking state of the check box, and the second numerical value corresponds to the non-checking state of the check box;
under the condition that it is monitored that a target check box in the check boxes is operated, changing the value of a target element corresponding to the target check box into the first numerical value or the second numerical value according to the value of the target element corresponding to the target check box;
acquiring a first element of which the median of the elements is the first numerical value, and adding the first element into a first array;
and determining the selection state of the check box list to be any one state of a full selection state, a non-selection state and a multi-selection state according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array.
2. The method according to claim 1, wherein the determining that the selection state of the check box list is any one of a full selection state, a non-selection state and a multiple selection state according to the number of first elements contained in the first array and the number of a plurality of elements contained in the mapping array comprises:
and determining that the selection state of the check box list is a full selection state when the number of first elements contained in the first array is equal to the number of a plurality of elements contained in the mapping array.
3. The method according to claim 1, wherein the determining that the selection state of the check box list is any one of a full selection state, a non-selection state and a multiple selection state according to the number of first elements contained in the first array and the number of a plurality of elements contained in the mapping array comprises:
determining that the selection state of the check box list is an unselected state if the number of first elements included in the first array is zero.
4. The method according to claim 1, wherein the determining that the selection state of the check box list is any one of a full selection state, a non-selection state and a multiple selection state according to the number of first elements contained in the first array and the number of a plurality of elements contained in the mapping array comprises:
determining that the selection state of the check box list is a multi-selection state if the number of first elements included in the first array is greater than zero and less than the number of the plurality of elements included in the mapping array.
5. The method according to any one of claims 1 to 4, wherein after the step of changing the value of the target element corresponding to the target checkbox to the first numerical value or the second numerical value, the method further comprises:
under the condition that the value of a target element corresponding to the target check box is changed into the first numerical value, updating the state of the target check box into a checked state;
and updating the state of the target check box to be an unchecked state under the condition that the value of the target element corresponding to the target check box is changed to be the second numerical value.
6. An apparatus for determining a selection state of a check box list, comprising:
the system comprises an acquisition module, a check box list generation module and a check box selection module, wherein the check box list comprises a plurality of check boxes, the mapping array comprises a plurality of elements, the check boxes correspond to the elements one to one, the value of each element is a first numerical value or a second numerical value, the first numerical value corresponds to the checking state of the check box, and the second numerical value corresponds to the non-checking state of the check box;
a changing module, configured to change, when it is monitored that a target check box of the multiple check boxes is operated, a value of a target element corresponding to the target check box to the first numerical value or the second numerical value according to a value of the target element corresponding to the target check box;
the adding module is used for acquiring a first element of which the median value of the elements is the first numerical value, and adding the first element into a first array;
and the determining module is used for determining the selection state of the check box list to be any one of a full selection state, an unselected state and a multi-selection state according to the number of the first elements contained in the first array and the number of the plurality of elements contained in the mapping array.
7. The check box list selection state determining apparatus according to claim 6, wherein the determining module is specifically configured to determine that the selection state of the check box list is a full selection state in a case where the number of first elements included in the first array is equal to the number of the plurality of elements included in the mapping array.
8. The check box list selection state determining apparatus according to claim 6, wherein the determining module is specifically configured to determine that the selection state of the check box list is an unselected state in a case where the number of first elements included in the first array is zero.
9. The check box list selection state determining apparatus according to claim 6, wherein the determining module is specifically configured to determine that the selection state of the check box list is a multiple-selection state in a case where the number of first elements included in the first array is greater than zero and smaller than the number of the plurality of elements included in the mapping array.
10. The check box list selection state determining device according to any one of claims 6 to 9, wherein the check box list selection state determining device further comprises:
the first updating module is used for updating the state of the target check box to a checked state under the condition that the value of the target element corresponding to the target check box is changed into the first numerical value;
and the second updating module is used for updating the state of the target check box to be in an unchecked state under the condition that the value of the target element corresponding to the target check box is changed to be the second numerical value.
11. An electronic device, comprising:
a memory for storing program instructions;
a processor for calling and executing the program instructions in the memory to implement the check box list selection status determination method according to any one of claims 1 to 5.
12. A readable storage medium, characterized in that a computer program is stored therein, which when executed by at least one processor of a check box list selection state determination device, executes a check box list selection state determination method according to any one of claims 1 to 5.
CN201911321739.1A 2019-12-20 2019-12-20 Method and device for determining selection state of check box list Active CN111079390B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911321739.1A CN111079390B (en) 2019-12-20 2019-12-20 Method and device for determining selection state of check box list

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911321739.1A CN111079390B (en) 2019-12-20 2019-12-20 Method and device for determining selection state of check box list

Publications (2)

Publication Number Publication Date
CN111079390A true CN111079390A (en) 2020-04-28
CN111079390B CN111079390B (en) 2023-03-14

Family

ID=70315990

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911321739.1A Active CN111079390B (en) 2019-12-20 2019-12-20 Method and device for determining selection state of check box list

Country Status (1)

Country Link
CN (1) CN111079390B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590009A (en) * 2021-08-10 2021-11-02 中国农业银行股份有限公司 Method and device for processing mutual exclusion of multiple check boxes

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4686026B2 (en) * 1998-10-02 2011-05-18 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Mapping of control characteristics to GUI elements compatible with mode
US20140244653A1 (en) * 2013-02-24 2014-08-28 Yagi Corp. Manual Activity Prioritization
CN105005438A (en) * 2015-07-24 2015-10-28 广东欧珀移动通信有限公司 File selection method and device
CN110377203A (en) * 2019-06-26 2019-10-25 贵阳朗玛信息技术股份有限公司 A kind of method and device controlling check box
CN110516028A (en) * 2019-07-29 2019-11-29 贝壳技术有限公司 A kind of method and device for realizing complicated editing machine based on react
CN110597644A (en) * 2019-09-10 2019-12-20 深圳市元征科技股份有限公司 Data stream transmission method, transmission device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4686026B2 (en) * 1998-10-02 2011-05-18 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Mapping of control characteristics to GUI elements compatible with mode
US20140244653A1 (en) * 2013-02-24 2014-08-28 Yagi Corp. Manual Activity Prioritization
CN105005438A (en) * 2015-07-24 2015-10-28 广东欧珀移动通信有限公司 File selection method and device
CN110377203A (en) * 2019-06-26 2019-10-25 贵阳朗玛信息技术股份有限公司 A kind of method and device controlling check box
CN110516028A (en) * 2019-07-29 2019-11-29 贝壳技术有限公司 A kind of method and device for realizing complicated editing machine based on react
CN110597644A (en) * 2019-09-10 2019-12-20 深圳市元征科技股份有限公司 Data stream transmission method, transmission device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590009A (en) * 2021-08-10 2021-11-02 中国农业银行股份有限公司 Method and device for processing mutual exclusion of multiple check boxes

Also Published As

Publication number Publication date
CN111079390B (en) 2023-03-14

Similar Documents

Publication Publication Date Title
CN110222936B (en) Root cause positioning method and system of business scene and electronic equipment
CN109375912B (en) Model serialization method, device and storage medium
CN111079390B (en) Method and device for determining selection state of check box list
CN109829678B (en) Rollback processing method and device and electronic equipment
CN110928941B (en) Data fragment extraction method and device
CN109976905B (en) Memory management method and device and electronic equipment
CN111352610A (en) Interface return value modification method and device, electronic equipment and storage medium
CN108197074B (en) Fast Fourier Transform (FFT) data processing method and device
CN115797267A (en) Image quality evaluation method, system, electronic device, and storage medium
CN111884932B (en) Link determining method, device, equipment and computer readable storage medium
CN111352852B (en) Regression test case selection method and device
CN110021166B (en) Method and device for processing user travel data and computing equipment
CN109600245B (en) Automatic configuration method and device for server
CN108519885B (en) Public resource loading method and device based on Flash
CN112286704A (en) Processing method and device of delay task, computer equipment and storage medium
CN111709210A (en) Method and device for generating component list, terminal equipment and storage medium
CN111243250B (en) Maintenance early warning method, device and equipment based on alarm data
CN109241066B (en) Request processing method and device
CN109688578A (en) A kind of method and apparatus that SIM card is adapted to mobile terminal device
CN113554126B (en) Sample evaluation method, device, equipment and computer readable storage medium
CN116048978B (en) Software service performance self-adaptive test method, system, terminal and medium
CN115081233B (en) Flow simulation method and electronic equipment
CN111144973B (en) Question ranking method and computer-readable storage medium
CN109344166B (en) Database monitoring method, computer readable storage medium and terminal device
CN110795076B (en) Data processing method and device for realizing basic logic algorithm

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant