2016-07-20 76 views
0

我打算使用教室指定的課程編號在我們的服務器上存儲許可證(不管本課程是否獲得許可)。我可以假設的是,課堂上分配的過程中ID是唯一在所有領域,即以下情況不能出現 -Google課堂API中的CourseID是否是跨域唯一的?

區A - >乙校 - 課程C(教室分配的id = 35595)

B區 - >學校d - 課程F(教室分配的id = 35595)

回答

1

你是正確的,基於文檔:

API overview

Course metadata and aliases

  • Course resource代表一個類,如「M.史密斯的五四時期的數學「,其委派的教師,學生花名冊,和元數據。

每門課程是由服務器分配一個唯一的ID標識。另外,名稱可能是與課程相關聯,並在使用。地方唯一ID的每一個名字,叫做Alias,存在於該限制誰可以創建和查看命名空間上的Java代碼示例,

基地:

Course course = new Course() 
.setName("10th Grade Biology") 
.setSection("Period 2") 
.setDescriptionHeading("Welcome to 10th Grade Biology") 
.setDescription("We'll be learning about about the structure of living creatures " 
+ "from a combination of textbooks, guest lectures, and lab work. Expect " 
+ "to be excited!") 
.setRoom("301") 
.setOwnerId("me") 
.setCourseState("PROVISIONED"); 
course = service.courses().create(course).execute(); 
System.out.printf("Course created: %s (%s)\n", course.getName(), course.getId()); 

它由服務器生成。希望能幫助到你!

+1

通過Google課堂支持驗證過。分配的ID在域之間是唯一的,別名不是。 –