Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting not really working #72

Closed
eyerean opened this issue Feb 9, 2017 · 21 comments
Closed

Sorting not really working #72

eyerean opened this issue Feb 9, 2017 · 21 comments

Comments

@eyerean
Copy link

eyerean commented Feb 9, 2017

Yet another sorting issue..!

I need to sort my data according to only one column with IDs, so I have set the sort: 'asc', but sorting is not really well done. Clicking the column header changes the sorting but in a weird way, some rows are ordered, some are not.

I am also pivoting by 2 columns, but even when I don't, my data still is not shown in a sorted order. Also not working if I pivot by more columns. So pivoting is not the issue here I think.

The data that I provide are already in the order I want, so theoretically even if i disable all sorting options, they should be shown in the order I provide them, right? or is this not the expected behavior?

@tannerlinsley
Copy link
Collaborator

tannerlinsley commented Feb 9, 2017 via email

@eyerean
Copy link
Author

eyerean commented Feb 9, 2017

Thank you for the quick response.

I am struggling with this all day, and only when I pasted my code here for this answer I realized my mapping of the values was wrong.

It works now, but only if I click 2 times on the column that needs to be sorted by default. First two clicks sorting is pretty random.

columns: [
      {
        header: 'Sections',
        columns: [{
          header: 'Section',
          accessor: 'sectionName',
          minWidth: 200,
          sortable: false
        }, {
          header: 'Sub-Section',
          accessor: 'subSectionName',
          sortable: false
        }]
      },
      {
        header: 'KPIs',
        columns: [{
          header: 'KPI',
          accessor: 'kpiName_1',
          minWidth: 200,
          aggregate: (values, rows) => <span>{values.length === 1 ? values[0] : ''}</span>,
          sortable: false
        }, {
          header: 'Sub-KPI',
          accessor: 'kpiName_2',
          minWidth: 140,
          sortable: false
        }, {
          header: 'Sub-Sub-KPI',
          accessor: 'kpiName_3',
          sortable: false
        }, {
          header: 'Really-Deep-KPI',
          accessor: 'kpiName_4',
          sortable: false
        }]
      },
      {
        header: 'Details',
        columns: [{
          header: 'Frequency',
          id: 'kpiFreq',
          accessor: data => <span>{data.kpiFreq_4 || data.kpiFreq_3 || data.kpiFreq_2 || data.kpiFreq_1}</span>,
          aggregate: (values, rows) => <span>{values.length === 1 ? values[0] : ''}</span>,
          sortable: false,
          minWidth: 80
        }, {
          header: 'Type',
          id: 'kpiType',
          accessor: data => <span>{data.kpiType_4 || data.kpiType_3 || data.kpiType_2 || data.kpiType_1}</span>,
          aggregate: (values, rows) => <span>{values.length === 1 ? values[0] : ''}</span>,
          sortable: false,
          minWidth: 60
        }, {
          header: 'NO',
          id: 'kpiNumber',
          accessor: data => <span>{data.kpiNumber}</span>,
          aggregate: (values, rows) => <span>{values.length === 1 ? values[0] : ''}</span>,
          width: 50,
          sort: 'asc'
        }]
      }]

// [...] month columns omitted 

Sample data:

data: [
   0: {
        piFreq_1: "MONTHLY",
        kpiId_1: "KPI_ID_A",
        kpiName_1: "KPI_A",
        kpiNumber: 1,
        kpiType_1: "SUM",
        months: Array[12], //omitted
        sectionName: "SECTION_A",
        subSectionName: "(no subsection)"
   },
   1: {
        kpiFreq_2: "MONTHLY",
        kpiId_2: "KPI_ID_B",
        kpiName_1: "KPI_A",
        kpiName_2: "KPI_B",
        kpiNumber: 2,
        kpiType_2: "UNITS",
        months: Array[12], //omitted
        sectionName: "SECTION_A",
        subSectionName: "(no subsection)"
   },
 2: {
        kpiFreq_2: "MONTHLY",
        kpiId_2: "KPI_ID_C",
        kpiName_1: "KPI_A",
        kpiName_2: "KPI_C",
        kpiNumber: 3,
        kpiType_2: "UNITS",
        months: Array[12], //omitted
        sectionName: "SECTION_A",
        subSectionName: "(no subsection)"
   },
]
// [...] more than 200 of these fellows

I want to sort on the KPI Number column.
Extra funny issue, if I write the accessor the string way: accessor: 'kpiNumber' then I have to click 5 times for the correct sorting order to appear.

@tannerlinsley
Copy link
Collaborator

tannerlinsley commented Feb 9, 2017

Ah I see the problem. You are using accessor to return the jsx you want to display. The accessor should be a key or function that returns the raw data for the column. If you want to customize the display of that value, you use render. Example for the kpiNumber column:

{
  header: 'NO',
  id: 'kpiNumber',
  accessor: 'kpiNumber', // or `row => row.kpiNumber` (same thing)
  aggregate: (values, rows) => <span>{values.length === 1 ? values[0] : ''}</span>,
  display: rowInfo => <span className='awesomeClass'>{rowInfo.value}</span>,
  width: 50,
  sort: 'asc'
}

Just remember that accessors are what build the data model for the table to sort. So whatever you return in your accessor should be a naturally sortable primitive (number, string, date, boolean).

Let me know if that fixes the problem for you (remember to check your accessor functions for the rest of your columns as well ;)

@eyerean
Copy link
Author

eyerean commented Feb 10, 2017

Sadly this doesn't fix the problem. I cleaned up all my accessor functions. Now I have to indeed click 5 times until the correct sorting is shown.
I also have the common warning about a needed key value, don't know if this is related to my issue:

warning.js:36 Warning: Each child in an array or iterator should have a unique "key" prop. 
Check the render method of `src`. 
See https://fb.me/react-warning-keys for more information.
    in ThComponent (created by src)
   // [...]

Btw I guess you mean render in your code instead of 'display' :).

EDIT: If I don't pivot by no columns, then sorting is correct from the start! So pivoting messes with it somehow. I'm looking at it now and I will also check my aggregate functions. This is my <ReactTable> component config:

<ReactTable
          className="-highlight"
          data={data}
          columns={columns}
          defaultPageSize={numOfSections}
          showPagination={false}
          showPageJump={false}
          showPageSizeOptions={false}
          //pivotBy={['sectionName', 'subSectionName']}
          onTrClick={this.handleTrClick} //console.logs the row
        />

EDIT 2: Turns out pivoting messes with some styles as well. If I have trStyleCallback={ rowInfo => {return( {color: rowInfo.rowValues.sectionNumber % 2 ? 'green' : 'red'} )} } it works as expected only when the pivotBy prop is commented-out. Maybe I am doing something wrong with pivot/aggregation?

@eyerean
Copy link
Author

eyerean commented Feb 10, 2017

Upgrading to the newest version of react-table fixed my issue.
I am sorry that this was not the first step I took before even posting here, I hope I didn't waste much of your time!

@eyerean eyerean closed this as completed Feb 10, 2017
@tannerlinsley
Copy link
Collaborator

tannerlinsley commented Feb 10, 2017 via email

@eyerean
Copy link
Author

eyerean commented Feb 10, 2017

Turns out I have to re-open this.

Behavior is that sorting is done within each group of pivoted columns, but the groups themselves are not sorted.

Say,
SectionA contains items with IDs 1 to 20. These items are internally sorted.
SectionB contains items with IDs 21 - 30. They are sorted.
SectionC contains items with IDs 30-60. Sorted.

I would like to see SectionA - SectionB - SectionC, but they appear like: SectionA - SectionC - SectionB.
If I expand them, the rows-items are sorted within their subsection.
I would like the priority to be on the overall sorting of the items, and not only per group of pivoted columns.

I have to click to the ID column [kpiNumber in my code] 5 times for the correct sorting to be applied.

Maybe the sorting is applied in code before the pivoting, that's the grouped columns have sorted data, but the groups are not themselves sorted.

I hope my explanation, even though not very clear, is at least helpful to point to the right direction into solving this..

@eyerean eyerean reopened this Feb 10, 2017
@tannerlinsley
Copy link
Collaborator

Okay, I've verified that there was indeed a strange error happening. I've shipped a new version 5.1.0 that should fix the issue, but it did break some small things with the old column sorting shorthand.

Instead of setting sort: 'asc', use the new defaultSorting prop:

<ReactTable
  defaultSorting={[{
    id: 'kpiNumber',
    desc: false // not necessary unless set to true, but it's good to know its there.
}]}

As for your columns, make sure that accessors are returning primitives, and if you are using a function for an accessor that you set a unique ID.

@tannerlinsley
Copy link
Collaborator

Does that work for you?

@eyerean
Copy link
Author

eyerean commented Feb 13, 2017

It works!!
Actually, it works if I keep sort: 'asc' in the column definition. When I use the defaultSorting prop, it doesn't work [or well, it works as before, that is I need to click 3 times at the column to see the correct overall sorting].

Thank you very much for the fix, seems like it didn't break some small things after all [?].

@tannerlinsley
Copy link
Collaborator

tannerlinsley commented Feb 13, 2017 via email

@hect1c
Copy link

hect1c commented Feb 21, 2017

Hey,

I have defaultSorting as a prop for one of my columns and this works fine. But it seems I am unable to click on the same column to resort unless I click on a different column and then come back to the original column. Code seems fine, what could I be missing ?

Below is my column
{ id: 'dateCreated', header: 'Date Created', accessor: 'createdDate', render: row => { return ( <span> {dateFormat(row.value, 'mm/dd/yy HH:MM:ss')} </span> ) } },

This is the options for the table
return { minRows: 0, showPageSizeOptions: false, showPageJump: false, showPagination: false, theadClassName: 'ash-thead', className: '-striped -highlight ash-table', defaultPageSize: 100, defaultSorting: [{ id: 'dateCreated', asc: false }] }
Please advise, thank you.

@swp44744
Copy link

swp44744 commented May 8, 2018

Hi @tannerlinsley ,
I am using react-table version: 6.8.0, and i am facing similar issue mentioned above. When I am pivoting a column, react table is overriding the order of the data received from the server and it happens on some of the instance only.

if I remove prop pivoted by then it works just fine.

below how my table looks like:

<ReactTable
              data={productData}
              columns={columns(this)}
              defaultPageSize={DEFAULT_PAGE_SIZE}
              pageSizeOptions={PAGE_SIZE_OPTIONS}
              className="-striped -highlight"
              pivotBy={["id"]}
              sortable={true}
              filterable
              manual
              onFetchData={this.getProductList}
              pages={pages}
              loading={loading}
              noDataText={productError || (loading ? "" : "Sorry there are no results matching your criteria")}
              loadingText={<LoadingSpinner/>}
              PaginationComponent={ReactTablePagination}
              showPaginationTop={true}
              showPaginationBottom={true}
              showPageJump={false}
              sorted={tableState.sorted}
              page={tableState.page}
              pageSize={tableState.pageSize}
              expanded={tableState.expanded}
              resized={tableState.resized}
              filtered={tableState.filtered}
              onSortedChange={sortedChanged}
              onPageChange={pageChanged}
              onPageSizeChange={pageSizeChanged}
              onExpandedChange={expandedChanged}
              onResizedChange={resizedChanged}
              onFilteredChange={filteredChanged} />

@asmimore
Copy link

Even i am some issue in react table, when I clicked on column I got data in sorted format but when it goes to next page some data from 1st page get displayed
means in page 1:column contain 1 to 10 values
in page 2:column contains 8 to 18 values ,why such repetition happen?

@invegat
Copy link

invegat commented May 11, 2019

I would like to initially sort by distance {
id: 'distance',
Header: 'Distance',
accessor: d => {
return geodist({lat:this.state.geo.latitude, lon:this.state.geo.longitude},
{lat: d.coordinates.latitude, lon:d.coordinates.longitude}, {exact: true}).toFixed(2)
}
} is there a way to initially sort from an accessor that is a function?

@PavanKumarHRao
Copy link

I have used Sl.No as first column,so the data will be like 1,2,3... when i try to sort other columns, Sl.No column also will be sorted, is there any way to keep it static(maybe disable it permanently)???

@aannaassalam
Copy link

aannaassalam commented Jun 8, 2021

Hii, I have upgraded to the latest react-table v7 and sorting is not working.
This is my code some please help!!!

import React from "react";
import { useTable, usePagination, useSortBy } from "react-table";
import { MenuItem, Select } from "@material-ui/core";
import "./table.css";

function Table({ columns, data = [] }) {
  // Use the state and functions returned from useTable to build your UI
  const {
    getTableProps,
    getTableBodyProps,
    headerGroups,
    rows,
    prepareRow,
    pageOptions,
    page,
    state: { pageIndex, pageSize },
    previousPage,
    nextPage,
    setPageSize,
    canPreviousPage,
    canNextPage,
  } = useTable(
    {
      columns,
      data,
    },
    useSortBy,
    usePagination
  );

  const pageSizeOptions = [10, 20, 30, 40];

  return (
    <div>
      <table {...getTableProps()}>
        <thead>
          {headerGroups.map((headerGroup) => (
            <tr {...headerGroup.getHeaderGroupProps()}>
              {headerGroup.headers.map((column) => (
                <th {...column.getHeaderProps(column.getSortByToggleProps())}>
                  {column.render("Header")}
                  <span>
                    {column.isSorted
                      ? column.isSortedDesc
                        ? " 🔽"
                        : " 🔼"
                      : ""}
                  </span>
                </th>
              ))}
            </tr>
          ))}
        </thead>
        <tbody {...getTableBodyProps()}>
          {page.map((row, i) => {
            prepareRow(row);
            return (
              <tr {...row.getRowProps()}>
                {row.cells.map((cell) => {
                  return (
                    <td {...cell.getCellProps()}>{cell.render("Cell")}</td>
                  );
                })}
              </tr>
            );
          })}
        </tbody>
      </table>
      <div className="pagination">
        <div className="page-count">
          <span>Rows per page</span>
          <Select
            value={pageSize}
            onChange={(e) => {
              setPageSize(Number(e.target.value));
            }}
          >
            {pageSizeOptions.map((pageSize) => (
              <MenuItem key={pageSize} value={pageSize}>
                {pageSize}
              </MenuItem>
            ))}
          </Select>
        </div>
        <div className="page-btns">
          <button onClick={() => previousPage()} disabled={!canPreviousPage}>
            <i className="fas fa-chevron-left"></i>
            <p>Prev</p>
          </button>
          <span>{pageIndex + 1}</span>
          <button onClick={() => nextPage()} disabled={!canNextPage}>
            <p>Next</p>
            <i className="fas fa-chevron-right"></i>
          </button>
        </div>
      </div>
    </div>
  );
}

export default Table;

getSortByToggleProps() isn't working I guess.

@Zauras
Copy link

Zauras commented Sep 6, 2021

Issue persists - react-table does not handle numerical sorting with - signed numbers.

@mayank1513
Copy link

I am trying to use this table library with Next.js. Specifically tried implementing this example as it is https://codesandbox.io/s/fervent-panini-dico77?file=/src/makeData.ts:661-666 . But for some reason, only 20 rows are rendered. Rest of the table is blank. Then I just removed the virtualization and tried to render less number of rows. It worked but sorting just doesn't work.

const columns: ColumnDef<SampleDataType>[] = [
  {
    accessorKey: "id",
    header: "Event ID",
    size: 60,
  },

  {
    accessorKey: "timeStamp",
    header: "Time Stamp",
    cell: (info) => info.getValue<Date>().toLocaleString(),
    sortingFn: "datetime",
    enableSorting: true,
  },
  {
    accessorKey: "user",
    header: "User",
    size: 60,
    enableSorting: true,
  },
  {
    accessorKey: "activity",
    header: "Activity",
    enableSorting: true,
  },
  {
    accessorKey: "company",
    header: "Company",
    size: 80,
    enableSorting: true,
  },
];

@nvanofwegen
Copy link

I am trying to use this table library with Next.js. Specifically tried implementing this example as it is https://codesandbox.io/s/fervent-panini-dico77?file=/src/makeData.ts:661-666 . But for some reason, only 20 rows are rendered. Rest of the table is blank. Then I just removed the virtualization and tried to render less number of rows. It worked but sorting just doesn't work.

I had to add the row model to the table object in a NextJS project:

        ....
        getCoreRowModel: getCoreRowModel(),
        getSortedRowModel: getSortedRowModel(),
        getFilteredRowModel: getFilteredRowModel(),
        ....

@VishnuMariappan
Copy link

VishnuMariappan commented Mar 18, 2024

Hi, I want to sort by name.fullname but fullname is in Lowercase as well as uppercase. It is sorting based on uppercase only. It is not considering lowercase. Can please help me.
[
{
"email": "[email protected]",
"fname": "Hema",
"lname": "Latha",
"branch": null,
"userid": 10,
"college": null,
"testdata": [
{
"status": 1,
"testid": 1779,
"duedate": "2024-03-15 15:52:23.000000",
"libtype": 4,
"timeleft": null,
"lpconfigid": 1023
},
{
"status": 1,
"testid": 654,
"duedate": "2024-03-15 15:51:55.000000",
"libtype": 2,
"timeleft": null,
"lpconfigid": 1020,
"targetscore": 6,
"testname": null,
"testdata": null,
"credibilityScore": 0
},
{
"status": 1,
"testid": 658,
"duedate": "2024-03-15 15:52:18.000000",
"libtype": 5,
"timeleft": null,
"lpconfigid": 1022,
"targetscore": 20,
"testname": null,
"testdata": null
},
{
"status": 1,
"testid": 656,
"duedate": "2024-03-15 15:52:09.000000",
"libtype": 3,
"timeleft": null,
"lpconfigid": 1021,
"testdata": null,
"credibilityScore": 0,
"targetscore": 10,
"testname": null
}
],
"userstatus": 1,
"name": {
"fullname": "Hema Latha",
"userstatus": 1
},
"654EMTestMcq": {
"targetscore": 6,
"actualscore": 0,
"duedate": "2024-03-15 15:51:55.000000",
"status": 1,
"testid": 654,
"credibilityscore": 0,
"lpconfigid": 1020,
"libtype": 2,
"testname": "EM - Test Mcq",
"displaytext": "TBE",
"timeleft": null,
"lname": "Hema Latha",
"learnerid": 10,
"mid": 313,
"modName": "Second",
"score_per": 0,
"cs_per": null,
"testmode": 2,
"userstatus": 1,
"accessor": "654EMTestMcq",
"apiattributes": {
"learnerid": 10,
"lpid": 224,
"testid": 654
},
"filterattributes": {
"type": "mcq",
"libtype": 2,
"hname": "654EM - Test Mcq",
"testmode": 2
}
},
"656EMTestdesc": {
"targetscore": 10,
"actualscore": 0,
"duedate": "2024-03-15 15:52:09.000000",
"status": 1,
"testid": 656,
"credibilityscore": 0,
"lpconfigid": 1021,
"libtype": 3,
"testname": "EM-Test desc",
"displaytext": "TBE",
"timeleft": null,
"lname": "Hema Latha",
"learnerid": 10,
"mid": 313,
"modName": "Second",
"score_per": 0,
"cs_per": null,
"testmode": 2,
"userstatus": 1,
"accessor": "656EMTestdesc",
"apiattributes": {
"learnerid": 10,
"lpid": 224,
"testid": 656
},
"filterattributes": {
"type": "des",
"libtype": 3,
"hname": "656EM-Test desc",
"testmode": 2
}
},
"313SecondTestTotal": {
"actualscore": 0,
"filterattributes": {
"type": "moduletotals"
}
},
"658EMTestcodingRecursionQ1": {
"targetscore": 10,
"actualscore": 0,
"duedate": "2024-03-15 15:52:18.000000",
"status": 0,
"testid": 658,
"testqnno": null,
"questionid": null,
"lpconfigid": 1022,
"libtype": 5,
"testname": "EM-Test coding",
"timeleft": null,
"lname": "Hema Latha",
"learnerid": 10,
"mid": 312,
"modName": "First",
"score_per": 0,
"cs_per": 0,
"testmode": 2,
"questionscount": 1,
"repqueno": 1,
"topicid": 106,
"topicname": "Recursion",
"accessor": "658EMTestcodingRecursionQ1",
"userstatus": 1,
"apiattributes": {
"learnerid": 10,
"lpid": 224,
"testqnno": null,
"questionid": null,
"testid": 658
},
"filterattributes": {
"type": "ccq",
"hname": "658EM-Test codingRecursionQ1",
"libtype": 5,
"testmode": 2
}
},
"658EMTestcodingCOECC2Q1": {
"targetscore": 10,
"actualscore": 0,
"duedate": "2024-03-15 15:52:18.000000",
"status": 0,
"testid": 658,
"testqnno": null,
"questionid": null,
"lpconfigid": 1022,
"libtype": 5,
"testname": "EM-Test coding",
"timeleft": null,
"lname": "Hema Latha",
"learnerid": 10,
"mid": 312,
"modName": "First",
"score_per": 0,
"cs_per": 0,
"testmode": 2,
"questionscount": 1,
"repqueno": 1,
"topicid": 99,
"topicname": "COE CC2",
"accessor": "658EMTestcodingCOECC2Q1",
"userstatus": 1,
"apiattributes": {
"learnerid": 10,
"lpid": 224,
"testqnno": null,
"questionid": null,
"testid": 658
},
"filterattributes": {
"type": "ccq",
"hname": "658EM-Test codingCOE CC2Q1",
"libtype": 5,
"testmode": 2
}
},
"658EMTestcodingTotal": {
"lname": "Hema Latha",
"repqueno": 3,
"learnerid": 10,
"mid": 312,
"modName": "First",
"targetscore": 20,
"duedate": "2024-03-15 15:52:18.000000",
"actualscore": 0,
"score_per": null,
"credibilityscore": 0,
"cs_per": 0,
"status": 2,
"lpconfigid": 1022,
"libtype": 5,
"testid": 658,
"testname": "EM-Test coding",
"testmode": 2,
"timeleft": null,
"userstatus": 1,
"accessor": "658EMTestcodingTotal",
"apiattributes": {
"learnerid": 10,
"lpid": 224,
"testqnno": null,
"questionid": null
},
"filterattributes": {
"type": "cct",
"hname": "658EM-Test codingTotal",
"libtype": 5,
"testmode": 2
}
},
"1779EMAssignment1": {
"actualscore": 0,
"duedate": "2024-03-15 15:52:23.000000",
"status": 1,
"testid": 1779,
"credibilityscore": 0,
"lpconfigid": 1023,
"libtype": 4,
"testname": "EM-Assignment1",
"displaytext": "TBE",
"timeleft": null,
"lname": "Hema Latha",
"learnerid": 10,
"mid": 312,
"modName": "First",
"score_per": 0,
"cs_per": null,
"testmode": 2,
"userstatus": 1,
"accessor": "1779EMAssignment1",
"apiattributes": {
"learnerid": 10,
"lpid": 224,
"testid": 1779
},
"filterattributes": {
"type": "assi",
"libtype": 4,
"hname": "1779EM-Assignment1",
"testmode": null
}
},
"312FirstTestTotal": {
"actualscore": 0,
"filterattributes": {
"type": "moduletotals"
}
},
"GrandTotal": {
"actualscore": 0,
"filterattributes": {
"type": "grandtotal"
}
}
},
{
"email": "[email protected]",
"fname": "madhavi",
"lname": "chennamaneni",
"branch": null,
"userid": 14,
"college": null,
"testdata": [
{
"status": 1,
"testid": 656,
"duedate": "2024-03-15 15:52:09.000000",
"libtype": 3,
"timeleft": 1200,
"lpconfigid": 1021,
"targetscore": 10,
"testname": null,
"testdata": null,
"credibilityScore": 0
},
{
"status": 1,
"testid": 658,
"duedate": "2024-03-15 15:52:18.000000",
"libtype": 5,
"timeleft": 1200,
"lpconfigid": 1022,
"targetscore": 20,
"testname": null,
"testdata": null
},
{
"status": 1,
"testid": 654,
"duedate": "2024-03-15 15:51:55.000000",
"libtype": 2,
"timeleft": 1200,
"lpconfigid": 1020,
"testdata": null,
"credibilityScore": 0,
"targetscore": 6,
"testname": null
},
{
"status": 1,
"testid": 1779,
"duedate": "2024-03-15 15:52:23.000000",
"libtype": 4,
"timeleft": null,
"lpconfigid": 1023
}
],
"userstatus": 1,
"name": {
"fullname": "madhavi chennamaneni",
"userstatus": 1
},
"654EMTestMcq": {
"targetscore": 6,
"actualscore": 0,
"duedate": "2024-03-15 15:51:55.000000",
"status": 1,
"testid": 654,
"credibilityscore": 0,
"lpconfigid": 1020,
"libtype": 2,
"testname": "EM - Test Mcq",
"displaytext": "TBE",
"timeleft": 1200,
"lname": "madhavi chennamaneni",
"learnerid": 14,
"mid": 313,
"modName": "Second",
"score_per": 0,
"cs_per": null,
"testmode": 2,
"userstatus": 1,
"accessor": "654EMTestMcq",
"apiattributes": {
"learnerid": 14,
"lpid": 224,
"testid": 654
},
"filterattributes": {
"type": "mcq",
"libtype": 2,
"hname": "654EM - Test Mcq",
"testmode": 2
}
},
"656EMTestdesc": {
"targetscore": 10,
"actualscore": 0,
"duedate": "2024-03-15 15:52:09.000000",
"status": 1,
"testid": 656,
"credibilityscore": 0,
"lpconfigid": 1021,
"libtype": 3,
"testname": "EM-Test desc",
"displaytext": "TBE",
"timeleft": 1200,
"lname": "madhavi chennamaneni",
"learnerid": 14,
"mid": 313,
"modName": "Second",
"score_per": 0,
"cs_per": null,
"testmode": 2,
"userstatus": 1,
"accessor": "656EMTestdesc",
"apiattributes": {
"learnerid": 14,
"lpid": 224,
"testid": 656
},
"filterattributes": {
"type": "des",
"libtype": 3,
"hname": "656EM-Test desc",
"testmode": 2
}
},
"313SecondTestTotal": {
"actualscore": 0,
"filterattributes": {
"type": "moduletotals"
}
},
"658EMTestcodingRecursionQ1": {
"targetscore": 10,
"actualscore": 0,
"duedate": "2024-03-15 15:52:18.000000",
"status": 0,
"testid": 658,
"testqnno": null,
"questionid": null,
"lpconfigid": 1022,
"libtype": 5,
"testname": "EM-Test coding",
"timeleft": null,
"lname": "madhavi chennamaneni",
"learnerid": 14,
"mid": 312,
"modName": "First",
"score_per": 0,
"cs_per": 0,
"testmode": 2,
"questionscount": 1,
"repqueno": 1,
"topicid": 106,
"topicname": "Recursion",
"accessor": "658EMTestcodingRecursionQ1",
"userstatus": 1,
"apiattributes": {
"learnerid": 14,
"lpid": 224,
"testqnno": null,
"questionid": null,
"testid": 658
},
"filterattributes": {
"type": "ccq",
"hname": "658EM-Test codingRecursionQ1",
"libtype": 5,
"testmode": 2
}
},
"658EMTestcodingCOECC2Q1": {
"targetscore": 10,
"actualscore": 0,
"duedate": "2024-03-15 15:52:18.000000",
"status": 0,
"testid": 658,
"testqnno": null,
"questionid": null,
"lpconfigid": 1022,
"libtype": 5,
"testname": "EM-Test coding",
"timeleft": null,
"lname": "madhavi chennamaneni",
"learnerid": 14,
"mid": 312,
"modName": "First",
"score_per": 0,
"cs_per": 0,
"testmode": 2,
"questionscount": 1,
"repqueno": 1,
"topicid": 99,
"topicname": "COE CC2",
"accessor": "658EMTestcodingCOECC2Q1",
"userstatus": 1,
"apiattributes": {
"learnerid": 14,
"lpid": 224,
"testqnno": null,
"questionid": null,
"testid": 658
},
"filterattributes": {
"type": "ccq",
"hname": "658EM-Test codingCOE CC2Q1",
"libtype": 5,
"testmode": 2
}
},
"658EMTestcodingTotal": {
"lname": "madhavi chennamaneni",
"repqueno": 3,
"learnerid": 14,
"mid": 312,
"modName": "First",
"targetscore": 20,
"duedate": "2024-03-15 15:52:18.000000",
"actualscore": 0,
"score_per": null,
"credibilityscore": 0,
"cs_per": 0,
"status": 2,
"lpconfigid": 1022,
"libtype": 5,
"testid": 658,
"testname": "EM-Test coding",
"testmode": 2,
"timeleft": null,
"userstatus": 1,
"accessor": "658EMTestcodingTotal",
"apiattributes": {
"learnerid": 14,
"lpid": 224,
"testqnno": null,
"questionid": null
},
"filterattributes": {
"type": "cct",
"hname": "658EM-Test codingTotal",
"libtype": 5,
"testmode": 2
}
},
"1779EMAssignment1": {
"actualscore": 0,
"duedate": "2024-03-15 15:52:23.000000",
"status": 1,
"testid": 1779,
"credibilityscore": 0,
"lpconfigid": 1023,
"libtype": 4,
"testname": "EM-Assignment1",
"displaytext": "TBE",
"timeleft": null,
"lname": "madhavi chennamaneni",
"learnerid": 14,
"mid": 312,
"modName": "First",
"score_per": 0,
"cs_per": null,
"testmode": 2,
"userstatus": 1,
"accessor": "1779EMAssignment1",
"apiattributes": {
"learnerid": 14,
"lpid": 224,
"testid": 1779
},
"filterattributes": {
"type": "assi",
"libtype": 4,
"hname": "1779EM-Assignment1",
"testmode": null
}
},
"312FirstTestTotal": {
"actualscore": 0,
"filterattributes": {
"type": "moduletotals"
}
},
"GrandTotal": {
"actualscore": 0,
"filterattributes": {
"type": "grandtotal"
}
}
},
{
"email": "[email protected]",
"fname": "Mathan",
"lname": "U",
"branch": null,
"userid": 12,
"college": null,
"testdata": [
{
"status": 1,
"testid": 654,
"duedate": "2024-03-15 15:51:55.000000",
"libtype": 2,
"timeleft": null,
"lpconfigid": 1020,
"targetscore": 6,
"testname": null,
"testdata": null,
"credibilityScore": 0
},
{
"status": 1,
"testid": 1779,
"duedate": "2024-03-15 15:52:23.000000",
"libtype": 4,
"timeleft": null,
"lpconfigid": 1023
},
{
"status": 1,
"testid": 656,
"duedate": "2024-03-15 15:52:09.000000",
"libtype": 3,
"timeleft": null,
"lpconfigid": 1021,
"testdata": null,
"credibilityScore": 0,
"targetscore": 10,
"testname": null
},
{
"status": 1,
"testid": 658,
"duedate": "2024-03-15 15:52:18.000000",
"libtype": 5,
"timeleft": null,
"lpconfigid": 1022,
"targetscore": 20,
"testname": null,
"testdata": null
}
],
"userstatus": 1,
"name": {
"fullname": "Mathan U",
"userstatus": 1
},
"654EMTestMcq": {
"targetscore": 6,
"actualscore": 0,
"duedate": "2024-03-15 15:51:55.000000",
"status": 1,
"testid": 654,
"credibilityscore": 0,
"lpconfigid": 1020,
"libtype": 2,
"testname": "EM - Test Mcq",
"displaytext": "TBE",
"timeleft": null,
"lname": "Mathan U",
"learnerid": 12,
"mid": 313,
"modName": "Second",
"score_per": 0,
"cs_per": null,
"testmode": 2,
"userstatus": 1,
"accessor": "654EMTestMcq",
"apiattributes": {
"learnerid": 12,
"lpid": 224,
"testid": 654
},
"filterattributes": {
"type": "mcq",
"libtype": 2,
"hname": "654EM - Test Mcq",
"testmode": 2
}
},
"656EMTestdesc": {
"targetscore": 10,
"actualscore": 0,
"duedate": "2024-03-15 15:52:09.000000",
"status": 1,
"testid": 656,
"credibilityscore": 0,
"lpconfigid": 1021,
"libtype": 3,
"testname": "EM-Test desc",
"displaytext": "TBE",
"timeleft": null,
"lname": "Mathan U",
"learnerid": 12,
"mid": 313,
"modName": "Second",
"score_per": 0,
"cs_per": null,
"testmode": 2,
"userstatus": 1,
"accessor": "656EMTestdesc",
"apiattributes": {
"learnerid": 12,
"lpid": 224,
"testid": 656
},
"filterattributes": {
"type": "des",
"libtype": 3,
"hname": "656EM-Test desc",
"testmode": 2
}
},
"313SecondTestTotal": {
"actualscore": 0,
"filterattributes": {
"type": "moduletotals"
}
},
"658EMTestcodingRecursionQ1": {
"targetscore": 10,
"actualscore": 0,
"duedate": "2024-03-15 15:52:18.000000",
"status": 0,
"testid": 658,
"testqnno": null,
"questionid": null,
"lpconfigid": 1022,
"libtype": 5,
"testname": "EM-Test coding",
"timeleft": null,
"lname": "Mathan U",
"learnerid": 12,
"mid": 312,
"modName": "First",
"score_per": 0,
"cs_per": 0,
"testmode": 2,
"questionscount": 1,
"repqueno": 1,
"topicid": 106,
"topicname": "Recursion",
"accessor": "658EMTestcodingRecursionQ1",
"userstatus": 1,
"apiattributes": {
"learnerid": 12,
"lpid": 224,
"testqnno": null,
"questionid": null,
"testid": 658
},
"filterattributes": {
"type": "ccq",
"hname": "658EM-Test codingRecursionQ1",
"libtype": 5,
"testmode": 2
}
},
"658EMTestcodingCOECC2Q1": {
"targetscore": 10,
"actualscore": 0,
"duedate": "2024-03-15 15:52:18.000000",
"status": 0,
"testid": 658,
"testqnno": null,
"questionid": null,
"lpconfigid": 1022,
"libtype": 5,
"testname": "EM-Test coding",
"timeleft": null,
"lname": "Mathan U",
"learnerid": 12,
"mid": 312,
"modName": "First",
"score_per": 0,
"cs_per": 0,
"testmode": 2,
"questionscount": 1,
"repqueno": 1,
"topicid": 99,
"topicname": "COE CC2",
"accessor": "658EMTestcodingCOECC2Q1",
"userstatus": 1,
"apiattributes": {
"learnerid": 12,
"lpid": 224,
"testqnno": null,
"questionid": null,
"testid": 658
},
"filterattributes": {
"type": "ccq",
"hname": "658EM-Test codingCOE CC2Q1",
"libtype": 5,
"testmode": 2
}
},
"658EMTestcodingTotal": {
"lname": "Mathan U",
"repqueno": 3,
"learnerid": 12,
"mid": 312,
"modName": "First",
"targetscore": 20,
"duedate": "2024-03-15 15:52:18.000000",
"actualscore": 0,
"score_per": null,
"credibilityscore": 0,
"cs_per": 0,
"status": 2,
"lpconfigid": 1022,
"libtype": 5,
"testid": 658,
"testname": "EM-Test coding",
"testmode": 2,
"timeleft": null,
"userstatus": 1,
"accessor": "658EMTestcodingTotal",
"apiattributes": {
"learnerid": 12,
"lpid": 224,
"testqnno": null,
"questionid": null
},
"filterattributes": {
"type": "cct",
"hname": "658EM-Test codingTotal",
"libtype": 5,
"testmode": 2
}
},
"1779EMAssignment1": {
"actualscore": 0,
"duedate": "2024-03-15 15:52:23.000000",
"status": 1,
"testid": 1779,
"credibilityscore": 0,
"lpconfigid": 1023,
"libtype": 4,
"testname": "EM-Assignment1",
"displaytext": "TBE",
"timeleft": null,
"lname": "Mathan U",
"learnerid": 12,
"mid": 312,
"modName": "First",
"score_per": 0,
"cs_per": null,
"testmode": 2,
"userstatus": 1,
"accessor": "1779EMAssignment1",
"apiattributes": {
"learnerid": 12,
"lpid": 224,
"testid": 1779
},
"filterattributes": {
"type": "assi",
"libtype": 4,
"hname": "1779EM-Assignment1",
"testmode": null
}
},
"312FirstTestTotal": {
"actualscore": 0,
"filterattributes": {
"type": "moduletotals"
}
},
"GrandTotal": {
"actualscore": 0,
"filterattributes": {
"type": "grandtotal"
}
}
},
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests