title: How to update draft grade from Google Classroom using api in php
body: <p>I am trying to updates draft grades from the dashboard created using Google Classroom API to the Google classroom itself for a project. I wrote the following codes but can't find the way out. How to solve this problem?</p>
  <p>A dashboard(all values imported from Google classroom) is attached for your reference.</p>
  <pre><code> $client = new Google_Client();
          $service = new \Google_Service_Classroom($client);
          $courseId = '328776504166';
          $courseWorkId = '361223650991';
          $id = 'Cg0IiOu99CkQr_3t1MEK';
          $post_body = new \Google_Service_Classroom_StudentSubmission(array(
              'updateMask' =&gt; 20,
              'draftGrade' =&gt; 90,
  
          ));
          $list = $service-&gt;courses_courseWork_studentSubmissions-&gt;patch($courseId, $courseWorkId, $id, $post_body,);
  
  </code></pre>
  <p>Then when I run the above code on localhost I see this problem:</p>
  <pre><code>PHP Fatal error:  Uncaught Google\Service\Exception: {
    &quot;error&quot;: {
      &quot;code&quot;: 403,
      &quot;message&quot;: &quot;@ProjectPermissionDenied The Developer Console project is not permitted to make this request.&quot;,
      &quot;errors&quot;: [
        {
          &quot;message&quot;: &quot;@ProjectPermissionDenied The Developer Console project is not permitted to make this request.&quot;,
          &quot;domain&quot;: &quot;global&quot;,
          &quot;reason&quot;: &quot;forbidden&quot;
        }
      ],
      &quot;status&quot;: &quot;PERMISSION_DENIED&quot;
    }
  }
  
  
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/KKJ2l.png" rel="nofollow noreferrer">Dashboard created using Google classroom api</a></p>