Status Update
Comments
bl...@google.com <bl...@google.com> #2
I believe you've been looking into this
at com.android.tools.idea.gradle.project.sync.idea.SdkSyncUtil.findMatchingSdkForAddon(SdkSyncUtil.kt:175)
at com.android.tools.idea.gradle.project.sync.idea.SdkSyncUtil.computeSdkReloadingAsNeeded(SdkSyncUtil.kt:127)
ka...@gmail.com <ka...@gmail.com> #3
hm, in fact let's discuss how we handle SDKs/addons etc. and also bootlclasspath
. We have an open issue with not supporting useLibrary
which we need to fix.
ma...@google.com <ma...@google.com> #4
The issue seems to be in
// Find the path to the android.jar, so we can match this to the sdks and find which one is in use.
val androidJarPath = bootClasspath.map { path ->
File(path)
}.firstOrNull { file ->
file.name == FN_FRAMEWORK_LIBRARY
} ?: return null
// There is no android.jar file in the bootClasspath, we can't find the SDK
// TODO: Maybe log here, this condition should never happen AFAIK.
return allAndroidSdks.first { sdk ->
sdk.rootProvider.getFiles(CLASSES).any { sdkFile ->
filesEqual(virtualToIoFile(sdkFile), androidJarPath)
}
}
i.e. it seems that android.jar
from the bootclasspath (as reported by AGP) is not found in any of Android SDKs registered with the IDE.
Al, do you modify bootclasspath for you project in some way? Also, can you please share a small project that reproduces the issue?
Bradley, you made some changes in this area in the past, does this ring a bell?
qu...@getalma.com <qu...@getalma.com> #5
Unfortunately I can't share that publicly, but would that trigger the issue? Is there some kind of filter on allAndroidSdks which only includes Google sourced SDKs? The reason I'm asking is we've seen issues trying to run apps from AS where our custom SDK is selected, and compiles the code without an issue, but AS pops up a "Please select an Android SDK" error.
ma...@google.com <ma...@google.com> #6
This is probably caused by allAndroidSdks
will be empty, and even though there is file with name android.jar
in bootclasspath, the code above will fail?
vm...@hemetusd.org <vm...@hemetusd.org> #7
fi...@gymkk.cz <fi...@gymkk.cz> #8
Thanks for confirming that, we'll aim to fix this issue.
34...@gmail.com <34...@gmail.com> #9
This will be fixed in upcoming Android Studio Flamingo canaries/betas.
Change: I10b962c387dbac48d047efafddcb7b4d4de3257d
34...@gmail.com <34...@gmail.com> #10
ap...@ne-academy.net <ap...@ne-academy.net> #11
To revive it, I had ChatGPT look at this important issue, and effectively stumped it. Specifically, I gave it quite a bit of output from the log consisting of paired assignment/submission objects in JSON. I manually marked the EXCUSED entries and asked it to compare these to the unmarked ones to find patterns helpful for detecting excused assignments programmatically. I thought ChatGPT's (rather bleak) assessment was pretty spot on, so I'll share:
Short Answer: Unfortunately, Google Classroom’s API does not expose “Excused” in its returned data, even though Classroom’s front-end UI does let a teacher mark certain student assignments “Excused.” There is no separate field
excused
in the JSON you receive.Because of that, there’s no sure-fire pattern in the API data alone (e.g. grade = 0 or missing) that tells you “this was marked as Excused in Classroom.” The only way to see that directly is from the teacher’s perspective in the web UI, or by manually adding your own flag in any software you build around the Classroom API.
Why We Can’t Detect “Excused” from the Classroom API
- Google’s Docs Omit Excused The official Classroom API docs don’t mention any field to store or return an “Excused” status. The states we can see are things like
CREATED
,TURNED_IN
, orRETURNED
, plus numeric grades ordraftGrade
, but “Excused” never appears as a separate field.- No Hints in the JSON If you look over the raw JSON for each submission, you’ll notice no consistent or even hidden property that flips from false to true for “excused.” Some submissions have no grades, others do. Some are turned in, others aren’t—none of it correlates reliably to “excused.”
- Google’s UI vs. Under-the-Hood The Classroom GUI is effectively toggling an internal “excused” marker that Google does not share in the public API. This is similar to how some SIS features in Classroom do not appear in the standard data feed.
Bottom Line
Right now, the official Classroom API simply does not expose the “Excused” status. Your only options are to keep tagging “excused” in your own records—or file a feature request with Google to add it to the Classroom API. But there is no built-in field or pattern in the raw submission JSON that reveals whether a teacher checked the “Excused” box in the Classroom web interface.`
My bottom line: Seems like a pretty simple solution to add a boolean attribute to the submission object called Excused
.
Description
Before opening a new issue, please search for other related issues , click the ★ to subscribe to updates, and click
+1
to vote.Description
The Submission History field is a logical place to look for this information, but it does not have an EXCUSED type. Upon excusing a submission, the corresponding
gradeChangeType
isDRAFT_GRADE_POINTS_EARNED_CHANGE
, which is also impossible to distinguish from real draft grade changes.Impact
Any programs that use this API to get a snapshot of a students' grades will be unable to determine if a submission is excused or if it's a grade of 0.