Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Course Activity No Results for Quiz or Assignment
Tagged: activity, assignment, quiz
- This topic has 19 replies, 3 voices, and was last updated 8 years, 5 months ago by H.K. Latiyan.
-
AuthorPosts
-
April 27, 2016 at 7:41 pm #45156info2growSpectatorFound the activity records for assignments, they are being stored with the assignment ID as item_id and the user ID as secondary_item_id. The assignments are linked to the course properly. Here's the code from bp_course_activity.php function evaluate_assignment($assignment_id,$marks,$user_id,$max,$message_id){ $activity_id=bp_course_record_activity(array( 'action' => sprintf(__('Results available for assignment %s','vibe'),get_the_title($assignment_id)), 'content' => sprintf(__('Student %s got marks %s out of %s in assignment %s ','vibe'),bp_core_get_userlink( $user_id ),$marks,$max,get_the_title($assignment_id)), 'type' => 'evaluate_assignment', 'primary_link' => get_permalink($assignment_id), 'item_id' => $assignment_id, 'secondary_item_id' => $user_id ));April 27, 2016 at 8:17 pm #45161info2growSpectatorCode should read as follows // Assignments function start_assignment($assignment_id,$user_id){ $id = get_post_meta($assignment_id,'vibe_assignment_course',true); $activity_id=bp_course_record_activity(array( 'action' => sprintf(__('Student started assignment %s','vibe'),get_the_title($assignment_id)), 'content' => sprintf(__('Student %s started the assignment %s','vibe'),bp_core_get_userlink($user_id),get_the_title($assignment_id)), 'type' => 'assignment_started', 'primary_link' => get_permalink($assignment_id), 'item_id' => empty($id)?$assignment_id:$id, 'secondary_item_id' => $assignment_id )); $instructor_id = get_post_field('post_author',$assignment_id); bp_course_record_activity_meta(array( 'id' => $activity_id, 'meta_key' => 'instructor', 'meta_value' => $instructor_id )); do_action('badgeos_wplms_start_assignment',$assignment_id); } function submit_assignment($assignment_id,$user_id){ $id = get_post_meta($assignment_id,'vibe_assignment_course',true); $instructor_id=get_post_field('post_author', $assignment_id); $activity_id=bp_course_record_activity(array( 'action' => __('Student submitted assignment ','vibe'), 'content' => sprintf(__('Student %s submitted the assignment %s','vibe'),bp_core_get_userlink($user_id),get_the_title($assignment_id)), 'type' => 'assignment_submitted', 'primary_link' => get_permalink($assignment_id), 'item_id' => empty($id)?$assignment_id:$id, 'secondary_item_id' => $assignment_id )); bp_course_record_activity_meta(array( 'id' => $activity_id, 'meta_key' => 'instructor', 'meta_value' => $instructor_id )); do_action('badgeos_wplms_submit_assignment',$assignment_id); } function evaluate_assignment($assignment_id,$marks,$user_id,$max,$message_id){ $id = get_post_meta($assignment_id,'vibe_assignment_course',true); $activity_id=bp_course_record_activity(array( 'action' => sprintf(__('Results available for assignment %s','vibe'),get_the_title($assignment_id)), 'content' => sprintf(__('Student %s got marks %s out of %s in assignment %s ','vibe'),bp_core_get_userlink( $user_id ),$marks,$max,get_the_title($assignment_id)), 'type' => 'evaluate_assignment', 'primary_link' => get_permalink($assignment_id), 'item_id' => empty($id)?$assignment_id:$id, 'secondary_item_id' => $assignment_id )); bp_course_record_activity_meta(array( 'id' => $activity_id, 'meta_key' => 'remarks', 'meta_value' => $message_id )); do_action('badgeos_wplms_evaluate_assignment',$comment->comment_post_ID,$value, $comment->user_id); } function reset_assignment($assignment_id,$user_id){ $id = get_post_meta($assignment_id,'vibe_assignment_course',true); bp_course_record_activity(array( 'action' => __('Instructor Reseted the Assignment for User','vibe'), 'content' => sprintf(__('Assignment %s was reset by the Instructor for user %s','vibe'),get_the_title($assignment_id),bp_core_get_userlink( $user_id )), 'type' => 'reset_assignment', 'primary_link' => get_permalink($assignment_id), 'item_id' => empty($id)?$assignment_id:$id, 'secondary_item_id' => $assignment_id )); }April 27, 2016 at 8:40 pm #45162info2growSpectatoralso in wplms/includes/init.php the wrong activity types are being referenced line:534 'start_assignment' => __( 'Start Assignment', 'vibe' ), 'submit_assignment' => __( 'Submit Assignment', 'vibe' ), 'assignment_evaluated' => __( 'Assignment Evaluated', 'vibe' ), To match entries already in the DB it should be 'assignment_started' => __( 'Start Assignment', 'vibe' ), 'assignment_submitted' => __( 'Submit Assignment', 'vibe' ), 'evaluate_assignment' => __( 'Assignment Evaluated', 'vibe' ),April 28, 2016 at 2:46 pm #45357Anshuman SahuKeymasterYep you point seems to be valid we are sending the assignment id in in the activity . Adding to issue log.It will be fixed in the next update of wplms assignments and vibe course module plugin update .June 21, 2016 at 6:22 am #54382H.K. LatiyanParticipantThis issue has been resolved in the latest update of wplms 2.1, so please update the wplms theme and all its plugins to latest version i.e. 2.1 and then check.
-
AuthorPosts
- The topic ‘Course Activity No Results for Quiz or Assignment’ is closed to new replies.