@@ -265,31 +265,31 @@ function moodleoverflow_print_latest_discussions($moodleoverflow, $cm, $page = -
265
265
}
266
266
267
267
// Check if the question owner marked the question as helpful.
268
- $ statusstarter = \mod_moodleoverflow \ratings::moodleoverflow_discussion_is_solved ($ discussion ->discussion , false );
268
+ $ markedhelpful = \mod_moodleoverflow \ratings::moodleoverflow_discussion_is_solved ($ discussion ->discussion , false );
269
269
$ preparedarray [$ i ]['starterlink ' ] = null ;
270
- if ($ statusstarter ) {
270
+ if ($ markedhelpful ) {
271
271
$ link = '/mod/moodleoverflow/discussion.php?d= ' ;
272
- $ statusstarter = $ statusstarter [array_key_first ($ statusstarter )];
272
+ $ markedhelpful = $ markedhelpful [array_key_first ($ markedhelpful )];
273
273
274
274
$ preparedarray [$ i ]['starterlink ' ] = new moodle_url ($ link .
275
- $ statusstarter ->discussionid . '#p ' . $ statusstarter ->postid );
275
+ $ markedhelpful ->discussionid . '#p ' . $ markedhelpful ->postid );
276
276
}
277
277
278
278
// Check if a teacher marked a post as solved.
279
- $ statusteacher = \mod_moodleoverflow \ratings::moodleoverflow_discussion_is_solved ($ discussion ->discussion , true );
279
+ $ markedsolution = \mod_moodleoverflow \ratings::moodleoverflow_discussion_is_solved ($ discussion ->discussion , true );
280
280
$ preparedarray [$ i ]['teacherlink ' ] = null ;
281
- if ($ statusteacher ) {
281
+ if ($ markedsolution ) {
282
282
$ link = '/mod/moodleoverflow/discussion.php?d= ' ;
283
- $ statusteacher = $ statusteacher [array_key_first ($ statusteacher )];
283
+ $ markedsolution = $ markedsolution [array_key_first ($ markedsolution )];
284
284
285
285
$ preparedarray [$ i ]['teacherlink ' ] = new moodle_url ($ link .
286
- $ statusteacher ->discussionid . '#p ' . $ statusteacher ->postid );
286
+ $ markedsolution ->discussionid . '#p ' . $ markedsolution ->postid );
287
287
}
288
288
289
289
// Check if a single post was marked by the question owner and a teacher.
290
290
$ statusboth = false ;
291
- if ($ statusstarter && $ statusteacher ) {
292
- if ($ statusstarter ->postid == $ statusteacher ->postid ) {
291
+ if ($ markedhelpful && $ markedsolution ) {
292
+ if ($ markedhelpful ->postid == $ markedsolution ->postid ) {
293
293
$ statusboth = true ;
294
294
}
295
295
}
@@ -401,8 +401,8 @@ function moodleoverflow_print_latest_discussions($moodleoverflow, $cm, $page = -
401
401
$ preparedarray [$ i ]['linktopopup ' ] = $ linktopopup ;
402
402
403
403
// Add all created data to an array.
404
- $ preparedarray [$ i ]['statusstarter ' ] = $ statusstarter ;
405
- $ preparedarray [$ i ]['statusteacher ' ] = $ statusteacher ;
404
+ $ preparedarray [$ i ]['markedhelpful ' ] = $ markedhelpful ;
405
+ $ preparedarray [$ i ]['markedsolution ' ] = $ markedsolution ;
406
406
$ preparedarray [$ i ]['statusboth ' ] = $ statusboth ;
407
407
$ preparedarray [$ i ]['votes ' ] = $ votes ;
408
408
@@ -1059,8 +1059,8 @@ function moodleoverflow_get_all_discussion_posts($discussionid, $tracking, $modc
1059
1059
$ posts [$ postid ]->upvotes = $ discussionratings [$ post ->id ]->upvotes ;
1060
1060
$ posts [$ postid ]->downvotes = $ discussionratings [$ post ->id ]->downvotes ;
1061
1061
$ posts [$ postid ]->votesdifference = $ posts [$ postid ]->upvotes - $ posts [$ postid ]->downvotes ;
1062
- $ posts [$ postid ]->statusstarter = $ discussionratings [$ post ->id ]->ishelpful ;
1063
- $ posts [$ postid ]->statusteacher = $ discussionratings [$ post ->id ]->issolved ;
1062
+ $ posts [$ postid ]->markedhelpful = $ discussionratings [$ post ->id ]->ishelpful ;
1063
+ $ posts [$ postid ]->markedsolution = $ discussionratings [$ post ->id ]->issolved ;
1064
1064
}
1065
1065
1066
1066
// Order the answers by their ratings.
@@ -1240,7 +1240,7 @@ function moodleoverflow_print_post($post, $discussion, $moodleoverflow, $cm, $co
1240
1240
if ($ canmarkhelpful ) {
1241
1241
// When the post is already marked, remove the mark instead.
1242
1242
$ link = '/mod/moodleoverflow/discussion.php ' ;
1243
- if ($ post ->statusstarter ) {
1243
+ if ($ post ->markedhelpful ) {
1244
1244
$ commands [] = html_writer::tag ('a ' , $ str ->marknothelpful ,
1245
1245
array ('class ' => 'markhelpful onlyifreviewed ' , 'role ' => 'button ' , 'data-moodleoverflow-action ' => 'helpful ' ));
1246
1246
} else {
@@ -1262,7 +1262,7 @@ function moodleoverflow_print_post($post, $discussion, $moodleoverflow, $cm, $co
1262
1262
1263
1263
// When the post is already marked, remove the mark instead.
1264
1264
$ link = '/mod/moodleoverflow/discussion.php ' ;
1265
- if ($ post ->statusteacher ) {
1265
+ if ($ post ->markedsolution ) {
1266
1266
$ commands [] = html_writer::tag ('a ' , $ str ->marknotsolved ,
1267
1267
array ('class ' => 'marksolved onlyifreviewed ' , 'role ' => 'button ' , 'data-moodleoverflow-action ' => 'solved ' ));
1268
1268
} else {
@@ -1335,8 +1335,8 @@ function moodleoverflow_print_post($post, $discussion, $moodleoverflow, $cm, $co
1335
1335
$ mustachedata ->votes = $ post ->upvotes - $ post ->downvotes ;
1336
1336
1337
1337
// Check if the post is marked.
1338
- $ mustachedata ->statusstarter = $ post ->statusstarter ;
1339
- $ mustachedata ->statusteacher = $ post ->statusteacher ;
1338
+ $ mustachedata ->markedhelpful = $ post ->markedhelpful ;
1339
+ $ mustachedata ->markedsolution = $ post ->markedsolution ;
1340
1340
1341
1341
// Did the user rated this post?
1342
1342
$ rating = \mod_moodleoverflow \ratings::moodleoverflow_user_rated ($ post ->id );
@@ -1377,11 +1377,11 @@ function moodleoverflow_print_post($post, $discussion, $moodleoverflow, $cm, $co
1377
1377
}
1378
1378
}
1379
1379
}
1380
- if ($ post ->statusstarter ) {
1381
- $ postclass .= ' statusstarter ' ;
1380
+ if ($ post ->markedhelpful ) {
1381
+ $ postclass .= ' markedhelpful ' ;
1382
1382
}
1383
- if ($ post ->statusteacher ) {
1384
- $ postclass .= ' statusteacher ' ;
1383
+ if ($ post ->markedsolution ) {
1384
+ $ postclass .= ' markedsolution ' ;
1385
1385
}
1386
1386
$ mustachedata ->postclass = $ postclass ;
1387
1387
0 commit comments