Skip to content

Commit b2a86c8

Browse files
Fixed Courses Page
1 parent ffed62e commit b2a86c8

File tree

6 files changed

+27
-5
lines changed

6 files changed

+27
-5
lines changed

DigiKaksha/app/Announcement.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@ public function user()
1313
public function course()
1414
{
1515
return $this->belongsTo('App\Course');
16-
}
16+
}
17+
public function submissions()
18+
{
19+
return $this->hasMany('App\Announcement');
20+
}
1721
}

DigiKaksha/app/Http/Controllers/SubmissionsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function index()
2323
*/
2424
public function create()
2525
{
26-
//
26+
2727
}
2828

2929
/**

DigiKaksha/app/Submission.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,12 @@
66

77
class Submission extends Model
88
{
9-
//
9+
public function announcement()
10+
{
11+
return $this->belongsTo('App\Announcement');
12+
}
13+
public function user()
14+
{
15+
return $this->belongsTo('App\User');
16+
}
1017
}

DigiKaksha/app/User.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,8 @@ public function announcements()
5050
{
5151
return $this->hasMany('App\Announcement');
5252
}
53+
public function submissions()
54+
{
55+
return $this->hasMany('App\Submission');
56+
}
5357
}

DigiKaksha/database/migrations/2020_05_02_105636_create_submissions_table.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ public function up()
1616
Schema::create('submissions', function (Blueprint $table) {
1717
$table->id();
1818
$table->timestamps();
19+
$table->integer('grade')->nullable();
20+
$table->mediumText('comment')->nullable();
21+
$table->mediumText('body');
22+
$table->string('file')->nullable();
23+
$table->string('checker')->nullable();
24+
$table->integer('user_id');
25+
$table->integer('announcement_id');
1926
});
2027
}
2128

DigiKaksha/resources/views/courses/show.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,8 @@
10411041
@endforeach
10421042
</tbody>
10431043
</table>
1044-
</div>
1045-
</div>
1044+
</div>
1045+
<br>
10461046
<!-- Footer -->
10471047
<footer class="footer pt-0">
10481048
<div class="row align-items-center justify-content-lg-between">

0 commit comments

Comments
 (0)