rubric
एक ऐसा टेंप्लेट है जिसका इस्तेमाल शिक्षक, छात्र-छात्राओं के सबमिट किए गए असाइनमेंट को ग्रेड देते समय कर सकते हैं. Classroom API से, आपको इन रूब्रिक को मैनेज करने के लिए शिक्षक की ओर से कार्रवाई करने की सुविधा मिलती है.
पहली इमेज. Classroom असाइनमेंट पर सैंपल रूब्रिक का व्यू.
इस गाइड में रूब्रिक एपीआई की बुनियादी बातों और फ़ंक्शन के बारे में बताया गया है. रूब्रिक की सामान्य स्ट्रक्चर के बारे में जानने और Classroom के यूज़र इंटरफ़ेस (यूआई) में रूब्रिक ग्रेडिंग करने के तरीके के बारे में जानने के लिए, सहायता केंद्र के ये लेख देखें.
ज़रूरी शर्तें
इस गाइड में यह माना गया है कि आपके पास ये चीज़ें हैं:
- Python 3.8.6 या इसके बाद का वर्शन
- pip पैकेज मैनेज करने वाला टूल
- Google Cloud प्रोजेक्ट.
- आपके पास Google Workspace for Education खाता हो और उसमें Google Classroom की सुविधा चालू हो.
- ऐसी टेस्ट क्लास जिसमें कम से कम एक टेस्ट स्टूडेंट खाता होना चाहिए. अगर आपके पास ऐसी कोई Classroom कक्षा नहीं है जिसका इस्तेमाल टेस्ट करने के लिए किया जा सकता है, तो यूज़र इंटरफ़ेस (यूआई) में कोई क्लास बनाएं और टेस्ट छात्र/छात्रा को जोड़ें.
किसी डेस्कटॉप ऐप्लिकेशन के लिए क्रेडेंशियल की अनुमति देना
असली उपयोगकर्ता के तौर पर पुष्टि करने और अपने ऐप्लिकेशन में उपयोगकर्ता का डेटा ऐक्सेस करने के लिए, आपको एक या ज़्यादा OAuth 2.0 क्लाइंट आईडी बनाने होंगे. क्लाइंट आईडी का इस्तेमाल Google के OAuth सर्वर पर किसी एक ऐप्लिकेशन की पहचान करने के लिए किया जाता है. अगर आपका ऐप्लिकेशन एक से ज़्यादा प्लैटफ़ॉर्म पर काम करता है, तो आपको हर प्लैटफ़ॉर्म के लिए एक अलग क्लाइंट आईडी बनाना होगा.
- Google Cloud Console में, GCP क्रेडेंशियल पेज पर जाएं.
- क्रेडेंशियल बनाएं > OAuth क्लाइंट आईडी पर क्लिक करें.
- ऐप्लिकेशन टाइप > डेस्कटॉप ऐप्लिकेशन पर क्लिक करें.
- नाम फ़ील्ड में, क्रेडेंशियल के लिए कोई नाम लिखें. यह नाम सिर्फ़ Google Cloud Console में दिखता है. उदाहरण के लिए, "रूब्रिक प्रीव्यू क्लाइंट".
- बनाएं पर क्लिक करें. OAuth क्लाइंट की बनाई हुई स्क्रीन दिखती है, जो आपका नया क्लाइंट आईडी और क्लाइंट सीक्रेट दिखाती है.
- JSON डाउनलोड करें पर क्लिक करें. इसके बाद, ठीक है पर क्लिक करें. नया बनाया गया क्रेडेंशियल, OAuth 2.0 क्लाइंट आईडी में दिखता है.
- डाउनलोड की गई JSON फ़ाइल को
credentials.json
के तौर पर सेव करें. इसके बाद, फ़ाइल को अपनी वर्क डायरेक्ट्री में ले जाएं. - क्रेडेंशियल बनाएं > एपीआई पासकोड पर क्लिक करें और एपीआई पासकोड नोट करें.
ज़्यादा जानने के लिए, ऐक्सेस क्रेडेंशियल बनाना देखें.
OAuth दायरों को कॉन्फ़िगर करें
अपने प्रोजेक्ट के मौजूदा OAuth स्कोप के आधार पर, आपको जोड़ने के स्कोप कॉन्फ़िगर करने पड़ सकते हैं.
- OAuth की सहमति वाली स्क्रीन पर जाएं.
- स्कोप स्क्रीन पर जाने के लिए, ऐप्लिकेशन में बदलाव करें > सेव करें और जारी रखें पर क्लिक करें.
- स्कोप जोड़ें या हटाएं पर क्लिक करें.
- अगर आपके पास पहले से स्कोप नहीं हैं, तो ये स्कोप जोड़ें:
https://www.googleapis.com/auth/classroom.coursework.students
https://www.googleapis.com/auth/classroom.courses
- इसके बाद, अपडेट करें > सेव करें और जारी रखें > सेव करें और जारी रखें > डैशबोर्ड पर वापस जाएं पर क्लिक करें.
ज़्यादा जानने के लिए, ऐसी स्क्रीन कॉन्फ़िगर करना जहां OAuth के लिए सहमति दी जाती है देखें.
classroom.coursework.students
स्कोप से रूब्रिक को पढ़ने और लिखने का ऐक्सेस मिलता है (इसमें CourseWork
का ऐक्सेस भी शामिल है) और classroom.courses
स्कोप, कोर्स को पढ़ने और लिखने की अनुमति देता है.
किसी तरीके के लिए ज़रूरी दायरे, तरीके के रेफ़रंस दस्तावेज़ में दिए गए हैं. उदाहरण के तौर पर, courses.courseWork.rubrics.create
ऑथराइज़ेशन स्कोप
देखें. Google API के OAuth 2.0 स्कोप में जाकर, Classroom के सभी स्कोप देखे जा सकते हैं. यहां रूब्रिक की जानकारी नहीं दी गई है, क्योंकि एपीआई की अब भी झलक देखी जा रही है.
सैंपल को कॉन्फ़िगर करें
अपनी वर्क डायरेक्ट्री में, Python के लिए Google क्लाइंट लाइब्रेरी इंस्टॉल करें:
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
main.py
नाम की एक फ़ाइल बनाएं, जो क्लाइंट लाइब्रेरी बनाती हो और YOUR_API_KEY
के बजाय आपकी एपीआई कुंजी का इस्तेमाल करके, उपयोगकर्ता को मंज़ूरी देती हो:
import json
import os.path
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
# If modifying these scopes, delete the file token.json.
SCOPES = ['https://www.googleapis.com/auth/classroom.courses',
'https://www.googleapis.com/auth/classroom.coursework.students']
def build_authenticated_service(api_key):
"""Builds the Classroom service."""
creds = None
# The file token.json stores the user's access and refresh tokens, and is
# created automatically when the authorization flow completes for the first
# time.
if os.path.exists('token.json'):
creds = Credentials.from_authorized_user_file('token.json', SCOPES)
# If there are no (valid) credentials available, let the user log in.
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
flow = InstalledAppFlow.from_client_secrets_file(
'credentials.json', SCOPES)
creds = flow.run_local_server(port=0)
# Save the credentials for the next run.
with open('token.json', 'w') as token:
token.write(creds.to_json())
try:
# Build the Classroom service.
service = build(
serviceName="classroom",
version="v1",
credentials=creds,
discoveryServiceUrl=f"https://classroom.googleapis.com/$discovery/rest?labels=DEVELOPER_PREVIEW&key={api_key}")
return service
except HttpError as error:
print('An error occurred: %s' % error)
if __name__ == '__main__':
service = build_authenticated_service(YOUR_API_KEY)
python main.py
का इस्तेमाल करके स्क्रिप्ट चलाएं. आपको OAuth के स्कोप में साइन इन करने और
सहमति देने के लिए कहा जाएगा.
एक असाइनमेंट बनाएं
रूब्रिक किसी असाइनमेंट या CourseWork
से जुड़ा होता है. यह सिर्फ़ उस CourseWork
के संदर्भ में काम का होता है. रूब्रिक सिर्फ़ उस Google Cloud प्रोजेक्ट से बनाए जा सकते हैं जिससे पैरंट CourseWork
आइटम बनाया गया है. इस गाइड में, स्क्रिप्ट के साथ एक नया CourseWork
असाइनमेंट बनाएं.
main.py
में यह जोड़ें:
def get_latest_course(service):
"""Retrieves the last created course."""
try:
response = service.courses().list(pageSize=1).execute()
courses = response.get("courses", [])
if not courses:
print("No courses found. Did you remember to create one in the UI?")
return
course = courses[0]
return course
except HttpError as error:
print(f"An error occurred: {error}")
return error
def create_coursework(service, course_id):
"""Creates and returns a sample coursework."""
try:
coursework = {
"title": "Romeo and Juliet analysis.",
"description": """Write a paper arguing that Romeo and Juliet were
time travelers from the future.""",
"workType": "ASSIGNMENT",
"state": "PUBLISHED",
}
coursework = service.courses().courseWork().create(
courseId=course_id, body=coursework).execute()
return coursework
except HttpError as error:
print(f"An error occurred: {error}")
return error
आपने अभी-अभी जो टेस्ट क्लास बनाई है उसका course_id
वापस पाने के लिए, main.py
अपडेट करें, असाइनमेंट के लिए नया सैंपल बनाएं, और असाइनमेंट का
coursework_id
डेटा फिर से पाएं:
if __name__ == '__main__':
service = build_authenticated_service(YOUR_API_KEY)
course = get_latest_course(service)
course_id = course.get("id")
course_name = course.get("name")
print(f"'{course_name}' course ID: {course_id}")
coursework = create_coursework(service, course_id)
coursework_id = coursework.get("id")
print(f"Assignment created with ID {coursework_id}")
#TODO(developer): Save the printed course and coursework IDs.
course_id
और coursework_id
की जानकारी सेव करें. इनकी ज़रूरत, सभी रूब्रिक सीआरयूडी
ऑपरेशनों के लिए होती है.
अब Classroom में आपके पास एक सैंपल CourseWork
होना चाहिए.
दूसरी इमेज. Classroom में असाइनमेंट के नमूने का व्यू.
रूब्रिक बनाना
अब आप रूब्रिक मैनेज करने के लिए तैयार हैं.
CourseWork
पर Create
कॉल के साथ एक रूब्रिक बनाया जा सकता है, जिसमें पूरा रूब्रिक ऑब्जेक्ट शामिल होता है. इसमें शर्त और लेवल के लिए आईडी प्रॉपर्टी नहीं बनाई जातीं (इन्हें बनाते समय जनरेट होती है).
main.py
में यह फ़ंक्शन जोड़ें:
def create_rubric(service, course_id, coursework_id):
"""Creates an example rubric on a coursework."""
try:
body = {
"criteria": [
{
"title": "Argument",
"description": "How well structured your argument is.",
"levels": [
{"title": "Convincing",
"description": "A compelling case is made.", "points": 30},
{"title": "Passable",
"description": "Missing some evidence.", "points": 20},
{"title": "Needs Work",
"description": "Not enough strong evidence..", "points": 0},
]
},
{
"title": "Spelling",
"description": "How well you spelled all the words.",
"levels": [
{"title": "Perfect",
"description": "No mistakes.", "points": 20},
{"title": "Great",
"description": "A mistake or two.", "points": 15},
{"title": "Needs Work",
"description": "Many mistakes.", "points": 5},
]
},
{
"title": "Grammar",
"description": "How grammatically correct your sentences are.",
"levels": [
{"title": "Perfect",
"description": "No mistakes.", "points": 20},
{"title": "Great",
"description": "A mistake or two.", "points": 15},
{"title": "Needs Work",
"description": "Many mistakes.", "points": 5},
]
},
]
}
rubric = service.courses().courseWork().rubrics().create(
courseId=course_id, courseWorkId=coursework_id, body=body,
# Specify the preview version. Rubrics CRUD capabilities are
# supported in V1_20231110_PREVIEW and later.
previewVersion="V1_20231110_PREVIEW"
).execute()
print(f"Rubric created with ID {rubric.get('id')}")
return rubric
except HttpError as error:
print(f"An error occurred: {error}")
return error
इसके बाद, उदाहरण वाले रूब्रिक बनाने के लिए, main.py
को अपडेट करें और चलाएं. इसके लिए, पहले से दिए गए अपने Course
और CourseWork
आईडी का इस्तेमाल करें:
if __name__ == '__main__':
service = build_authenticated_service(YOUR_API_KEY)
rubric = create_rubric(service, YOUR_COURSE_ID, YOUR_COURSEWORK_ID)
print(json.dumps(rubric, indent=4))
रूब्रिक के बारे में कुछ बातें:
- Classroom के यूज़र इंटरफ़ेस (यूआई) में मानदंड और लेवल का क्रम दिखता है.
- स्कोर किए गए लेवल (
points
प्रॉपर्टी वाले), पॉइंट के हिसाब से बढ़ते या घटते क्रम में होने चाहिए. इन्हें किसी भी क्रम में नहीं लगाया जा सकता. - शिक्षक यूज़र इंटरफ़ेस (यूआई) में शर्तों और स्कोर के लेवल को फिर से क्रम में लगा सकते हैं (लेकिन स्कोर नहीं किए गए लेवल नहीं) इससे डेटा में उनका क्रम बदल जाता है.
रूब्रिक के स्ट्रक्चर से जुड़ी ज़्यादा चेतावनियों के लिए, सीमाएं देखें.
वापस यूज़र इंटरफ़ेस (यूआई) में, आपको असाइनमेंट पर रूब्रिक दिखेगा.
तीसरी इमेज. Classroom असाइनमेंट पर सैंपल रूब्रिक का व्यू.
रूब्रिक पढ़ना
रूब्रिक को स्टैंडर्ड List
और Get
तरीकों से पढ़ा जा सकता है.
किसी असाइनमेंट में ज़्यादा से ज़्यादा एक रूब्रिक हो सकता है, इसलिए हो सकता है कि List
काम का न लगे. हालांकि, अगर आपके पास पहले से रूब्रिक आईडी न हो, तो इससे मदद मिल सकती है. अगर CourseWork
से कोई रूब्रिक नहीं जुड़ा है, तो List
वाला जवाब खाली होता है.
main.py
में यह फ़ंक्शन जोड़ें:
def get_rubric(service, course_id, coursework_id):
"""
Get the rubric on a coursework. There can only be at most one.
Returns null if there is no rubric.
"""
try:
response = service.courses().courseWork().rubrics().list(
courseId=course_id, courseWorkId=coursework_id,
# Specify the preview version. Rubrics CRUD capabilities are
# supported in V1_20231110_PREVIEW and later.
previewVersion="V1_20231110_PREVIEW"
).execute()
rubrics = response.get("rubrics", [])
if not rubrics:
print("No rubric found for this assignment.")
return
rubric = rubrics[0]
return rubric
except HttpError as error:
print(f"An error occurred: {error}")
return error
जोड़े गए रूब्रिक को फ़ेच करने के लिए, main.py
को अपडेट करें और चलाएं:
if __name__ == '__main__':
service = build_authenticated_service(YOUR_API_KEY)
rubric = get_rubric(service, YOUR_COURSE_ID, YOUR_COURSEWORK_ID)
print(json.dumps(rubric, indent=4))
#TODO(developer): Save the printed rubric ID.
आगे के चरणों के लिए, रूब्रिक में id
प्रॉपर्टी पर ध्यान दें.
रूब्रिक आईडी होने पर Get
ठीक से काम करता है. इसके बजाय फ़ंक्शन में Get
का इस्तेमाल
ऐसा लग सकता है:
def get_rubric(service, course_id, coursework_id, rubric_id):
"""
Get the rubric on a coursework. There can only be at most one.
Returns a 404 if there is no rubric.
"""
try:
rubric = service.courses().courseWork().rubrics().get(
courseId=course_id,
courseWorkId=coursework_id,
id=rubric_id,
# Specify the preview version. Rubrics CRUD capabilities are
# supported in V1_20231110_PREVIEW and later.
previewVersion="V1_20231110_PREVIEW"
).execute()
return rubric
except HttpError as error:
print(f"An error occurred: {error}")
return error
अगर कोई रूब्रिक मौजूद नहीं है, तो यह कोड 404 दिखाता है.
रूब्रिक अपडेट करना
रूब्रिक में बदलाव करने के लिए, Patch
कॉल का इस्तेमाल किया जाता है. रूब्रिक की बनावट जटिल होने की वजह से, अपडेट ऐसे पैटर्न से पूरे किए जाने चाहिए जिसमें पूरी criteria
प्रॉपर्टी को बदला गया हो. ऐसे पैटर्न में बदलाव करने के लिए बदलाव करें.
अपडेट से जुड़े नियम नीचे दिए गए हैं:
- बिना आईडी के जोड़े गए मानदंड या लेवल जोड़ माने जाते हैं.
- पहले से ज़रूरी शर्तें या लेवल उपलब्ध नहीं हैं, उन्हें मिटाया गया माना जाता है.
- मौजूदा आईडी, लेकिन बदले गए डेटा वाले मानदंड या लेवल को बदलाव माना जाता है. बिना बदलाव की गई प्रॉपर्टी में कोई बदलाव नहीं किया जाता है.
- नए या अज्ञात आईडी के साथ दिए गए मानदंड या लेवल को गड़बड़ी माना जाता है.
- नई शर्तों और लेवल के क्रम को यूज़र इंटरफ़ेस (यूआई) का नया क्रम (ऊपर बताई गई सीमाओं के साथ) माना जाता है.
रूब्रिक अपडेट करने के लिए फ़ंक्शन जोड़ें:
def update_rubric(service, course_id, coursework_id, rubric_id, body):
"""
Updates the rubric on a coursework.
"""
try:
rubric = service.courses().courseWork().rubrics().patch(
courseId=course_id,
courseWorkId=coursework_id,
id=rubric_id,
body=body,
updateMask='criteria',
# Specify the preview version. Rubrics CRUD capabilities are
# supported in V1_20231110_PREVIEW and later.
previewVersion="V1_20231110_PREVIEW"
).execute()
return rubric
except HttpError as error:
print(f"An error occurred: {error}")
return error
इस उदाहरण में, criteria
फ़ील्ड में updateMask
की मदद से बदलाव करने के बारे में बताया गया है.
इसके बाद, ऊपर दिए गए हर अपडेट के नियमों में बदलाव करने के लिए, main.py
में बदलाव करें:
if __name__ == '__main__':
service = build_authenticated_service(YOUR_API_KEY)
# Get the latest rubric.
rubric = get_rubric(service, YOUR_COURSE_ID, YOUR_COURSEWORK_ID)
criteria = rubric.get("criteria")
"""
The "criteria" property should look like this:
[
{
"id": "NkEyMdMyMzM2Nxkw",
"title": "Argument",
"description": "How well structured your argument is.",
"levels": [
{
"id": "NkEyMdMyMzM2Nxkx",
"title": "Convincing",
"description": "A compelling case is made.",
"points": 30
},
{
"id": "NkEyMdMyMzM2Nxky",
"title": "Passable",
"description": "Missing some evidence.",
"points": 20
},
{
"id": "NkEyMdMyMzM2Nxkz",
"title": "Needs Work",
"description": "Not enough strong evidence..",
"points": 0
}
]
},
{
"id": "NkEyMdMyMzM2Nxk0",
"title": "Spelling",
"description": "How well you spelled all the words.",
"levels": [...]
},
{
"id": "NkEyMdMyMzM2Nxk4",
"title": "Grammar",
"description": "How grammatically correct your sentences are.",
"levels": [...]
}
]
"""
# Make edits. This example will make one of each type of change.
# Add a new level to the first criteria. Levels must remain sorted by
# points.
new_level = {
"title": "Profound",
"description": "Truly unique insight.",
"points": 50
}
criteria[0]["levels"].insert(0, new_level)
# Remove the last criteria.
del criteria[-1]
# Update the criteria titles with numeric prefixes.
for index, criterion in enumerate(criteria):
criterion["title"] = f"{index}: {criterion['title']}"
# Resort the levels from descending to ascending points.
for criterion in criteria:
criterion["levels"].sort(key=lambda level: level["points"])
# Update the rubric with a patch call.
new_rubric = update_rubric(
service, YOUR_COURSE_ID, YOUR_COURSEWORK_ID, YOUR_RUBRIC_ID, rubric)
print(json.dumps(new_rubric, indent=4))
ये बदलाव अब Classroom में, शिक्षक को दिखने चाहिए.
चौथी इमेज. अपडेट किए गए रूब्रिक का व्यू.
रूब्रिक के लेवल वाले सबमिशन देखें
फ़िलहाल, छात्र-छात्राओं के सबमिट किए गए असाइनमेंट को एपीआई, रूब्रिक की मदद से ग्रेड नहीं दे सकता. हालांकि, Classroom के यूज़र इंटरफ़ेस (यूआई) में, रूब्रिक की मदद से ग्रेड दिए गए सबमिशन के लिए रूब्रिक ग्रेड को पढ़ा जा सकता है.
Classroom के यूज़र इंटरफ़ेस (यूआई) में छात्र/छात्रा के तौर पर, असाइनमेंट पूरा करें. इसके बाद, शिक्षक के तौर पर, रूब्रिक का इस्तेमाल करके मैन्युअल तरीके से असाइनमेंट को ग्रेड दें.
पांचवीं इमेज. ग्रेडिंग के दौरान रूब्रिक को शिक्षकों के हिसाब से देखना.
रूब्रिक से ग्रेड दिए गए छात्र-छात्राओं के सबमिशन की दो नई प्रॉपर्टी हैं: draftRubricGrades
और assignedRubricGrades
, जो ड्राफ़्ट के दौरान और असाइन किए गए ग्रेडिंग स्टेट के लिए शिक्षक के चुने गए पॉइंट और लेवल को दिखाती हैं.
इसके अलावा, छात्र-छात्राओं के सबमिशन, उनसे जुड़े रूब्रिक में भी एक rubricId
फ़ील्ड होता है. यह फ़ील्ड, ग्रेड देने से पहले का होता है. यह CourseWork
से जुड़े नए रूब्रिक को दिखाता है. अगर शिक्षक किसी रूब्रिक को मिटाते हैं और उसे फिर से बनाते हैं, तो यह वैल्यू बदल सकती है.
ग्रेड दिए गए सबमिशन देखने के लिए, मौजूदा studentSubmissions.Get
और
studentSubmissions.List
तरीकों का इस्तेमाल किया जा सकता है.
छात्र-छात्राओं के सबमिट किए गए असाइनमेंट को लिस्ट करने के लिए, main.py
में यह फ़ंक्शन जोड़ें:
def get_latest_submission(service, course_id, coursework_id):
"""Retrieves the last submission for an assignment."""
try:
response = service.courses().courseWork().studentSubmissions().list(
courseId = course_id,
courseWorkId = coursework_id,
pageSize=1,
# Specify the preview version. Rubrics CRUD capabilities are
# supported in V1_20231110_PREVIEW and later.
previewVersion="V1_20231110_PREVIEW"
).execute()
submissions = response.get("studentSubmissions", [])
if not submissions:
print(
"""No submissions found. Did you remember to turn in and grade
the assignment in the UI?""")
return
submission = submissions[0]
return submission
except HttpError as error:
print(f"An error occurred: {error}")
return error
इसके बाद, सबमिशन ग्रेड देखने के लिए, main.py
को अपडेट करें और चलाएं.
if __name__ == '__main__':
service = build_authenticated_service(YOUR_API_KEY)
submission = get_latest_submission(
service, YOUR_COURSE_ID, YOUR_COURSEWORK_ID)
print(json.dumps(submission, indent=4))
draftRubricGrades
और assignedRubricGrades
में ये शामिल हैं:
- इससे जुड़े रूब्रिक नियम का
criterionId
. - हर शर्त के लिए, शिक्षक ने
points
को असाइन किया. यह चुना गया लेवल से हो सकता है लेकिन शिक्षक भी इसे ओवरराइट कर सकता है. - हर शर्त के लिए चुने गए लेवल का
levelId
. अगर शिक्षक ने लेवल नहीं चुना है, लेकिन शर्तें के लिए पॉइंट असाइन किए गए हैं, तो यह फ़ील्ड मौजूद नहीं होगा.
इन सूचियों में सिर्फ़ उन शर्तों की एंट्री होती हैं जिनके लिए शिक्षक ने या तो कोई लेवल चुना है या पॉइंट सेट किए हैं. उदाहरण के लिए, अगर कोई शिक्षक ग्रेडिंग के दौरान सिर्फ़ एक शर्त के साथ इंटरैक्ट करता है, तो draftRubricGrades
और assignedRubricGrades
में सिर्फ़ एक आइटम होगा. भले ही, रूब्रिक में कई शर्तें हों.
रूब्रिक मिटाना
Delete
के स्टैंडर्ड अनुरोध के साथ रूब्रिक को मिटाया जा सकता है. नीचे दिया गया कोड, फ़ंक्शन को पूरा करने का उदाहरण दिखाता है. हालांकि, ग्रेडिंग की प्रक्रिया पहले ही शुरू हो चुकी है, इसलिए मौजूदा रूब्रिक को नहीं मिटाया जा सकता:
def delete_rubric(service, course_id, coursework_id, rubric_id):
"""Deletes the rubric on a coursework."""
try:
service.courses().courseWork().rubrics().delete(
courseId=course_id,
courseWorkId=coursework_id,
id=rubric_id,
# Specify the preview version. Rubrics CRUD capabilities are
# supported in V1_20231110_PREVIEW and later.
previewVersion="V1_20231110_PREVIEW"
).execute()
except HttpError as error:
print(f"An error occurred: {error}")
return error
रूब्रिक को एक्सपोर्ट और इंपोर्ट करना
रूब्रिक को Google स्प्रेडशीट में मैन्युअल तरीके से एक्सपोर्ट किया जा सकता है, ताकि शिक्षक इन्हें फिर से इस्तेमाल कर सकें.
कोड में रूब्रिक शर्त के अलावा, इन एक्सपोर्ट की गई शीट से रूब्रिक बनाए जा सकते हैं और उन्हें अपडेट किया जा सकता है. इसके लिए, criteria
के बजाय रूब्रिक के मुख्य भाग में sourceSpreadsheetId
के बारे में जानकारी देनी होगी:
def create_rubric_from_sheet(service, course_id, coursework_id, sheet_id):
"""Creates an example rubric on a coursework."""
try:
body = {
"sourceSpreadsheetId": sheet_id
}
rubric = service.courses().courseWork().rubrics().create(
courseId=course_id, courseWorkId=coursework_id, body=body,
# Specify the preview version. Rubrics CRUD capabilities are
# supported in V1_20231110_PREVIEW and later.
previewVersion="V1_20231110_PREVIEW"
).execute()
print(f"Rubric created with ID {rubric.get('id')}")
return rubric
except HttpError as error:
print(f"An error occurred: {error}")
return error
सुझाव/राय दें या शिकायत करें
अगर आपको कोई समस्या मिलती है या आपको कोई सुझाव देना है, तो अपनी शिकायत शेयर करें.