-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can optionally show question URL's with or without pagination
- Loading branch information
Showing
10 changed files
with
214 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
database/migrations/2023_03_16_132104_update_question_url_view_to_assignments.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class UpdateQuestionUrlViewToAssignments extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('assignments', function (Blueprint $table) { | ||
$table->string('question_url_view') | ||
->after('solutions_availability') | ||
->default('assignment'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('assignments', function (Blueprint $table) { | ||
$table->dropColumn('question_url_view'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<template> | ||
<div> | ||
<toggle-button | ||
tabindex="0" | ||
:width="115" | ||
:value="assignment.question_url_view==='question'" | ||
:sync="true" | ||
:font-size="14" | ||
:color="toggleColors" | ||
:aria-label="assignment.question_url_view==='question' ? `Just the question for ${assignment.name} are shown` : `The entire assignment for ${assignment.name} is shown`" | ||
:labels="{checked: 'Question', unchecked: 'Assignment'}" | ||
@change="submitQuestionUrlView()" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import axios from 'axios' | ||
import { ToggleButton } from 'vue-js-toggle-button' | ||
export default { | ||
components: { ToggleButton }, | ||
props: { | ||
assignment: | ||
{ | ||
type: Object, | ||
default: function () { | ||
} | ||
} | ||
}, | ||
data: () => ({ | ||
assessmentType: '', | ||
toggleColors: window.config.toggleColors | ||
}), | ||
methods: { | ||
async submitQuestionUrlView () { | ||
try { | ||
const { data } = await axios.patch(`/api/assignments/${this.assignment.id}/question-url-view`) | ||
this.$noty[data.type](data.message) | ||
if (data.type === 'info'){ | ||
this.assignment.question_url_view = data.question_url_view | ||
} | ||
} catch (error) { | ||
this.$noty.error(error.message) | ||
} | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.