710 |
if (! *err) |
if (! *err) |
711 |
g_markup_parse_context_end_parse (pcx, err); |
g_markup_parse_context_end_parse (pcx, err); |
712 |
|
|
|
if (! *err) |
|
|
leadr_guessing_game_open_exemplars (lc.gg, err); |
|
|
|
|
713 |
return LEADR_DOC (lc.gg); |
return LEADR_DOC (lc.gg); |
714 |
} |
} |
715 |
|
|
716 |
void |
static void |
717 |
leadr_guessing_game_open_exemplars (LeadrGuessingGame *gg, GError **err) |
_gg_open_exemplar (LeadrDoc *doc, |
718 |
|
GPtrSet *documents, |
719 |
|
GError **err) |
720 |
{ |
{ |
721 |
g_return_if_fail (gg); |
LeadrGuessingGame *gg = LEADR_GUESSING_GAME (doc); |
722 |
|
|
723 |
for (gint xx=0; !*err && xx < g_ptr_set_len (gg->exemplar); xx++) { |
for (gint xx=0; !*err && xx < g_ptr_set_len (gg->exemplar); xx++) { |
724 |
struct exemplar_ref *er = g_ptr_set_at (gg->exemplar, xx); |
struct exemplar_ref *er = g_ptr_set_at (gg->exemplar, xx); |
726 |
continue; |
continue; |
727 |
|
|
728 |
LeadrDoc *model = |
LeadrDoc *model = |
729 |
leadr_doc_open (er->path, er->path, err); |
leadr_doc_ref_or_open (documents, er->path, err); |
730 |
if (model) { |
if (model) { |
731 |
if (IS_APP_TRANSCRIPT (model)) { |
if (IS_APP_TRANSCRIPT (model)) { |
732 |
er->tx = APP_TRANSCRIPT (model); |
er->tx = APP_TRANSCRIPT (model); |
768 |
o_class->finalize = leadr_guessing_game_finalize; |
o_class->finalize = leadr_guessing_game_finalize; |
769 |
|
|
770 |
LeadrDocClass *doc_class = LEADR_DOC_CLASS (klass); |
LeadrDocClass *doc_class = LEADR_DOC_CLASS (klass); |
771 |
doc_class->is_exam = _gg_is_exam; |
doc_class->is_exam = _gg_is_exam; |
772 |
doc_class->is_scratch = _gg_is_scratch; |
doc_class->is_scratch = _gg_is_scratch; |
773 |
doc_class->stringify = _gg_stringify; |
doc_class->stringify = _gg_stringify; |
774 |
|
doc_class->open_exemplar = _gg_open_exemplar; |
775 |
|
|
776 |
g_object_class_install_property |
g_object_class_install_property |
777 |
(o_class, PROP_START, g_param_spec_long |
(o_class, PROP_START, g_param_spec_long |