Features/Activity specific metadata in Journal
The idea is to record metadata related to the use of activity and display it in the detail view of the Journal.
- Name: Walter Bender
- Email: <walter at sugarlabs dot org>
- Targeted release: 0.96
- Last updated:
- Percentage of completion: 90%
The Journal has a fixed set of metadata entries that are displayed in the Journal detail view for all entries, e.g., 'description', 'tags', 'preview', et al. It is proposed that we also include activity-specific metadata. For example, when assessing student work, it is of interest to teachers to know what tools a student may have used and, perhaps how many iterations a student made in creating an artifact. These data may vary from activity to activity, hence it is proposed to enhance the Journal Expanded View in a way that enables activities to specify which metadata fields would be useful to display.
The proposed mechanism is two-fold: (1) a special metadata field, 'public' is used to list those metadata fields that should be displayed; and (2) a new text field is added to the Expanded View to display these data. In the illustration above, two fields are displayed: Iterations and Block Types. These fields were set by the Turtle Art program. Other activities may set other fields (or no fields, in which case, the new text field would not be shown.)
# In the Turtle Art activity write_file method, the public metadata entry is set self.metadata['public'] = data_to_string([_('activity count'), _('turtle blocks')]) # In expandedentry.py, the public fields are displayed activity_box, self._public_data = self._create_public_data() second_column.append(activity_box) ... if 'public' in self._metadata: public_data = self._public_data.text_view_widget activity_list = simplejson.loads(self._metadata['public']) text = '' for tag in activity_list: logging.debug(tag) text += '%s: %s\n' % (tag, str(metadata.get(tag, ''))) public_data.props.buffer.props.text = text def _create_public_data(self): vbox = hippo.CanvasBox() vbox.props.spacing = style.DEFAULT_SPACING text = hippo.CanvasText(text=_('Activity Data:'), font_desc=style.FONT_NORMAL.get_pango_desc()) text.props.color = style.COLOR_BUTTON_GREY.get_int() if gtk.widget_get_default_direction() == gtk.TEXT_DIR_RTL: text.props.xalign = hippo.ALIGNMENT_END else: text.props.xalign = hippo.ALIGNMENT_START vbox.append(text) text_view = CanvasTextView('', box_height=style.GRID_CELL_SIZE) vbox.append(text_view, hippo.PACK_EXPAND) text_view.text_view_widget.props.accepts_tab = False text_view.text_view_widget.connect('focus-out-event', self._tags_focus_out_event_cb) return vbox, text_view
Benefit to Sugar
This feature will enable activities to post structured data to the Journal that is visible to the student and teacher. It is hypostatized to be of utility for both self and formal assessment.
The intervention is limited to expandedentry.py and any activity that chooses to add public metadata.
How To Test
The user will see additional data displayed in the Expanded View of some Journal entries.
No new dependencies
There is no adverse impact on activity development if these fields are not displayed. They will be searchable even if hidden.