def test_report_rows(self): view = AssignmentDetailReport() view.request = RequestFactory().get("/") view.request.course = self.sample_course responses = self.assignment1.responses(self.sample_course, self.instructor_one) rows = view.get_report_rows(responses) rows.next() # header row = rows.next() self.assertEquals(row[0], "Student One") self.assertEquals(row[1], "student_one") self.assertEquals(row[2], "Response 1") self.assertEquals(row[3], "Submitted to Instructor") self.assertIsNone(row[4]) # row[5] modified date self.assertFalse(row[6]) self.assertEquals(row[7], 2) # selections self.assertEquals(row[8], 1) # items self.assertEquals(row[9], 1) # author selections self.assertEquals(row[10], 1) # author items self.assertAlmostEqual(row[11], 33.33, 2) # % author selections used self.assertAlmostEqual(row[12], 100.00) # tag usage self.assertEquals(row[13], 0.0) # vocab usage self.assertEquals(row[14], 3) # all author selections self.assertEquals(row[15], 1) # author collection with self.assertRaises(StopIteration): rows.next()
def test_report_rows(self): view = AssignmentDetailReport() view.request = RequestFactory().get('/') view.request.course = self.sample_course responses = self.assignment1.responses(self.sample_course, self.instructor_one) rows = view.get_report_rows(responses) next(rows) # header row = next(rows) self.assertEquals(row[0], 'Student One') self.assertEquals(row[1], 'student_one') self.assertEquals(row[2], 'Response 1') self.assertEquals(row[3], 'Shared with Instructor') self.assertIsNone(row[4]) # row[5] modified date self.assertFalse(row[6]) self.assertEquals(row[7], 2) # selections self.assertEquals(row[8], 1) # items self.assertEquals(row[9], 1) # author selections self.assertEquals(row[10], 1) # author items self.assertAlmostEqual(row[11], 33.33, 2) # % author selections used self.assertAlmostEqual(row[12], 100.00) # tag usage self.assertEquals(row[13], 0.0) # vocab usage self.assertEquals(row[14], 3) # all author selections self.assertEquals(row[15], 1) # author collection with self.assertRaises(StopIteration): next(rows)
def test_vocab_usage(self): taxonomy = {'Colors': ['Red', 'Blue', 'Green']} self.create_vocabularies(self.sample_course, taxonomy) term = Term.objects.get(name='red') self.create_term_relationship(self.student_one_selection1, term) selections = SherdNote.objects.filter(author=self.student_one) view = AssignmentDetailReport() view.request = RequestFactory().get('/') view.request.course = self.sample_course self.assertAlmostEquals(view.vocabulary_usage(selections), 33.33, 2)
def test_vocab_usage(self): taxonomy = {"Colors": ["Red", "Blue", "Green"]} self.create_vocabularies(self.sample_course, taxonomy) term = Term.objects.get(name="red") self.create_term_relationship(self.student_one_selection1, term) selections = SherdNote.objects.filter(author=self.student_one) view = AssignmentDetailReport() view.request = RequestFactory().get("/") view.request.course = self.sample_course self.assertAlmostEquals(view.vocabulary_usage(selections), 33.33, 2)
def test_percent_used(self): selections = SherdNote.objects.filter(author=self.student_one) view = AssignmentDetailReport() self.assertEquals(view.percent_used(selections, 0), 0.0) self.assertEquals(view.percent_used(selections, 3), 100.0)
def test_tag_usage(self): selections = SherdNote.objects.filter(author=self.student_one) view = AssignmentDetailReport() self.assertAlmostEquals(view.tag_usage(selections), 33.33, 2)
def test_citation_analysis(self): view = AssignmentDetailReport() items, selections = view.citation_analysis(self.response1.citations()) self.assertEquals(items[0], self.asset) self.assertTrue(self.student_one_selection1 in selections) self.assertTrue(self.student_two_selection in selections)
from mediathread.reports.views import SelfRegistrationReportView, \ ActivityByCourseView, ClassSummaryGraphView, AssignmentDetailReport from mediathread.reports.views import ( class_assignments, class_assignment_report, class_summary, class_activity, ) urlpatterns = [ # urls prefix at root AND 'reports/' url(r'^class_assignments/$', class_assignments, name='class-assignments'), url(r'^class_assignments/(?P<project_id>\d+)/$', class_assignment_report, name='class-assignment-report'), url(r'^assignment/detail/(?P<assignment_id>\d+)/$', AssignmentDetailReport.as_view(), name='assignment-detail-report'), url(r'^class_summary/$', class_summary, name='class-summary'), url(r'^class_summary/graph.json$', ClassSummaryGraphView.as_view(), name='class-summary-graph'), url(r'^class_activity/$', class_activity, name='class-activity'), url(r'^activity/course/$', ActivityByCourseView.as_view(), name="mediathread-activity-by-course"), url(r'^self-registration/$', SelfRegistrationReportView.as_view(), name="mediathread-self-registration") ]
from mediathread.reports.views import ( SelfRegistrationReportView, ActivityByCourseView, ClassSummaryGraphView, AssignmentDetailReport, ClassSummaryView, ClassActivityView, ClassAssignmentsView, ClassAssignmentReport) urlpatterns = [ # urls prefix at root AND 'reports/' path('class_assignments/', ClassAssignmentsView.as_view(), name='class-assignments'), path('class_assignments/<int:project_id>/', ClassAssignmentReport.as_view(), name='class-assignment-report'), path('assignment/detail/<int:assignment_id>/', AssignmentDetailReport.as_view(), name='assignment-detail-report'), path('class_summary/', ClassSummaryView.as_view(), name='class-summary'), path('class_summary/graph.json', ClassSummaryGraphView.as_view(), name='class-summary-graph'), path('class_activity/', ClassActivityView.as_view(), name='class-activity'), path('activity/course/', ActivityByCourseView.as_view(), name="mediathread-activity-by-course"), path('self-registration/', SelfRegistrationReportView.as_view(), name="mediathread-self-registration") ]