Custom Javascript problem not working

I am trying to implement custom javascript problem. I have my javascript application.
But when I submit my problem it shows “Could not grade your answer. The submission was aborted.”
Here code

 <h2>Is causal relationship explicitly stated in the statement?</h2>
 <label class="container">Yes
 <input type="radio" name="radio" id="checkBox" onclick="func.showQue()">
 <span class="checkmark-1"></span>
 <label class="container">No
 <input type="radio" name="radio" onclick="func.showQue()">
 <span class="checkmark-1"></span>

 <div style="display: none;" id="question">
 <h2>If yes, which is the cause?  </h2>
 <label class="container">Supreme court declares the statute unenforceable 
 <input type="radio" name="final" id="checkbox2">
 <span class="checkmark-2"></span>
 <label class="container">He goes free
 <input type="radio" name="final">
 <span class="checkmark-2"></span>

    let func = (function() {
      function showQue() {
      let checkBox = document.getElementById("checkBox");
      let text = document.getElementById("question");
      if (checkBox.checked == true){ = "block";
      } else { = "none";

      function getGrade() {
           let checkans = document.getElementById("checkbox")
           let check2ans = document.getElementById("checkbox2")

           if (checkans.checked == true){
               if (check2ans.checked == true) {
                   return JSON.stringify("correct")
          } else {
          /   return JSON.stringify("wrong")


      state = {
        choice: "correct"

      function getState() {
        return JSON.stringify(state);

      return {
          showQue: showQue,
          getGrade: getGrade,
          getState: getState

and the problem “cms-modules.2b7ffc378730.js:175 Uncaught TypeError: Cannot read property ‘getGrade’ of undefined”. Not sure what I am missing.

and code from edx

  <script type="loncapa/python">
  import json
  def all_true(exp, ans):
  response = json.loads(ans)
  return response["answer"] == "correct"
     <customresponse cfn="all_true">
     <jsinput gradefn="func.getGrade"
      title="iframe Title"