首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >是否可以使用Blackboard WebServices以编程方式向Blackboard提交作业

是否可以使用Blackboard WebServices以编程方式向Blackboard提交作业
EN

Stack Overflow用户
提问于 2012-07-12 23:36:29
回答 1查看 1.3K关注 0票数 6

是否有人可以确认是否可以使用Blackboard WebServices以编程方式向Blackboard提交作业?(如文档here所示。具体来说,我想知道使用Gradebook.WS、AttemptVO和studentSubmission方法提交作业的正确方式。这是我到目前为止已经尝试过的,主要是在Bb成绩册中可以看到的尝试,除了在黑板成绩册中看不到attemptVO.studentSubmission:

代码语言:javascript
复制
from suds.client import Client 
from suds.plugin import MessagePlugin 
from suds.wsse import Timestamp, UsernameToken, Security 

WS_BASE_URL = 'http://bbdev.bangor.ac.uk/webapps/ws/services/' 

class Learn9Plugin(MessagePlugin): 
    def marshalled(self, context): 
        password = context.envelope.childAtPath('Header/Security/UsernameToken/Password') 
        password.set('Type', 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText') 

security = Security() 
security.tokens.append(Timestamp()) 
security.tokens.append(UsernameToken('session', 'nosession')) 
plugin = Learn9Plugin() 

context = Client(   WS_BASE_URL + 'Context.WS?wsdl', 
location = WS_BASE_URL + 'Context.WS', 
autoblend = True, 
wsse = security, 
plugins = [plugin]) 

context.options.wsse.tokens[1].password = context.service.initialize() 

result = context.service.loginTool('xxxxx', 'xxxx', 'xxxxx', '', 500) 

course_id = '_15877_1' 

gradebook = Client(WS_BASE_URL + 'Gradebook.WS?wsdl', 
    location=WS_BASE_URL + 'Gradebook.WS', 
    autoblend=True, 
    wsse=security, 
    plugins=[plugin]) 


attemptVO = gradebook.factory.create('ns0:AttemptVO') 

attemptVO.override = False 
attemptVO.publicFeedbackToUser = False 
attemptVO.score = 0 
attemptVO.gradeId = '_169_1' # Smith
attemptVO.studentSubmission = 'Some sample text representing an assignment'
attemptVO.studentSubmissionTextType = 'PLAIN_TEXT'
print attemptVO
attempt_result = gradebook.service.saveAttempts(course_id, [attemptVO,])
print attempt_result

结果:

代码语言:javascript
复制
(AttemptVO){
   attemptDate = None
   creationDate = None
   displayGrade = None
   exempt = None
   expansionData[] = <empty>
   feedbackToUser = None
   grade = None
   gradeId = "_169_1"
   groupAttemptId = None
   id = None
   instructorNotes = None
   override = False
   publicFeedbackToUser = False
   score = 0
   status = None
   studentComments = None
   studentSubmission = "Some sample text representing an assignment"
   studentSubmissionTextType = "PLAIN_TEXT"
 }
[_586_1]

非常感谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-07-18 16:32:56

Blackboard的一位开发人员回复我说,因为'studentSubmission‘和'setStudentSubmissionTextType’方法都是只读属性,所以不能使用webservice提交作业。

已向Blackboard提出更新文档的请求。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11455404

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档