[WG: Sakai QA] [Building Sakai] Problems making grades visible in Gradebook

Noah Botimer nbotimer at unicon.net
Fri Jul 5 04:58:14 PDT 2013


Thanks, Kevin. At a glance, it looks like the is* methods could leak parse exceptions, but otherwise this looks good. I'll have a chance to look at it more carefully tonight or over the weekend. Really nice contribution. 

Thanks,
-Noah

On Jul 3, 2013, at 9:25 PM, Kevin Takacs <ktakacs at anisakai.com> wrote:

> I have completed an implementation of the ExternalAssignmentProvider for JForum and attached a patch for JForum trunk to SAK-23733.  With this implementation the problems of forum grades not appearing for students and the incorrect grade calculations appear to be resolved for JForum.
> 
> Diff:
> 
> Index: jforum-impl/impl/src/java/org/etudes/component/app/jforum/JForumExternalAssignmentProvider.java
> ===================================================================
> --- jforum-impl/impl/src/java/org/etudes/component/app/jforum/JForumExternalAssignmentProvider.java	(revision 0)
> +++ jforum-impl/impl/src/java/org/etudes/component/app/jforum/JForumExternalAssignmentProvider.java	(revision 0)
> @@ -0,0 +1,121 @@
> +package org.etudes.component.app.jforum;
> +
> +import org.apache.commons.logging.Log;
> +import org.apache.commons.logging.LogFactory;
> +import org.etudes.api.app.jforum.*;
> +import org.sakaiproject.service.gradebook.shared.ExternalAssignmentProvider;
> +import org.sakaiproject.service.gradebook.shared.GradebookExternalAssessmentService;
> +
> +import java.util.*;
> +
> +/**
> + * Created with IntelliJ IDEA.
> + * User: kevin
> + * Date: 7/1/13
> + * Time: 2:09 PM
> + * To change this template use File | Settings | File Templates.
> + */
> +public class JForumExternalAssignmentProvider implements ExternalAssignmentProvider {
> +
> +    private Log logger = LogFactory.getLog(JForumExternalAssignmentProvider.class);
> +
> +    private GradebookExternalAssessmentService gradebookExternalAssessmentService;
> +
> +    private JForumGradeService jForumGradeService;
> +
> +    private JForumForumService jForumForumService;
> +
> +    public void init(){
> +        logger.info("Init and register JForumExternalAssignmentProvider");
> +        gradebookExternalAssessmentService.registerExternalAssignmentProvider(this);
> +    }
> +
> +    public void destroy(){
> +        logger.info("Destroy and unregister JForumExternalAssignmentProvider");
> +        gradebookExternalAssessmentService.unregisterExternalAssignmentProvider(getAppKey());
> +    }
> +
> +    public String getAppKey() {
> +        return "jforum";
> +    }
> +
> +    public boolean isAssignmentDefined(String id) {
> +
> +        logger.debug("JForumExternalAssignmentProvider isAssignmentDefined id=" + id);
> +
> +        return jForumGradeService.getByForumId(Integer.parseInt(id)) != null;
> +    }
> +
> +    public boolean isAssignmentGrouped(String id) {
> +        logger.debug("JForumExternalAssignmentProvider isAssignmentGrouped id=" + id);
> +
> +        return jForumForumService.getForum(Integer.parseInt(id)).getAccessType() == 2;
> +    }
> +
> +    public boolean isAssignmentVisible(String id, String userId) {
> +        logger.debug("JForumExternalAssignmentProvider isAssignmentVisible id=" + id + " userId=" + userId);
> +
> +        try {
> +            Forum forum = jForumForumService.getForum(Integer.parseInt(id), userId);
> +            if(forum != null){
> +                if(forum.getAccessType() == 0){
> +                    return true;
> +                }
> +            } else {
> +                return false;
> +            }
> +        } catch (JForumAccessException e) {
> +            logger.warn("JForumExternalAssignmentProvider isAssignmentVisible caught exception " + e, e);
> +        }
> +
> +        return false;
> +    }
> +
> +    public List<String> getExternalAssignmentsForCurrentUser(String gradebookUid) {
> +        logger.debug("JForumExternalAssignmentProvider getExternalAssignmentsForCurrentUser gradebookUid=" + gradebookUid);
> +
> +        return getAssignmentList(gradebookUid);
> +    }
> +
> +    public Map<String, List<String>> getAllExternalAssignments(String gradebookUid, Collection<String> studentIds) {
> +
> +        Map<String, List<String>> studentAssignmentMap = new HashMap<String, List<String>>();
> +
> +        List<String> assignments = getAssignmentList(gradebookUid);
> +
> +        if(assignments != null && !assignments.isEmpty()){
> +
> +            for(String studentId : studentIds){
> +                studentAssignmentMap.put(studentId, assignments);
> +            }
> +        }
> +
> +        return studentAssignmentMap;
> +    }
> +
> +    private List<String> getAssignmentList(String gradebookUid) {
> +
> +        List<String> assignmentList = new ArrayList<String>();
> +        List<Grade> grades = jForumGradeService.getBySite(gradebookUid);
> +
> +        if(grades != null && !grades.isEmpty()){
> +            for(Grade grade : grades){
> +                assignmentList.add(JForumGradeService.JFORUM_GRADEBOOK_EXTERNAL_ID_CONCAT + String.valueOf(grade.getId()));
> +            }
> +        }
> +
> +        return assignmentList;
> +    }
> +
> +    public void setGradebookExternalAssessmentService(GradebookExternalAssessmentService gradebookExternalAssessmentService) {
> +        this.gradebookExternalAssessmentService = gradebookExternalAssessmentService;
> +    }
> +
> +    public void setjForumForumService(JForumForumServiceImpl jForumForumService) {
> +        this.jForumForumService = jForumForumService;
> +    }
> +
> +    public void setjForumGradeService(JForumGradeServiceImpl jForumGradeService) {
> +        this.jForumGradeService = jForumGradeService;
> +    }
> +}
> 
> Property changes on: jforum-impl/impl/src/java/org/etudes/component/app/jforum/JForumExternalAssignmentProvider.java
> ___________________________________________________________________
> Added: svn:keywords
>    + Date Revision Author HeadURL Id
> Added: svn:eol-style
>    + native
> 
> Index: jforum-impl/pack/src/webapp/WEB-INF/components.xml
> ===================================================================
> --- jforum-impl/pack/src/webapp/WEB-INF/components.xml	(revision 84201)
> +++ jforum-impl/pack/src/webapp/WEB-INF/components.xml	(working copy)
> @@ -654,4 +654,14 @@
>  			<ref bean="org.sakaiproject.db.api.SqlService" />
>  		</property>
>  	</bean>
> +
> +    <bean id="org.etudes.component.app.jforum.JForumExternalAssignmentProvider"
> +          class="org.etudes.component.app.jforum.JForumExternalAssignmentProvider"
> +          singleton="true" lazy-init="false" init-method="init" destroy-method="destroy">
> +
> +        <property name="gradebookExternalAssessmentService"><ref bean="org.sakaiproject.service.gradebook.GradebookExternalAssessmentService"/></property>
> +        <property name="jForumGradeService"><ref bean="org.etudes.api.app.jforum.JForumGradeService"/></property>
> +        <property name="jForumForumService"><ref bean="org.etudes.api.app.jforum.JForumForumService"/></property>
> +    </bean>
> +
>  </beans>
> 
> 
> On Wed, Jul 3, 2013 at 6:20 AM, Noah Botimer <nbotimer at unicon.net> wrote:
>> Hi folks,
>> 
>> The issue is a little more subtle than described below, but I won't go into too much detail here. What's more important is that I think we have most of a fix implemented:
>> 
>> https://github.com/botimer/sakai-cle/tree/gb-group
>> https://github.com/botimer/sakai-cle/commit/6f36b51cbb90e0daae3d61e135fc00b03a2941a0
>> 
>> I've talked with Chuck Hedrick about Lessons and there will probably be a resolution to an additional issue there today (which was discussed in another thread).
>> 
>> There are lots of comments. Please review and provide feedback.
>> 
>> Zhen, I'd especially like your blessing on the little change to BaseAssignmentService.
>> 
>> If the approach passes muster, we'll give some implementation advice to contrib tools -- it's a pretty simple addition to the providers, implementing one additional list method. It's in a supplemental interface for now, so it won't accidentally break existing contrib providers, though they will need to implement it for full functionality.
>> 
>> Thanks,
>> -Noah
>> 
>> 
>> On 07/02/2013 08:13 PM, Neal Caidin wrote:
>>> Hi All,
>>> 
>>> Looping in QA and Production.
>>> 
>>> My understanding is that https://jira.sakaiproject.org/browse/SAK-23733 has the following symptoms:
>>> 
>>> For Contrib tools which use Groups to integrate with the Gradebook the student cannot see the grade assigned by the instructor and the grade is not included in the Course Grade calculation. 
>>> 
>>> Same symptoms for the Lessons tool. 
>>> 
>>> I do not believe that it affects Assignments, Forums, or Test and Quizzes (Samigo).
>>> 
>>> No ETA for SAK-23733 but it is being actively worked on. Not sure yet if this will be in CLE 2.9.3 or not, but we are a little behind in any case (we have not yet released our first release candidate).
>>> 
>>> Thanks,
>>> 
>>> Neal Caidin
>>> Sakai CLE Community Coordinator
>>> Apereo Foundation
>>> 
>>> neal.caidin at apereo.org
>>> Skype: nealkdin
>>> 
>>> On Jul 2, 2013, at 6:24 PM, Kevin Takacs <ktakacs at anisakai.com> wrote:
>>> 
>>>> We ran into the same problem, and I have started working on an ExternalAssignmentProvider implementation for JForum.  I hope to have it completed soon and will contribute it within the next few days.
>>>> 
>>>> On Tue, Jul 2, 2013 at 1:32 PM, Zhen Qian <zqian at umich.edu> wrote:
>>>>> Hi, George:
>>>>> 
>>>>> If you are running 2.9, I do believe lack of "ExternalAssignmentProvider" impl is the cause of the problem. JForum, same as Test Center, are contrib tools from etudes, and neither implements ExternalAssignmentProvider API. We have patched Test Center locally in UMICH-766.
>>>>> 
>>>>> Since people are actively working on SAK-23733 to make ExternalAssignmentProvider impl backward compatible, I would suggest to wait for SAK-23733 patch, instead of writing an impl of ExternalAssignmentProvider in JForum.
>>>>> 
>>>>> Thanks,
>>>>> 
>>>>> - Zhen
>>>>> 
>>>>> 
>>>>> On Tue, Jul 2, 2013 at 4:16 PM, George Pipkin <gpp8p at virginia.edu> wrote:
>>>>>> Hi - 
>>>>>> 
>>>>>>    We've run into a problem in which a graded Jforum Forum transfers grades to GB, but these grades are not
>>>>>> visible to the students.  I'm wondering if this problem might be related to ExternalAssignmentProvider - is
>>>>>> it implemented in Jforums ?  There's be a bit of discussion about this surrounding SAK-23733.  Since 
>>>>>> the implication of not implementing it might include some impacts on GB grade totals, you can understand
>>>>>> why we at U.Va. are interested in understanding this problem better.
>>>>>> 
>>>>>> 
>>>>>>                                                     - George Pipkin
>>>>>>                                                        U.Va.
>> 
>> 
>> _______________________________________________
>> sakai-dev mailing list
>> sakai-dev at collab.sakaiproject.org
>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>> 
>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
> 
> 
> 
> -- 
> Kevin Takacs
> Software Engineer
> O 602-337-8408
> M 480-544-1972
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-qa/attachments/20130705/1354aecb/attachment-0001.html 


More information about the sakai-qa mailing list