Convert string to object and finding average

I would recommend restructuring how you model your data. Maybe breaking up the example you provided into multiple documents with the following structure during indexing could make querying easier?

{
  "StudentId": 1,
  "Marks": {
    "SubjectId": 1,
    "TotalTasksCount":15,
    "Result":73.3,
    "TestObjectsCorrect":64,
    "TestMaxPoint":15
  }
}